Water drinking event sequence anomaly detection method and electronic device

By using equipment observation capability models and drinking water event pattern models, the system distinguishes between equipment observation status and unknown time periods, solving the problem of differentiating between true absence of events and equipment non-observation in existing technologies, thus improving the accuracy and reliability of drinking water monitoring.

CN123139028APending Publication Date: 2026-11-20HEFEI IFLYTEK TOYCLOUD TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611457332.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-18
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

Existing technologies struggle to distinguish between genuine water deprivation events and unrecorded events due to equipment oversight, leading to false long periods of water deprivation or low water intake, which affects the accuracy and reliability of personal water consumption patterns.

Method used

By acquiring drinking water event data and equipment observation status data from drinking water equipment, the observation probability is output using the equipment observation capability model, dividing the effective no-event time period and the unknown time period, and using the drinking water event pattern model to determine the degree of anomaly, so as to avoid misjudging the unknown time period as zero drinking water events.

Benefits of technology

It improves the accuracy and reliability of drinking water monitoring, avoids misjudgments caused by discontinuous observation by the equipment, is more compatible with the natural fluctuations of human drinking behavior, and enhances the rationality of abnormal detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123139028A_ABST
    Figure CN123139028A_ABST
Patent Text Reader

Abstract

The application discloses a drinking water event sequence anomaly detection method and an electronic device, and relates to the technical field of intelligent health monitoring. The method comprises the following steps: acquiring drinking water event data and device observation state data of a drinking water device; outputting observation probabilities of each time period by using a device observation capability model, and dividing effective non-event time periods and unknown time periods according to the observation probabilities; inputting a drinking water event sequence containing confirmed events and different state time periods into a drinking water event rule model, and determining an anomaly degree based on a next drinking water event time distribution and / or a liquid volume distribution output by the model. The application can effectively distinguish between real non-drinking water and non-observation of the device, avoid false anomaly alarms, and improve the accuracy and reliability of drinking water monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent health monitoring technology, and more specifically, to a method and electronic device for detecting abnormalities in drinking water event sequences. Background Technology

[0002] With the widespread adoption of IoT technology and wearable devices, personal hydration monitoring based on smart water bottles has become an important tool for daily health management. These devices typically use built-in sensors to collect data such as changes in liquid volume, bottle movement, and contact status, aiming to quantify a user's water intake and analyze their drinking habits. In existing solutions, the system generally divides the entire day into fixed time slots. If no drinking event is detected within a certain time slot, the water intake for that period is assumed to be zero. Subsequently, the system uses statistical indicators such as the total daily water intake or the longest interval between adjacent events to determine if the user's drinking behavior is abnormal, and generates corresponding health reminders or reports accordingly.

[0003] However, in real-world applications, data acquisition is often discontinuous due to various complex factors, including the uncertainty of device status, power outages, sensor malfunctions, ambiguity in attribution caused by multiple users sharing the same container, and the possibility that users may use other containers for drinking. This lack of recording due to limited device observation capabilities is highly similar in data representation to the absence of events when a user has not actually drunk water. Existing technologies struggle to effectively distinguish between these two fundamentally different situations, leading to the erroneous labeling of unknown missing intervals as definite zero values ​​during data processing. This, in turn, causes bias in the personal drinking pattern model built upon it, ultimately affecting the accuracy and reliability of judging abnormal drinking behavior. Summary of the Invention

[0004] In view of the above problems, this application proposes to provide a method and electronic device for detecting anomalies in drinking water event sequences, in order to solve the technical problem in the prior art that it is difficult to distinguish between real no-drinking events and no-recording events caused by the device not observing them, resulting in false long-term no-drinking events and false low-drinking amounts, leading to distortion of individual drinking water pattern modeling and low accuracy and reliability of drinking water monitoring results. The specific solution is as follows:

[0005] Firstly, a method for detecting anomalies in drinking water event sequences is provided, including:

[0006] Acquire drinking event data and device observation status data of the drinking water device. The drinking event data includes confirmed drinking events belonging to a specified user. The device observation status data represents the device working status and user association status of the drinking water device at different time periods.

[0007] Using the configured device observation capability model, the observation probability for each time period is output based on the device observation status data. The observation probability represents the probability that if the target drinking event of the specified user occurs through the drinking device in the corresponding time period, the target drinking event can be correctly recorded by the drinking device and attributed to the specified user.

[0008] The time period in which the observation probability reaches the set observation threshold and there is no confirmed drinking event is divided into an effective event-free time period, and the time period in which the observation probability is lower than the set observation threshold is divided into an unknown time period.

[0009] The drinking water event sequence is input into the drinking water event pattern model. Based on the time distribution and / or liquid volume distribution of the next drinking water event output by the drinking water event pattern model, the degree of abnormality of the drinking water event sequence is determined. The drinking water event sequence includes the confirmed drinking water events, the effective event-free time periods, and the unknown time periods. The unknown time periods are marked as unknown in the drinking water event sequence.

[0010] In a second aspect, an electronic device is provided, comprising: a memory and a processor;

[0011] The memory is used to store programs;

[0012] The processor is configured to execute the program to implement the various steps of the drinking water event sequence anomaly detection method as described in the first aspect.

[0013] By employing the aforementioned technical solution, this application, through a device observation capability model, outputs the observation probability for each time period based on the device's operating status and the user's associated status. This observation probability is the conditional probability that an event can be correctly recorded and attributed to a designated user, given the occurrence of a target drinking event. This enables independent quantification of the recording and attribution capability of drinking events from the device side, moving beyond simply relying on the presence or absence of drinking records to directly infer user drinking behavior. This provides a quantitative basis for distinguishing time periods with different observation qualities. Furthermore, based on the observation probability, effective no-event time periods and unknown time periods are divided. This allows for differentiated distinction between time periods with "no confirmed drinking events," distinguishing between no-event time periods with reliable observation conditions and unknown time periods with insufficient observation capability. This overcomes the shortcomings of existing technologies that treat all no-record time periods equally, easily misjudging them as zero drinking events. In the drinking event sequence, unknown time periods are marked as unknown states. This marking indicates that the observation of this time period is unreliable and does not default to zero drinking events for this period. After receiving a complete drinking water event sequence carrying this tag, the drinking water event pattern model can identify the observational uncertainty in the sequence. It will not treat time intervals spanning unknown time periods as true drinking water intervals for anomaly assessment, fully respecting the inherent uncertainty of the data, avoiding analytical bias caused by false drinking water intervals, and improving the accuracy and reliability of drinking water monitoring.

[0014] The degree of abnormality is determined by the time distribution and / or volume distribution of the next drinking event output by the drinking event pattern model. The distribution is used to characterize the normal fluctuation of drinking behavior, rather than simply using a single threshold for judgment. This is more in line with the inherent fluctuation characteristics of human drinking behavior and improves the rationality of the abnormality assessment. Attached Figure Description

[0015] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0016] Figure 1 This is a schematic flowchart of a method for detecting anomalies in a drinking water event sequence provided in an embodiment of this application;

[0017] Figure 2 A schematic diagram of a drinking water event pattern model provided in this application embodiment;

[0018] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0019] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0020] It is understood that before using the technical solutions disclosed in the various embodiments of this application, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this application in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0021] The drinking water event sequence anomaly detection method provided in this application can be executed by a processing device with data processing capabilities. The processing device can be a drinking water device, a reference terminal, or a third-party device such as a mobile phone, tablet computer, server, or cloud server that is communicatively connected to both the drinking water device and the reference terminal. The reference terminal is a terminal device associated with the user of the drinking water device, such as a smartwatch, smart bracelet, mobile phone, or school badge.

[0022] Sensors can be installed on drinking water equipment to detect data related to drinking events, such as flow sensors, volume sensors, cup or spout contact sensors, and motion sensors. They can also record observed status data, such as equipment presence, power supply status, sensor self-test status, individual ownership status, and shared-use status. Motion sensors can be installed on the reference end to provide contextual information such as activity status from independent sources.

[0023] In some embodiments, the processing device is a drinking water device. The drinking water device may include sensors, a communication module, and a processor. The sensors are used to detect drinking water event-related data; the communication module is used to communicate with a reference terminal to receive contextual information or auxiliary observation status data sent by the reference terminal; the processor is used to execute the drinking water event sequence anomaly detection method provided in this application embodiment. In this embodiment, the drinking water event data and device observation status data are acquired by the drinking water device itself, and the contextual information may be provided by the reference terminal.

[0024] In other embodiments, the processing device is a reference end. The reference end may include a sensor, a communication module, and a processor. The communication module is used to communicate with the drinking water device to receive drinking event data and device observation status data sent by the drinking water device; the processor is used to execute the drinking event sequence anomaly detection method provided in the embodiments of this application. In this embodiment, the reference end can provide contextual information such as activity status from an independent source, and the drinking event data and device observation status data are received from the drinking water device.

[0025] In some embodiments, the processing device is a third-party device, such as a mobile phone, tablet, server, or cloud server, that is communicatively connected to both the drinking water device and the reference terminal. The third-party device receives drinking event data and device observation status data from the drinking water device, and receives contextual information from the reference terminal, thereby executing the drinking event sequence anomaly detection method provided in this application. In this embodiment, the anomaly detection result can be output by the third-party device, or it can be sent by the third-party device to the drinking water device and / or the reference terminal for output, display, or prompting.

[0026] It should be noted that the embodiments of this application do not limit the method for detecting anomalies in drinking water event sequences to be executed entirely by the same device. In some embodiments, the method can also be executed collaboratively by the drinking water device, the reference device, and / or a third-party device. For example, at least some of the steps in acquiring drinking water event data, acquiring device observation status data, outputting observation probabilities using the device observation capability model, dividing effective no-event time periods and unknown time periods, inputting the drinking water event sequence into the drinking water event pattern model, determining the degree of anomaly, generating possible missed drinking water events, determining whether the anomaly degree conclusion is sensitive to missed drinking water events, and outputting prompts can be executed separately by different devices among the drinking water device, the reference device, and / or the third-party device. The anomaly detection result can be output locally on the executing device or sent to other devices for output, display, or prompting.

[0027] The above-described application entities are merely examples of embodiments of this application and do not constitute a limitation on the entities that can execute this application. Those skilled in the art can select a drinking water device, a reference terminal, a third-party device, or a combination thereof to execute the drinking water event sequence anomaly detection method provided in the embodiments of this application, based on the actual product form, communication connection method, and distribution of computing resources.

[0028] This application provides a method for detecting anomalies in drinking water event sequences, referring to... Figure 1 The method for detecting anomalies in drinking water event sequences specifically includes the following steps:

[0029] Step S100: Obtain drinking water event data and equipment observation status data from the drinking water equipment.

[0030] Among them, drinking water event data includes confirmed drinking water events belonging to designated users, and equipment observation status data represents the equipment working status and user association status of drinking water equipment at different time periods.

[0031] Drinking event data originates from the sensing and identification system within the drinking water equipment, used to record actual drinking behaviors. Equipment observation status data, on the other hand, is used to monitor the equipment's operating environment and associated conditions to assess its ability to perceive drinking behaviors. Specifically, drinking event data includes confirmed drinking events belonging to a designated user, which have undergone preliminary identity verification to confirm that they were generated by that user through the drinking water equipment. Equipment observation status data is a set of time-varying state vectors, representing the equipment's operating status and user-related status at different times, such as whether the equipment is powered on and online, whether the sensors are working properly, and whether the equipment is currently bound to the designated user. By acquiring these two types of data, this application can simultaneously determine what events occurred and whether the equipment can see what events occurred, providing a data foundation for subsequently distinguishing between events that are not actually observed and events that the equipment has not observed.

[0032] Step S110: Using the configured device observation capability model, output the observation probability for each time period based on the device observation status data.

[0033] The observed probability represents the probability that if a target drinking event occurs during the specified time period through the drinking water device, the target drinking event can be correctly recorded by the drinking water device and attributed to the specified user.

[0034] This step uses a device observation capability model to calculate and quantify the device's ability to perceive and record target drinking events across different time periods. The device observation capability model is a pre-trained and configured model; its input is device observation status data, and its output is the observation probability for each time period. Observation probability is a conditional probability index, its physical meaning being: assuming a specified user actually engaged in a target drinking event through the drinking device within a certain time period, the probability that the event can be completely captured, recorded, and correctly attributed to that specified user by the device. This index decouples the causal link between whether an event occurred and whether the device can record it, allowing the system to assess the reliability of its recording capability based solely on the device's status, even without knowing whether the event actually occurred. For example, if the device loses power or the sensor malfunctions during a certain time period, the observation probability for that time period will significantly decrease; conversely, if the device is functioning normally and the user's identity is clear, the observation probability approaches 1. By calculating the observation probability, the system can dynamically identify which time periods' data are reliable and which time periods' data may be at risk of missing data.

[0035] Step S120: The time period in which the observation probability reaches the set observation threshold and there is no confirmed drinking event is divided into the effective no-event time period, and the time period in which the observation probability is lower than the set observation threshold is divided into the unknown time period.

[0036] This step qualitatively divides time periods without confirmed drinking events based on the observation probability, clarifying the nature of different blank time periods. Setting an observation threshold is a preset threshold used to determine if the observation probability is high enough. Its value can be set based on the device's average performance indicators, historical false alarm rate statistics, or the minimum confidence requirement for data from the business; for example, it can be set to 0.8 or 0.9. During the division process, the system compares the observation probability of each time period with the set observation threshold. For time periods where the observation probability reaches or exceeds the set observation threshold, it indicates that the device has good observation capabilities within that period. If no confirmed drinking events are recorded within this period, it can be reasonably inferred that the target drinking event did not occur during that period, thus classifying it as a valid event-free time period. Conversely, for time periods where the observation probability is lower than the set observation threshold, because the device is in a low-confidence state (e.g., offline, malfunction), even if no drinking events are recorded, it cannot be determined whether it is due to a genuine absence of events or a missed recording caused by device malfunction; therefore, it is classified as an unknown time period. This division method effectively avoids the problem of misjudging a lack of observed events as a genuine absence of events, improving the logical rigor of anomaly detection.

[0037] Step S130: Input the drinking water event sequence into the drinking water event pattern model, and determine the degree of abnormality of the drinking water event sequence based on the time distribution and / or liquid volume distribution of the next drinking water event output by the drinking water event pattern model.

[0038] The drinking water event sequence includes confirmed drinking water events, valid no-event time periods, and unknown time periods. Unknown time periods are marked as unknown in the drinking water event sequence.

[0039] This step utilizes a pattern model to analyze time series containing multiple state markers, thereby quantifying the degree of deviation from the current drinking behavior pattern. The drinking event sequence is a data structure arranged chronologically, containing not only confirmed drinking events but also the effective no-event time periods and unknown time periods identified in the previous steps. Specifically, to prevent the model from misfitting to missing information within unknown time periods, these periods are marked as unknown states in the drinking event sequence, enabling the model to identify and handle these periods specially. During inference, the drinking event pattern model does not classify the time difference between two events spanning unknown time periods as a complete drinking interval. The drinking event pattern model is a predictive model used to learn the drinking habits of a specified user. Based on the input historical sequence, it can predict the timing and volume patterns of the next drinking event. The model's output time distribution of the next drinking event describes the probability density function of future drinking events occurring on the time axis, which may exhibit a distribution pattern of first increasing and then decreasing over time; the output volume distribution of the next drinking event describes the probability distribution of a single drinking volume. The system compares the distribution output by the drinking event pattern model with the actual observed subsequent events to calculate the degree of matching between the two, thereby determining the degree of anomaly in the drinking event sequence. For example, if the time or volume of the next drinking event actually occurs within the low-probability region predicted by the model, the degree of anomaly is determined to be high. By combining the comprehensive judgment of time distribution and volume distribution, abnormal fluctuations in drinking behavior can be captured more comprehensively, providing accurate evidence for health monitoring.

[0040] The method provided in this embodiment solves the problem in existing technologies that cannot distinguish between genuine no-event periods and unobserved equipment. By using the observation probability output by the equipment observation capability model, the system can accurately distinguish between valid no-event periods and unknown periods, and incorporate the unknown periods into the drinking event sequence as unknown state markers, thereby avoiding misjudging equipment blind spots as genuine no-drinking events. Based on this, the drinking event pattern model predicts based on the sequence containing state markers, using the time distribution and / or liquid volume distribution of the next drinking event to quantify the degree of anomaly. This ensures that the anomaly determination result reflects both deviations from individual drinking habits and eliminates interference from equipment state fluctuations, ultimately achieving accurate and robust detection of anomalies in drinking event sequences.

[0041] This application describes a structure for device observation status data, which may include at least two of the following: device presence status, power supply status, sensor self-test status, individual ownership status, and shared status among multiple users.

[0042] Device presence status indicates whether a water dispenser is near a designated user. Specifically, it acquires short-range communication signals between the water dispenser and a personal token carried by the designated user. By combining signal strength, duration, and geographical consistency, the physical distance between the device and the user is determined. Personal tokens include smartphones, smart bracelets, etc.; short-range communication signals include Bluetooth Low Energy (BLE) signals and Radio Frequency Identification (RFID) signals. Device presence is confirmed when preset association conditions are consistently met; device absence is confirmed when a clearly distant signal or offline token is detected; and presence status is marked as unknown when the signal is lost, expired, or there is conflicting evidence.

[0043] Power supply status is directly related to the hardware availability of a device. By reading data from the device's internal power management unit, the battery level, charging status, and power on / off records are obtained, forming a power supply status log that changes over time.

[0044] Sensor self-test status characterizes the hardware health of the sensing link. During system initialization or periodic self-test phases, self-test programs for key components such as flow sensors, level sensors, and accelerometers are triggered, and feedback signals from each sensor are collected. The collected feedback signals are compared with preset normal response thresholds. If sensor blockage, numerical drift, or no response is detected, it is marked as a self-test anomaly; if the responses of all components are within the normal range, it is marked as a self-test pass.

[0045] The user's ownership status is used to confirm whether the user performing the drinking water event during the current time period is the designated user. Valid user authentication information and usage sessions are recorded and analyzed. Specifically, when valid fingerprint authentication, Near Field Communication (NFC) identification, personal token verification, or explicit account switching operations within the application are detected, a corresponding user session is established or updated, saving the user identifier, authentication method, session start and end times, and trusted status. If no valid authentication information is detected within a specific time period, or a user switching command is detected, the user's ownership status for that time period is marked as unknown or assigned to another user.

[0046] The multi-user sharing status is used to characterize whether a device is being used by multiple people in turn. It monitors whether multiple different valid user tokens appear alternately within a short period, whether device borrowing or handover behavior is detected, and whether multiple ownership evidences conflict with each other. When a user is detected actively activating sharing mode, or when two or more different valid user authentication records are detected within a short period, the corresponding time period is marked as multi-user sharing. If multiple mobile phone signals are detected near the device but there is no clear device operation behavior, it is not directly determined as multi-user sharing.

[0047] The aforementioned multiple states collectively constitute the multidimensional input vector of the equipment observation capability model. By selecting at least two states for combined analysis, the risk of misjudgment due to a single state can be effectively reduced. Through cross-validation and joint determination of multiple state sources, the equipment observation capability model can more accurately output the observation probability for each time period, thus providing a solid data foundation for subsequently distinguishing between effective event-free time periods and unknown time periods.

[0048] In some embodiments of this application, the process of obtaining confirmed drinking events in step S100 is further described, and this process may include:

[0049] S1. Based on the multi-channel sensor data reflecting water cup usage events, candidate events are obtained.

[0050] Multi-sensor data refers to a sequence of raw data collected by various types of sensors deployed on a smart water bottle, reflecting changes in the bottle's physical state across different dimensions. This data can be a multimodal information set characterizing the interaction between the water bottle and its external environment and the user. Specific dimensions include: fluid velocity and instantaneous flow data collected by a flow sensor, reflecting the rate of liquid pouring or drinking; total liquid volume data collected by a level sensor or weighing sensor, reflecting trends in liquid increase or decrease; contact status data of the cup rim or spout collected by a capacitance or pressure sensor, determining whether there is lip or straw contact; and cup motion posture data collected by an accelerometer or gyroscope, identifying actions such as lifting, tilting, and laying flat. These data are synchronized over time, collectively forming the basic evidence for determining the nature of events.

[0051] Candidate events are data objects formed by detecting abnormal change segments that conform to preset triggering rules from the aforementioned multi-sensor data streams, and by initially extracting their start and end times and key physical quantities. The data streams of each sensor channel are continuously monitored, and when a sudden increase in flow rate, a drop in liquid level exceeding a set fluctuation range, a change in contact status from none to presence, or a drastic change in motion posture is detected, the event capture logic is triggered. A time window containing complete signal change characteristics is extracted forward and backward from the trigger time, for example, covering a preset duration before and after the start of the event. Data segments from each channel within this time window are aggregated, and the integrated flow rate, the difference in liquid volume at the start and end, the duration of contact, and the motion feature vector within the window are calculated, thereby generating a candidate event object containing time boundaries, liquid volume changes, and multi-source evidence features. This candidate event object serves as the smallest analytical unit for subsequent determination of whether actual drinking water has occurred.

[0052] S2. Input the candidate events into the event classification module to obtain the scores of the candidate events belonging to each candidate event category. The candidate event categories must include at least the drinking category.

[0053] The event classification module is configured as a model based on machine learning algorithms to perform semantic-level category recognition of input candidate events. Its construction process is completed during the offline training phase: training data comes from a large number of candidate event samples collected from various water cup usage scenarios. Each sample contains corresponding multi-sensor data features, and is manually verified and labeled with real action tags, such as drinking, pouring, refilling, leaking, or unknown. During the training phase, architectures such as deep convolutional neural networks or long short-term memory networks can be used to map multi-sensor data features into high-dimensional feature vectors. A softmax normalization layer outputs the probability values ​​belonging to each preset category, and the network weights are iteratively updated using the cross-entropy loss function as the optimization objective, employing a backpropagation algorithm until the model's classification accuracy on the validation set stabilizes, thus completing the pre-training.

[0054] Candidate event categories can refer to the set of all possible event types that the model can output, at least including the drinking category, which represents the behavior of a user directly ingesting liquid through a cup or straw; in addition, depending on business needs, it can also include the pouring category (referring to the behavior of pouring liquid from a cup into another container), the replenishment category (referring to the behavior of adding liquid to a cup), the leakage category (referring to the unintentional loss of liquid), and the unknown category. The score can refer to the confidence value calculated by the event classification module for the current candidate event, which indicates whether it belongs to each candidate event category. It is usually a real number between 0 and 1, and the higher the value, the greater the probability that the candidate event belongs to that category.

[0055] After a candidate event is input into the event classification module, the module performs forward calculations and outputs the score of the candidate event for each category, such as drinking, pouring, and rehydration.

[0056] S3. Determine whether a candidate event is a drinking event based on the score of the candidate event belonging to the drinking category and the results of at least one evidence check.

[0057] The evidence review result refers to the judgment obtained after physical and logical verification of the quality of the sensor data on which the candidate event depends, the sufficiency of the evidence, and the logical consistency. Its purpose is to eliminate false candidate events caused by sensor noise, interference, or unreliable single pieces of evidence from the perspective of engineering rationality and data reliability. Specific review items may include at least one of the following dimensions:

[0058] Whether the signal quality is up to standard, that is, whether the signal-to-noise ratio of the key sensor channel (such as flow meter, level gauge) on which the candidate event is based reaches the preset threshold, and whether there is signal saturation, breakpoint or abnormal fluctuation.

[0059] Whether the number of valid evidence reaches the set number, that is, whether the number of independent evidence sources supporting the candidate event (such as both flow rate changes and contact actions, or both liquid volume decreases and attitude changes) meets the minimum multi-source fusion requirement.

[0060] Whether different pieces of evidence are compatible in terms of measurement, that is, whether the changes obtained by measuring through different physical principles are consistent within the allowable error range, for example, whether the difference between the liquid volume obtained by flow integration and the liquid volume measured by the liquid level sensor is less than the preset error tolerance.

[0061] The difference between the drinking category score and the scores of other categories, i.e., whether the drinking category score is significantly higher than the score of competing categories (such as the pouring category), and whether the difference reaches a preset threshold value, is used to ensure the confidence level of the classification.

[0062] When determining whether a candidate event is a drinking event, the evidence examination results can first be checked to see if they meet the preset admission criteria, such as acceptable signal quality, sufficient quantity of valid evidence, and metrological compatibility among the evidence. If the basic physical conditions are not met, it is directly determined to be a non-drinking event or an invalid event. If the basic physical conditions are met, the drinking category score is further considered for judgment. The judgment rule could be, for example, that the drinking category score must be greater than a preset event confirmation threshold (e.g., 0.90), and the difference between the drinking category score and the scores of other major competing categories must be greater than a preset gap threshold (e.g., 0.20). Only when a candidate event exhibits high-confidence drinking characteristics in semantic classification and withstands quality and consistency tests in physical evidence is it determined to be a drinking event.

[0063] This step effectively compensates for the lack of robustness of pure classification models under extreme noise and the weakness of pure rule models in generalization in complex scenarios by combining probabilistic statistical discrimination with deterministic physical rules.

[0064] S4. When a candidate event is determined to be a drinking event and can be attributed to a designated user, the candidate event is treated as a confirmed drinking event.

[0065] The process of determining whether a candidate event can be attributed to a specified user may include:

[0066] S41. Determine the personal use session to which the occurrence time of the candidate event falls. The personal use session includes the user ID, authentication method, session start and end time, and trusted status.

[0067] A personal use session represents a continuous and valid time window within which a drinking water device can be clearly associated with a single user. Essentially, it is a time-bounded period for attribution identification. Internally, a personal use session consists of four core elements: user identifier, authentication method, session start and end times, and trusted status. The user identifier uniquely identifies a specific user account or identity profile; the authentication method records the verification mechanism used to establish the session, such as fingerprint verification, Near Field Communication (NFC) verification, or personal token verification; the session start and end times define the valid time span of this attribution relationship; and the trusted status characterizes the clarity and reliability level of the attribution information during the session.

[0068] The formation of a personal user session can be based on multi-source authentication and status data collected by the device. During the session construction phase, the system continuously monitors the device's authentication interface and sensor data. When a valid user authentication operation is detected, such as successful fingerprint matching or establishment of a personal token connection, the system obtains the corresponding identity credential as the user identifier and simultaneously records the authentication method. Subsequently, the system determines the session start and end time, starting from the moment of successful authentication and ending with a preset session timeout or explicit logout / unbinding operations. During the session's validity period, the system comprehensively evaluates and dynamically updates the trusted status based on the device's presence, token connection stability, and whether there are signs of multiple users sharing the token. If ambiguity arises during this period, the trusted status is marked as ambiguous or conflicting; if a unique and clear association is maintained throughout, it is marked as clearly associated. Finally, this structured information is stored as a session record in time-series format for retrieval and matching during subsequent attribution determination.

[0069] During the attribution determination phase, the precise timestamp of each event is extracted from the candidate event data and compared with records in the session database. This process first filters out all candidate sessions that time-cover the given timestamp. If multiple overlapping sessions exist or no sessions overlap, the attribution is initially deemed ambiguous; if only one valid session exists, it is identified as the target personal session. Subsequently, detailed information such as the session's user ID, authentication method, session start and end times, and trust status is read as input for subsequent determination steps.

[0070] S42. If the authentication method of the personal use session is valid authentication, the occurrence time of the candidate event is within the start and end time of the personal use session, the trusted state identifier is clearly assigned, and there is no user switching, sharing, handover or other ownership conflict during the candidate event, then the candidate event is determined to belong to the user corresponding to the user identifier.

[0071] Through multi-layered verification logic, a rigorous and exclusive mapping relationship is established between candidate events and designated users. During this determination process, the session information obtained in the preceding steps is matched item by item against preset determination rules. First, the validity of the authentication method is checked, requiring that the authentication means used to establish the session must be a security mechanism supported by the device and not revoked. For example, fingerprint feature comparison must pass a preset similarity threshold, and personal tokens must be in a continuous connection and handshake state. If the authentication method fails, such as a token disconnection or authentication expiration, the attribution is directly rejected. Second, the consistency of verification time is verified; that is, the occurrence time of the candidate event must strictly fall within the closed interval defined by the session start and end times. Any event earlier than the start time or later than the end time is considered outside the jurisdiction of the session.

[0072] Further verification of the trusted status is conducted. Only when the trusted status field explicitly indicates clear ownership is the session qualified as a basis for ownership determination. If the status is unknown, ambiguous, or conflicting, it indicates that there is ownership uncertainty during that period, and ownership cannot be forcibly determined. Finally, conflict resolution is performed. The system scans within the specific time window of the candidate event to check for user switching operations (such as account changes), activation of multi-user sharing modes (such as temporary guest mode), device handover behaviors (such as physical transfers), or any other conflicting events that may lead to a change in device ownership. This conflict information can come from application layer logs, sensor switching records, or physical power on / off status. Only when all the above conditions are met simultaneously will the system ultimately determine that the candidate event belongs to the user corresponding to the user identifier. Through this multi-dimensional and rigorous filtering, ownership drift caused by relying solely on static device binding information is avoided, thereby ensuring the accuracy and reliability of confirmed drinking water events.

[0073] A candidate event is confirmed as a drinking event only if it passes the drinking event determination in step S3 and can be clearly attributed to a designated user in step S4 (i.e., there is a unique and valid user session coverage).

[0074] The confirmed drinking event is officially recorded in the designated user's personal drinking sequence. This record includes information such as: user identifier, start and end times of the event, event volume (e.g., flow rate integral value or level difference), and supporting evidence and confidence level markers. Confirmed drinking events form a reliable data foundation for subsequent development of drinking event pattern models, evaluation of equipment observation capabilities, and anomaly detection. Candidate events that cannot be determined as drinking events, or that, although determined as drinking events, cannot be uniquely attributed (e.g., expired session, shared status, or unclear attribution), will not be written into the personal sequence as confirmed drinking events, thus avoiding data contamination due to misattribution.

[0075] The foregoing embodiments described a device observation capability model that outputs the observation probability for each time period based on input device observation status data. In this embodiment, the input data for the device observation capability model not only covers the device's own status but can also further integrate external contextual information to evaluate the device's recording capabilities across a broader range of scenarios. Contextual information describes the external environment in which the device is located and the background characteristics of the user, and includes at least one of the following: time period, day type, location category, ambient temperature, and activity status from independent sources.

[0076] Among them, time period refers to the distribution interval of the current time within a day, such as morning, noon, afternoon, or evening, used to capture differences in users' drinking frequency and device wearing habits during different time periods; day type refers to the nature of the date, such as weekday, weekend, or statutory holiday, used to reflect the impact of different schedules on device usage patterns; location category refers to the type of physical location where the device is located, such as home, office, school, outdoors, or transportation, as the signal environment, interference sources, and user habits may differ in different locations; ambient temperature refers to the current ambient temperature value, as temperature changes may affect the sensor's sensitivity or battery performance, thereby indirectly affecting the device's observation capabilities.

[0077] Independently sourced activity status refers to information measured and provided by an independent terminal outside the water dispenser, representing the activity status of a specified user during a corresponding time period. This information is not directly derived from the water dispenser's own sensors, but rather acquired through an independent terminal such as a smartphone, smartwatch, or smart bracelet linked to the user. The independent terminal uses data from built-in sensors such as accelerometers and gyroscopes to identify the user's activity status, such as being stationary, walking, running, sleeping, or riding in a vehicle. Introducing independently sourced activity status as input avoids the problem of inaccurate judgment of the user's actual activity status when the water dispenser itself is stationary or not worn. For example, when the water dispenser is placed on a table and the user is engaged in vigorous exercise, the activity status provided by the independent terminal helps the model determine the likelihood of the device recording events in the current environment.

[0078] Equipment status history is a core component of equipment observation status data, representing a continuous sequence of equipment operating states over a period of time. It is not a snapshot of a single moment, but rather a collection of status records arranged chronologically, containing information that changes over time, such as equipment presence, power supply status, sensor self-test status, individual ownership status, and shared-use status. This historical data is obtained by reading equipment logs, user binding / authentication information, and independent proximity correlation data, retaining the timestamp, source, and expiration date of each status.

[0079] During the process of constructing device status history, the system continuously monitors the near-field communication results between the device and the user's personal token (such as a mobile phone or wristband) to determine the device's presence; determines the power supply status based on battery level and power management system data; determines the sensor self-test status based on the results returned by the sensor self-test program; determines the individual ownership status based on authentication information such as account binding, fingerprint recognition, near-field communication, or in-app selection; and determines the multi-user sharing status by the user actively enabling the sharing mode or by the occurrence of multi-user switching records within a short period of time. The above status information is organized into a structured sequence with a time index, forming the device status history, providing a dynamic basis for judging the reliability of the current record for the device observation capability model.

[0080] By inputting contextual information and device state history into the device observation capability model, the model can learn the probability distribution of correctly recording and attributing drinking events under different combinations of external contexts and internal device states. This process utilizes the macro-environmental background provided by contextual information to help explain the fluctuations in recording capability exhibited in the device state history. For example, in a weekday morning + office + static context, even with slight fluctuations in device state, the recording probability is usually high; while in a weekend outdoor + high temperature + running context, even if the device state appears normal, the recording probability may decrease due to unstable wearing or environmental interference. By fusing these two types of information, the model's output observation probability can more accurately reflect the recording uncertainty in the real world, thereby avoiding misclassification of missed recordings due to unfavorable contexts as genuine no events, and improving the accuracy and robustness of drinking event sequence anomaly detection results.

[0081] In this embodiment of the application, the training process of the device observation capability model is further described, and the training process may include:

[0082] S1. Obtain training samples and corresponding observation labels. Training samples include device observation status data and contextual information. Observation labels indicate whether the target drinking event was correctly recorded by the drinking device and correctly attributed to the designated user in an independent test.

[0083] A training dataset for supervised learning is constructed, whose input features mainly consist of two parts: device observation state data and contextual information. Device observation state data characterizes the hardware and software operating status of the drinking water equipment at different times, covering historical data such as presence status, power supply status, sensor self-test status, individual ownership status, and multi-user sharing status. This data reflects whether the equipment possesses the basic conditions for detecting and recording drinking events at both the physical and logical levels. Contextual information, as auxiliary features, includes time period, day type, location category, ambient temperature, and activity status provided by independent terminals, used to describe the external environmental background when the event occurs.

[0084] The observation labels corresponding to the aforementioned input features are obtained based on objective testing or manual verification independent of device operation logs to ensure the authenticity and reliability of the supervisory signals. For example, a controlled experiment is conducted where testers perform a known target drinking event at a specified time. Manual review or cross-validation across multiple devices confirms whether the event was successfully captured and saved by the drinking device's sensors and accurately associated with the designated user account. If the target drinking event is successfully recorded and correctly attributed, the corresponding observation label is marked as a positive sample (e.g., value 1); otherwise, it is marked as a negative sample (e.g., value 0). This labeling method avoids the model mistakenly learning spurious associations where unrecorded events represent a lack of observation capability, thereby improving the confidence of the training data.

[0085] To further clarify, the training samples do not include information on whether a drinking event has been detected during the current analysis period. This is because this information represents the actual recording results of the equipment and is highly correlated with the prediction target of the equipment's observation capability model. Using this as an input feature would introduce target leakage and circular reasoning: the model might directly infer "the equipment has observation capability" based on "a drinking event has been detected," or infer "the equipment does not have observation capability" based on "no drinking event has been detected," instead of learning from the equipment's operating status and contextual information whether the equipment can correctly record and attribute a target drinking event when it actually occurs.

[0086] Furthermore, the absence of a detected drinking event could indicate either that the target drinking event did not occur, or that the target drinking event did occur but was not recorded or correctly attributed by the device. This information itself cannot distinguish between these two situations. If it is used as input, the model will be unable to reliably determine whether the device has observation capabilities during the unrecorded period, thus weakening its ability to identify missed recordings. Excluding this information in both training and inference processes can prevent the model from learning spurious associations and ensure the independence of observation probability estimation.

[0087] S2. Input the training samples into the device observation capability model to obtain the observation probability output by the model.

[0088] The constructed training samples are input into the device observation capability model to perform forward propagation. The feature extraction layer within the model encodes and abstracts the input device observation state data and contextual information, extracting a high-dimensional feature vector that comprehensively reflects the current observation conditions. Subsequently, the probability output layer performs a non-linear mapping based on this high-dimensional feature vector, calculating and outputting a value between 0 and 1, i.e., the observation probability.

[0089] This observation probability characterizes the likelihood that, given the device state and context, if a designated user engages in a target drinking event through the drinking device, the event can be correctly detected, recorded, and attributed to the designated user.

[0090] S3. Calculate the loss based on the observation probability and observation label output by the model, and update the device observation capability model according to the loss.

[0091] The error between the observation probability predicted by the quantification model and the observation label obtained from independent testing is used to guide the iterative optimization of the model parameters. For the binary classification problem of correctly recorded versus incorrectly recorded, the binary cross-entropy loss function can be used as the optimization objective, and its calculation form is as follows:

[0092]

[0093] In the formula, This represents the total number of training samples. Indicates the sample index. Indicates the first The observation label (with a value of 0 or 1) corresponds to each sample. The model represents the first The observed probability of each sample output. In the formula, This term is used to penalize cases where the predicted probability is too low when the label is a positive sample. This term is used to penalize cases where the predicted probability is too high when the label is negative. The overall loss value of the current model on the training set is obtained by summing and averaging the losses of all samples.

[0094] The gradient of the loss function with respect to each parameter in the model is calculated using the backpropagation algorithm, and the model parameters are updated using gradient descent or its variants (such as the Adam adaptive moment estimator). This update process aims to adjust the parameter weights so that the observation probabilities output by the model in the next iteration are closer to the true observation labels, thereby minimizing the loss function value. After multiple rounds of iterative training until the loss function converges or reaches the preset number of training rounds, the device observation capability model learns the potential mapping pattern between device status, context, and actual recording capability, and can accurately output statistically significant observation probabilities, providing a reliable quantitative basis for the effective time period segmentation in the anomaly detection of drinking water event sequences.

[0095] In some embodiments of this application, a drinking water event pattern model is further described.

[0096] The input data for the drinking water event pattern model not only includes drinking water event sequences, but can also further integrate external contextual information. The meaning of contextual information can be found in the previous section and will not be repeated here.

[0097] Introducing contextual information aims to establish a mapping between user drinking behavior and specific spatiotemporal environments and physiological states. This multi-dimensional input structure allows the model to learn not only macroscopic statistical patterns of drinking intervals but also fine-grained conditional distribution patterns. For example, the model can identify and learn the high-frequency, stable drinking characteristics exhibited by users in weekday office scenarios, as well as the irregular intervals and large amounts of water consumed in outdoor sports scenarios. The extraction of these differentiated patterns significantly enhances the model's ability to represent drinking behavior in complex life scenarios.

[0098] Reference Figure 2 This embodiment provides an optional component structure for a drinking water event pattern model, which may include: a context encoding layer, a historical event encoder, an event time prediction layer, and an event liquid volume prediction layer.

[0099] The context coding layer is used to encode the contextual information input.

[0100] The context encoding layer is responsible for transforming discrete or continuous contextual information into feature vectors that the model can compute. This contextual information typically includes data such as time period, day type, location category, ambient temperature, and activity status from independent sources. To handle this heterogeneous data, the context encoding layer employs a structure combining embedding techniques with fully connected layers: for discrete features such as time period, day type, and location category, the embedding layer maps them into low-dimensional dense vectors; for continuous features such as ambient temperature, normalization is performed followed by feature transformation through fully connected layers. Subsequently, the vector representations of all the above features are concatenated or fused to generate a unified contextual feature vector.

[0101] The historical event encoder is used to encode the drinking water event sequence.

[0102] Historical event encoders are primarily used to capture the time-series dependencies of a user's drinking behavior. The input sequence of drinking events consists of a series of records arranged chronologically, each record containing at least the event time and volume, along with an observation state marker (e.g., no event, unknown state). To handle this sequence data with irregular time intervals, historical event encoders can employ recurrent neural networks or their variants, such as long short-term memory networks or gated recurrent units, as their core architecture. During encoding, the input at each time step includes the volume characteristics of the current event and the time interval characteristics with the previous event. The historical event encoder, through its internal gating mechanism, memorizes and updates long-term dependency information in the sequence, and outputs a hidden state vector at the last time step or through an attention mechanism. This hidden state vector encapsulates information about the user's past drinking habits, such as average drinking intervals, volume fluctuation ranges, and specific drinking rhythm patterns, providing a dynamic historical basis for predicting the next behavior.

[0103] The event time prediction layer is used to output the time distribution of the next drinking event based on the output of the context coding layer and the historical event encoder.

[0104] The event timing prediction layer is responsible for predicting the time of the next drinking behavior. The input to this layer is the fusion result of the contextual feature vector generated by the context encoding layer and the historical feature vector generated by the historical event encoder. The fusion method can be vector concatenation or weighted summation. Unlike traditional regression models that output a specific time point, the event timing prediction layer outputs the temporal distribution of the next drinking event, typically represented by a probability distribution. In practical engineering implementations, this layer can consist of a fully connected layer, outputting the parameters of a parameterized distribution, or directly outputting a discrete-time probability distribution normalized by Softmax. By outputting a distribution rather than a single-point prediction, the model can naturally cover the random fluctuations of drinking behavior within a normal range, such as predicting that the next event is highly likely to occur within the next 30 to 90 minutes and providing the probability of various time points within that range.

[0105] The event volume prediction layer is used to output the volume distribution of the next drinking event based on the output of the context coding layer and the historical event encoder.

[0106] The event-based liquid volume prediction layer works in parallel with the time-based prediction layer, responsible for predicting the liquid volume of the next drinking session. Its input also comes from the output features of the context encoding layer and the historical event encoder. This means that the liquid volume prediction is influenced not only by historical drinking habits (such as the user's usual preferred single-session volume) but also by the current context (for example, a tendency to increase liquid volume in high-temperature environments). The liquid volume distribution output by this layer describes the probabilistic characteristics of the next event's liquid volume, such as the cumulative distribution function of the liquid volume or the probability of the liquid volume value falling within a specific range. Structurally, the event-based liquid volume prediction layer can contain one or more fully connected layers. Its output dimension depends on how the liquid volume distribution is represented; for example, it can output the mean and variance parameters of a continuous distribution, or it can discretize the liquid volume value into multiple buckets and output the probability of belonging to each bucket. This multi-task learning architecture design enables the drinking event pattern model to achieve accurate predictions of both time and liquid volume dimensions simultaneously within the same feature extraction framework, providing rich quantitative evidence for subsequent assessment of the anomaly degree of the drinking event sequence.

[0107] Optionally, the drinking water event pattern model and the equipment observation capability model can share the context coding layer.

[0108] In some possible implementations, when updating the parameters of the drinking water event pattern model, all historical confirmed drinking water events can be screened in multiple layers. Confirmed drinking water events within the time period that meet the requirements can be added to the training set to prevent abnormal data or low-quality observation data from contaminating the model parameters and to ensure that the drinking water patterns learned by the model can stably and realistically reflect the user's behavioral characteristics.

[0109] During the training phase, the drinking water event pattern model uses confirmed drinking water events within a time period that meet the following conditions for limited updates:

[0110] The observation probability within a given time period has reached the update threshold;

[0111] The degree of abnormality during the time period did not reach the isolation threshold;

[0112] The impact of confirmed drinking water events within a given time period on the model parameters of the drinking water event pattern model does not exceed the upper limit of the impact.

[0113] The observation probability update threshold is the minimum quality standard used to evaluate the reliability of device observation data within a certain time period. During the model training phase, for each time period to be processed, the observation probability output by the device observation capability model within that time period is obtained. Only when the observation probability of a time period reaches or exceeds the pre-set update threshold is the confirmed drinking event within that time period allowed to enter the subsequent model parameter update process; for time periods with observation probabilities below the update threshold, regardless of whether there are confirmed drinking events within that time period, it is judged as insufficient observation quality, and the data contained therein will be removed from this update.

[0114] The isolation threshold is a threshold used to determine whether a confirmed drinking event constitutes a clearly abnormal behavioral pattern. After screening for observation quality, the degree of anomalousness for that time period is further calculated. The degree of anomalousness reflects the deviation of the current drinking event sequence from an individual's historical drinking patterns, such as the degree to which the actual drinking time interval deviates from the predicted time range or the degree to which the actual drinking volume deviates from the predicted liquid volume range. If the degree of anomalousness for a certain time period reaches or exceeds the isolation threshold, it means that the drinking behavior during that time period may have been caused by special circumstances (such as illness, after strenuous exercise, or a temporary change in daily routine) or by false anomalies due to equipment recording errors. To avoid such extreme or occasional events having an excessive pulling effect on the overall model parameters, leading to a decrease in the model's generalization ability, such time periods are isolated from the model update process.

[0115] The upper bound on influence is a strict constraint on the magnitude of parameter adjustments during model training for a single or small number of confirmed drinking water events. Even if a certain time period passes both the observation quality and anomaly screening, it is still necessary to assess the impact of confirmed drinking water events on the model parameters of the drinking water event pattern model within that time period. This assessment process typically occurs during the backpropagation phase of calculating the loss function. Specifically, when calculating the gradient corresponding to this batch of data, the norm of the gradient vector or the magnitude of the parameter update is monitored. If the parameter update magnitude is too large, it indicates that the current data is causing too drastic changes to the model parameters. This may mean that although the data has passed the initial screening, it still has some specificity, and forced updates will cause the model parameters to oscillate violently. Therefore, an upper bound on influence is set as a braking mechanism for parameter updates. When the calculated parameter influence exceeds the upper bound on influence, the parameter update step size is truncated or reduced. For example, the gradient norm is limited to within the maximum threshold through gradient pruning techniques, or the weight of this update is reduced proportionally. By introducing an upper bound on influence, it is ensured that the changes in model parameters are smooth and gradual, preventing individual data points from dominating the model's learning direction, thereby enhancing the model's robustness and resistance to interference.

[0116] The limiting update mechanism in this embodiment constructs a safe and reliable model learning environment through triple constraints of update threshold, isolation threshold, and influence limit.

[0117] Further optionally, when training or updating the drinking water event pattern model, the influence of the event on the model parameters can be limited based on the observed probability of the confirmed drinking water event; the lower the observed probability, the higher the correction weight, the correction weight has an upper limit, and events with observed probabilities lower than the minimum confidence value are not used for parameter updates.

[0118] During model training or parameter update phases, a dynamic weighting mechanism based on observation probability is introduced to mitigate data bias caused by differences in recording probabilities across different scenarios. For each confirmed drinking event involved in the update, its observation probability is used. The weight of the event in the loss function calculation is dynamically adjusted. Events in scenarios where they are difficult to record (such as intermittent device offline or sensor interference) are assigned a higher correction weight due to their low observation probability. This is to compensate for the scarcity of its occurrence in the sample set, so that the pattern learned by the model tends to be closer to the actual frequency of occurrence rather than simply the recorded frequency.

[0119] The above weighting mechanism can determine the first weighting by the following decision function. Correction weights for confirmed drinking water incidents :

[0120]

[0121] In the formula, The preset minimum confidence threshold is used to filter samples with too low observation probability and insufficient confidence to support model learning. The preset upper limit of the correction weights is used to prevent the weight values ​​from being too large due to the low probability of observation, which could lead to gradient explosion or overfitting during model training. For a preset minimum constant (e.g.) This is used to avoid a denominator of zero. In practical applications, the minimum confidence value... It can be set to 0.2 to adjust the upper limit of the weight. It can be set to 3 or 5, with the specific value determined based on the distribution characteristics of the experimental data. This nonlinear inverse probability weighting strategy fully utilizes the information from low-probability samples while strictly limiting their influence, effectively balancing data bias correction and model training stability.

[0122] In some embodiments of this application, the process of step S130 in the aforementioned embodiments, which involves inputting the drinking water event sequence into the drinking water event pattern model and determining the degree of abnormality of the drinking water event sequence based on the time distribution and / or liquid volume distribution of the next drinking water event output by the drinking water event pattern model, is described.

[0123] In one alternative implementation, step S130 may include:

[0124] S11. Input the current drinking water event sequence into the drinking water event pattern model, and determine the target time range and / or target liquid volume range of the next drinking water event based on the time distribution and / or liquid volume distribution of the next drinking water event output by the drinking water event pattern model.

[0125] The model predicts and sets a reasonable fluctuation range for the next event. This range is not a fixed single value, but a dynamic range determined by the probability distribution output by the model based on historical patterns, in order to accommodate normal random fluctuations.

[0126] The confirmed sequence of drinking events up to the current moment, along with contextual information for the current time period (optional input), is input into the drinking event pattern model. Based on patterns learned from historical data, the model outputs the time interval distribution and liquid volume distribution for the next drinking event. Preset quantiles (e.g., 5% and 95% quantiles) are extracted from the above distribution to determine the target time range [L_time, U_time] and target liquid volume range [L_vol, U_vol] for the next event.

[0127] For example, if the model predicts a high probability that the next event will occur within 30 to 90 minutes after the current moment, and the liquid volume is concentrated between 80 mL and 160 mL, then the target time range is determined to be 30 to 90 minutes, and the target liquid volume range is 80 mL to 160 mL. This interval definition based on probability distribution transforms abstract distribution predictions into concrete comparison benchmarks, thereby making subsequent anomaly detection both operable and interpretable.

[0128] S12. When the first confirmed drinking water event after the current drinking water event sequence is obtained, the actual occurrence time of the first confirmed drinking water event is compared with the target time range, and / or the actual liquid volume of the first confirmed drinking water event is compared with the target liquid volume range.

[0129] Specifically, the actual observed data is compared with the predicted baseline range to quantify the deviation. The first confirmed drinking water event is the first drinking water event that meets the confirmation criteria after the prediction model makes a prediction. Its actual occurrence time and actual liquid volume are key evidence to verify the accuracy of the model's prediction.

[0130] When the first confirmed drinking water event is detected, the recorded timestamp and measured volume of the event are extracted, and they are compared one by one with the target range determined in step S1. For the comparison in the time dimension, the boundary difference between the actual time interval and the target time range is calculated; for the comparison in the volume dimension, the boundary difference between the actual volume and the target volume range is calculated.

[0131] This comparison process can be quantified using a normalized distance formula. Define the normalized distance for scales outside the defined range. ,in, This is the actual value (time or volume). and These are the lower and upper limits of the range, respectively. To prevent small values ​​from being divided by zero, the distance is set to 0 when the actual value falls within the range; when it exceeds the range, the distance is the ratio of the excess to the interval width. This method transforms deviations of different dimensions into a dimensionless scoring index, intuitively reflecting the degree to which the actual event deviates from the predicted range.

[0132] S13. Determine the degree of abnormality of the drinking water event sequence based on the comparison results.

[0133] Based on the quantified deviation value, a comprehensive judgment is made as to whether the current drinking behavior conforms to the individual's routine. The degree of abnormality is a quantitative description of the deviation, used to help determine whether a health warning needs to be issued.

[0134] After obtaining the deviation distance in the time dimension Deviation from the liquid volume dimension Next, calculate the comprehensive anomaly index. This index can be calculated based on time deviation. Or the liquid volume deviates Alternatively, the maximum value of the two can be taken, i.e. .Will The data is compared with a preset anomaly threshold. If the value exceeds the threshold, it is considered an anomaly; otherwise, it is considered normal. This anomaly level reflects the deviation of the current drinking water event sequence from the individual's historical patterns.

[0135] For example, if the preset anomaly detection threshold is 0.5, the calculated... A score of 0.8 indicates that the actual event deviated significantly from the predicted normal range, and the system judges the anomaly to be of a high degree. This prediction-verification closed-loop judgment mechanism allows for dynamic adjustment of the anomaly score based on actual comparison results, thus providing objective and quantitative data support for subsequent health status analysis.

[0136] In another alternative implementation, step S130 may include:

[0137] S21. Input the current drinking water event sequence into the drinking water event pattern model, and determine the target time range and / or target liquid volume range of the next drinking water event based on the time distribution and / or liquid volume distribution of the next drinking water event output by the drinking water event pattern model.

[0138] Step S21 is the same as step S11 described above; for details, please refer to the previous description.

[0139] S22. If, from the reference time when the target time range and / or target liquid volume range are generated, the waiting time exceeds the target time range under the condition that the observation probability continuously reaches the set observation threshold, and the next drinking event is still not obtained, then the survival probability at the waiting time is calculated according to the time distribution of the next drinking event. The survival probability represents the probability that the next drinking event has not yet occurred after waiting for the specified waiting time.

[0140] This embodiment addresses a specific scenario where the next drinking event is delayed under continuous and effective observation conditions. First, it continuously monitors the waiting time calculated from the baseline time (i.e., the time of the last drinking event or model prediction update) within the target time range. Simultaneously, it confirms that the device observation probability consistently reaches a set observation threshold during this waiting period. This indicates that the device is present, powered normally, the sensors are functioning correctly, and the user's ownership is clearly defined, representing a high-reliability state and ruling out the possibility of missed recordings due to device malfunction or lack of possession. Under these conditions, if the accumulated waiting time exceeds the upper limit of the target time range determined in the preceding steps, and the system still has not acquired the next drinking event, an anomaly detection logic based on survival probability is initiated.

[0141] In this logic, the waiting time is no longer considered a simple absolute time difference, but rather a time parameter for calculating conditional probability. The calculation of the survival probability can be formalized as the following function:

[0142]

[0143] In the formula, This indicates the current waiting time since the reference time; This represents the historical sequence of drinking water events up to the reference time. Indicates current contextual information; The cumulative distribution function represents the time interval of the next drinking water event output by the drinking water event pattern model. Indicates that you are waiting Given a certain duration, the probability of survival before the next drinking event occurs is calculated. This formula transforms the abstract concept of excessive waiting time into a quantitative indicator where the probability of occurrence remains non-zero in a statistical sense, thus achieving anomaly measurement based on the principles of survival analysis.

[0144] S23. Determine the degree of anomaly in the drinking water event sequence based on the survival probability.

[0145] After obtaining the survival probability at a given waiting time, it is quantified as the degree of anomalousness in the drinking event sequence. The survival probability directly reflects the rarity or abnormality of the current waiting state within an individual's historical drinking patterns. A high survival probability indicates that, under the current historical pattern, waiting for such a long time without a drinking event is a high-probability event, falling within the normal fluctuation range; conversely, an extremely low survival probability (e.g., below a preset survival threshold) indicates that the waiting time is statistically highly unusual, belonging to a low-probability event. The survival probability value or its normalized score can be directly used as a measure of the degree of anomalousness, or a threshold can be set to map the survival probability to discrete anomalous levels such as normal, deviation, or severe anomalousness. This probability distribution-based judgment method avoids the limitations of relying solely on fixed time thresholds, thus more accurately identifying abnormal waiting situations that conform to an individual's biorhythm characteristics.

[0146] By combining the time distribution prediction of the drinking water event pattern model with the observation probability verification of the equipment observation capability model, the system ensures that anomaly calculation based on survival probability is triggered only when the equipment can be reliably observed and the waiting time exceeds the range predicted by the individual's historical patterns. This mechanism uses survival probability to transform the absolute value of the waiting time into a statistically significant anomaly indicator, avoiding false alarms caused by a single time threshold and eliminating data gaps due to unobservable equipment, thus achieving an accurate and objective assessment of the phenomenon of prolonged water deprivation.

[0147] In some embodiments of this application, a missing event sensitivity analysis mechanism is also provided to verify the robustness of abnormal conclusions. This mechanism constructs multiple sets of potentially missed drinking events within an unknown time period and examines the fluctuation of the degree of abnormality under different assumptions. The drinking event sequence anomaly detection method of this application may further include the following steps:

[0148] S1. Generate at least two sets of potentially missed drinking events within an unknown time period.

[0149] Potentially missed drinking events refer to candidate drinking behaviors that are theoretically possible but not recorded by the device, inferred from the historical behavior patterns of a specified user within an unknown time period where the observation probability is below a set observation threshold, making it impossible for the system to determine whether drinking occurred. The generation process aims to construct a test set covering different hypothetical scenarios to quantify the dependence of anomalous conclusions on missing data.

[0150] In one optional generation method, the historical event interval range and liquid volume range of a specified user under the same or similar circumstances (same time period, location, and activity status, etc.) are first collected. For example, historical drinking event data of a specified user under the same or similar circumstances are collected, and the time interval distribution characteristics of adjacent events and the liquid volume distribution characteristics of a single drinking event are statistically obtained from the historical data. Based on the above historical event interval range and liquid volume range, within the start and end time range of an unknown time period, candidate events (missed drinking events) are randomly generated or enumerated according to specified rules in different numbers (such as 0 times, 1 time, 2 times, etc.), different occurrence times, and different liquid volumes. Then, the generated candidate events are physically and logically verified to eliminate invalid candidates that conflict with known equipment status (such as equipment power failure, equipment absence), overlap with confirmed drinking events in time, or violate the physical capacity limit of the container, thereby forming at least two logically consistent sets of possible missed drinking events.

[0151] S2. Merge each group of potentially missed drinking water events with the drinking water event sequence according to the occurrence time to obtain the candidate drinking water event sequence corresponding to each group of potentially missed drinking water events.

[0152] A candidate drinking water event sequence refers to a complete event sequence formed by inserting a specific set of potentially missed drinking water events into the original confirmed drinking water event sequence and then rearranging them chronologically. This sequence is used to simulate a user's actual drinking water trajectory under a specific omission assumption. The merging process uses a timeline alignment method, with the event occurrence time as the unique sorting key, seamlessly inserting potentially missed drinking water events into the corresponding time gaps of the original drinking water event sequence to form a continuous time series for anomaly assessment. Each set of potentially missed drinking water events generates an independent candidate drinking water event sequence. The sequences differ only in their composition within the unknown time period, while the confirmed events outside the unknown time period remain completely consistent.

[0153] S3. For each candidate drinking water event sequence, the corresponding degree of abnormality is determined using the drinking water event pattern model.

[0154] Anomaly score characterizes the degree to which a candidate drinking event sequence deviates from a specified user's personal drinking pattern. Its calculation relies on the drinking event pattern model's ability to predict the timing and volume of the next event. For each candidate drinking event sequence, the drinking event pattern model is run independently. Based on the sequence's historical events and current context information, the model outputs the time distribution and volume distribution of the next event. Subsequently, this distribution is used to calculate the probability or deviation distance of the subsequent event's occurrence time and volume falling within the predicted range. Finally, the deviations of each event in the entire sequence are summarized to calculate the comprehensive anomaly score corresponding to the candidate drinking event sequence. This process requires maintaining complete consistency in model parameters, evaluation criteria, and analysis scope across all candidate sequences to ensure the comparability of anomaly scores obtained from different candidate sequences.

[0155] S4. Based on the differences in the degree of abnormality corresponding to different candidate drinking water event sequences, determine whether the conclusion of the degree of abnormality of the drinking water event sequence is sensitive to the missed drinking water events. If it is sensitive, do not output a drinking water record deviation prompt, or output insufficient data or continue observation.

[0156] Sensitivity is used to measure the stability of anomaly determinations under different omission assumptions within an unknown time period. This determination process is achieved by quantifying and comparing the degree of anomaly among different candidate sequences.

[0157] An optional implementation method for determining the sensitivity of the abnormality level conclusion to missed drinking water events is as follows:

[0158] S41. Compare the abnormality scores and / or abnormality conclusion categories corresponding to each candidate drinking water event sequence.

[0159] By comparing the anomaly scores and anomaly conclusion categories generated under different omission assumptions, the robustness of anomaly detection results is quantitatively assessed. The anomaly score quantifies the degree of deviation of the current drinking event sequence from personal historical patterns and situational expectations; a higher score indicates a more significant deviation. It is typically calculated based on the time deviation between the actual occurrence time and the target time range, and the volume deviation between the actual liquid volume and the target volume range. The anomaly conclusion category is a qualitative classification of the sequence state based on the anomaly score and a preset judgment threshold, typically including at least three states: normal, deviation, and insufficient data. "Normal" indicates that the drinking behavior is within a reasonable fluctuation range; "deviation" indicates a significant anomaly; and "insufficient data" indicates that a reliable judgment cannot be made due to missing information (such as a long unknown period).

[0160] Under fixed model parameters, personal references, and judgment rules, the calculation results corresponding to each group of candidate drinking water event sequences generated in unknown time periods are extracted. For each candidate sequence, there is a specific anomaly score and an anomaly conclusion category obtained by mapping the score. The comparison process not only focuses on the numerical differences in the scores, but also on the attribute differences in the conclusion categories, that is, judging from a qualitative perspective whether different hypotheses lead to an essential reversal of judgment.

[0161] S42. If the anomaly degree conclusion category corresponding to each candidate drinking water event sequence covers at least two of the categories of normal, deviation and insufficient data, or if the difference between the anomaly degree scores corresponding to each candidate drinking water event sequence exceeds the sensitivity threshold, then the anomaly degree conclusion of the drinking water event sequence is determined to be sensitive to the missed drinking water events.

[0162] This step establishes a dual-judgment logic regarding sensitivity, defining the stability of the anomaly level conclusion through both qualitative and quantitative dimensions. When any of the following conditions are met, the current anomaly level conclusion is determined to be sensitive to the missed drinking water event, and in this case, a definitive anomaly alert cannot be output.

[0163] The first layer of judgment logic is based on the distribution characteristics of the conclusion categories. If at least two of the three categories of normal, deviation, and insufficient data appear simultaneously in the anomaly degree conclusion categories of each group of candidate drinking water event sequences, it means that the existence or absence of missed events directly changes the nature of the judgment result. For example, when the candidate set contains both sequences that lead to a judgment of normal and sequences that lead to a judgment of deviation, it indicates that the data deficiency in the unknown time period has caused the detection system to lose the deterministic basis for distinguishing between true anomalies and normal fluctuations. This qualitative discrepancy reveals the instability of the conclusion more clearly than simple numerical fluctuations.

[0164] The second layer of judgment logic is based on the dispersion of anomaly scores. Even if all candidate sequences nominally belong to the same category of anomaly conclusion (e.g., all judged as normal or deviation), the differences between these scores still need to be quantitatively calculated. Specific calculation methods could include: calculating the difference between the maximum and minimum scores of all candidate sequences, i.e., the score range; or calculating the variance or standard deviation of the scores. This calculated difference value is then compared to a preset sensitivity threshold. The sensitivity threshold is a threshold set according to the business's requirements for the stability of the conclusion, used to define the acceptable range of score fluctuations. If the difference between scores exceeds the sensitivity threshold, it indicates that although the qualitative label remains unchanged, the quantitative assessment results fluctuate drastically under different assumptions, the reliability of the conclusion is low, and it is still judged as sensitive to the missed drinking water event.

[0165] Through the aforementioned dual-judgment mechanism, unreliable anomaly detection results that may be due to missed events in unknown time periods can be accurately identified. When a sensitive condition is determined, the system will not output a drinking record deviation warning that could lead to a false alarm. Instead, it will output an instruction for insufficient data or continued observation. This effectively avoids false anomaly judgments caused by insufficient equipment observation capabilities or missing data, ensuring the rigor and reliability of the anomaly detection system.

[0166] Through the aforementioned multi-hypothesis extrapolation mechanism, this application can effectively identify the potential impact of data uncertainty caused by the lack of equipment observation capabilities on anomaly detection conclusions, thereby significantly improving the robustness and reliability of the drinking water incident anomaly detection system.

[0167] In some embodiments of this application, an output control logic for a drinking water event sequence anomaly detection method is also provided, the method further comprising:

[0168] A drinking water record deviation warning will be output only if the observation quality of the drinking water event sequence meets the output requirements, the abnormality conclusion is not sensitive to the missed drinking water events, and the abnormality meets the continuity condition; otherwise, the output data is insufficient or observation continues.

[0169] A strict multi-layered gating mechanism is implemented to determine whether to output a deviation alert for drinking water records. This mechanism considers the fundamental quality of the observed data, the robustness of the abnormal conclusions to missing data, and the persistence of the abnormal state as necessary prerequisites. Meeting the output requirements for observation quality is the primary entry threshold, used to assess the completeness and reliability of the drinking water event sequence from the data source. The insensitivity of the abnormality conclusions to missed drinking water events is a robustness check in the middle layer, ensuring that the abnormal conclusions remain stable even under different omission assumptions. Meeting the persistence condition for the abnormality level is a time-dimensional filter, used to eliminate misjudgments caused by occasional or transient interference. Only when all three conditions are met simultaneously is the current drinking water record deviation considered statistically significant and engineeringly reliable, at which point a deviation alert is output. Conversely, if any condition is not met, it means that the existing data foundation is insufficient to support a reliable conclusion, or that the conclusion is severely affected by missing data, at which point insufficient data is output or observation continues to be required to avoid misleading users.

[0170] The observation quality meets the output requirements to quantitatively assess the extent to which the currently analyzed drinking water event sequence falls within the effective monitoring range of the equipment. This judgment is based on at least one of the following indicators:

[0171] First, the percentage of time periods in the drinking water event sequence where the observation probability reaches the observation threshold reaches a set proportion. This indicator is used to statistically analyze the effective time period within the current analysis window where the observation probability output by the device's observation capability model is higher than the preset observation threshold, and calculates its proportion of the total analysis time. When this proportion is high, it indicates that the device is in good working condition and has a clear attribution status for most of the time during that period, and can reliably capture the user's drinking behavior; if this proportion is low, it means that a large amount of time is spent in a low observation probability state where the device is offline, has insufficient power, or has an unclear attribution, and the representativeness of the data is questionable. The specific value of the set proportion can be configured according to the business's requirements for data confidence, for example, it can be set to 0.8, 0.9, etc., that is, requiring the effective observation time to be no less than 80% or 90% of the total time.

[0172] Second, the longest consecutive unknown duration in the drinking water event sequence does not exceed the set duration. This indicator is used to constrain the concentration of missing data and avoid the failure of anomaly detection logic due to excessively long consecutive unknown intervals. When the longest consecutive unknown duration exceeds the set duration, it indicates the existence of a blind spot sufficient to mask the complete drinking water cycle or key anomaly characteristics. In this case, regardless of the degree of anomaly output by the model, there is significant uncertainty. The set duration can be determined by combining the statistical distribution of normal drinking water intervals, for example, by setting the set duration to 1.5 or 2 times the upper limit of normal drinking water intervals, to ensure that even if there are unobserved periods, their length will not disrupt the grasp of the overall pattern. By combining the above two indicators, unreliable analysis results caused by incomplete data collection or unstable equipment operation can be completely eliminated, ensuring that the subsequent drinking water record deviation prompts are based on a solid data foundation.

[0173] The insensitivity of anomaly assessment conclusions to missed drinking water events means that after generating candidate missed events for unknown time periods and recalculating the anomaly assessment of multiple candidate sequences, the anomaly assessment conclusions for each candidate sequence remain consistent or differ within an acceptable range. This implies that regardless of whether missed drinking water events exist within the unknown time period, and regardless of the specific number, timing, or volume of missed events, as long as these assumptions do not conflict with confirmed facts (such as equipment status or confirmed events), the final anomaly determination (such as normal or deviation) or anomaly score does not undergo a fundamental reversal. This insensitivity demonstrates that the current anomaly conclusions are primarily driven by confirmed and reliably observed drinking water event sequences, rather than relying on specific assumptions about unknown intervals, thus ensuring the robustness of the conclusions.

[0174] The abnormality level meeting the persistence condition means that the abnormal state of the detected drinking water event sequence is not an instantaneous fluctuation, but has lasted for a period of time, thus eliminating false alarms caused by occasional factors (such as one-time water collection difficulties, temporary equipment vibration, or short-term environmental interference).

[0175] The above three conditions together form a rigorous output logic loop: observation quality ensures the reliability of input data, sensitivity ensures the robustness of conclusions to missing data, and persistence ensures the objective significance of anomalies. Only when all three dimensions are met is the current deviation in the drinking record deemed credible and noteworthy, thus outputting a drinking record deviation alert; otherwise, it indicates insufficient data, controversial conclusions, or insufficient persistence of the phenomenon, in which case the output "Insufficient Data" or "Continue Observation" is provided, guiding the user or system to wait for higher quality data or a longer observation window.

[0176] This application also provides an electronic device in its embodiments. (See reference...) Figure 3The diagram illustrates a structural schematic suitable for implementing the electronic device in the embodiments of this application. The electronic device in the embodiments of this application may include, but is not limited to, fixed terminals such as smart water bottles, terminal devices associated with the user of the water bottle (e.g., smartwatches, smart bracelets, mobile phones), and other third-party electronic devices. Figure 3 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0177] like Figure 3 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 1, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 2 or a program loaded from a storage device 8 into a random access memory (RAM) 3, to implement the drinking event sequence anomaly detection method of the aforementioned embodiments of this application. When the electronic device is powered on, the RAM 3 also stores various programs and data required for the operation of the electronic device. The processing unit 1, ROM 2, and RAM 3 are interconnected via a bus 4. An input / output (I / O) interface 5 is also connected to the bus 4.

[0178] Typically, the following devices can be connected to I / O interface 5: input devices 6 including, for example, touchscreens, touchpads, accelerometers, gyroscopes, etc.; output devices 7 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 8 including, for example, memory cards, hard drives, etc.; and communication devices 9. Communication device 9 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or included alternatively.

[0179] This application also provides a computer program product, including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the drinking event sequence anomaly detection methods provided in this application.

[0180] This application also provides a computer-readable storage medium that carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the drinking event sequence anomaly detection methods provided in this application.

[0181] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0182] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0183] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0184] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

[0185] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.

Claims

1. A method for detecting anomalies in a drinking water event sequence, characterized in that, include: Acquire drinking event data and device observation status data of the drinking water device. The drinking event data includes confirmed drinking events belonging to a specified user. The device observation status data represents the device working status and user association status of the drinking water device at different time periods. Using the configured device observation capability model, the observation probability for each time period is output based on the device observation status data. The observation probability represents the probability that if the target drinking event of the specified user occurs through the drinking device in the corresponding time period, the target drinking event can be correctly recorded by the drinking device and attributed to the specified user. The time period in which the observation probability reaches the set observation threshold and there is no confirmed drinking event is divided into an effective event-free time period, and the time period in which the observation probability is lower than the set observation threshold is divided into an unknown time period. The drinking water event sequence is input into the drinking water event pattern model. Based on the time distribution and / or liquid volume distribution of the next drinking water event output by the drinking water event pattern model, the degree of abnormality of the drinking water event sequence is determined. The drinking water event sequence includes the confirmed drinking water events, the effective event-free time periods, and the unknown time periods. The unknown time periods are marked as unknown in the drinking water event sequence.

2. The method according to claim 1, characterized in that, The device observation status data includes at least two of the following: device presence status, power supply status, sensor self-test status, individual ownership status, and shared use status.

3. The method according to claim 1, characterized in that, The process of obtaining the confirmed drinking water event includes: Candidate events are obtained based on multi-channel sensor data reflecting water cup usage events; The candidate events are input into the event classification module to obtain the scores of the candidate events belonging to each candidate event category, and the candidate event categories include at least the drinking category; Based on the score of the candidate event belonging to the drinking category and at least one evidence check result, it is determined whether the candidate event is a drinking event; the evidence check result includes at least one of the following: whether the signal quality of the sensor channel on which the candidate event is based is qualified, whether the number of valid evidences reaches the set number, whether the different pieces of evidence are quantifiable compatible, and the difference between the drinking category score and the scores of other categories; When a candidate event is determined to be a drinking event and the candidate event can be attributed to the designated user, the candidate event is designated as the confirmed drinking event.

4. The method according to claim 3, characterized in that, The process of determining whether the candidate event can be attributed to the specified user includes: Determine the personal usage session to which the occurrence time of the candidate event falls, wherein the personal usage session includes user ID, authentication method, session start and end time, and trusted status; If the authentication method of the personal use session is valid authentication, the occurrence time of the candidate event is within the start and end time of the personal use session, the ownership of the trusted state identifier is clear, and there is no user switching, sharing, handover or other ownership conflict during the candidate event, then the candidate event is determined to belong to the user corresponding to the user identifier.

5. The method according to claim 1, characterized in that, The input to the device observation capability model also includes contextual information, which includes at least one of time period, day type, location category, ambient temperature, and activity status from an independent source. The activity status from an independent source is information measured and provided by an independent terminal other than the drinking water device, representing the activity status of the specified user in the corresponding time period. The device observation status data includes the device status history.

6. The method according to claim 5, characterized in that, The device observation capability model was trained in the following manner: Obtain training samples and corresponding observation labels. The training samples include device observation status data and contextual information. The observation labels indicate whether the target drinking event was correctly recorded by the drinking device and correctly attributed to the specified user in an independent test. The training samples are input into the device observation capability model to obtain the observation probability output by the model. The loss is calculated based on the observation probability output by the model and the observation label, and the device observation capability model is updated according to the loss.

7. The method according to claim 1, characterized in that, The input to the drinking water event pattern model also includes contextual information, which includes at least one of time period, day type, location category, ambient temperature, and activity status from an independent source. The activity status from an independent source is information measured and provided by an independent terminal other than the drinking water device, representing the activity status of the specified user in the corresponding time period.

8. The method according to claim 7, characterized in that, The drinking water event pattern model includes a context encoding layer, a historical event encoder, an event time prediction layer, and an event liquid volume prediction layer. The context coding layer is used to encode the context information; The historical event encoder is used to encode the drinking water event sequence; The event time prediction layer is used to output the time distribution of the next drinking event based on the output of the context coding layer and the historical event encoder; The event liquid volume prediction layer is used to output the liquid volume distribution of the next drinking event based on the output of the context coding layer and the historical event encoder.

9. The method according to claim 1, characterized in that, The process of inputting a drinking water event sequence into a drinking water event pattern model, and determining the degree of anomaly of the drinking water event sequence based on the time distribution and / or volume distribution of the next drinking water event output by the drinking water event pattern model, includes: Input the current drinking water event sequence into the drinking water event pattern model, and determine the target time range and / or target liquid volume range of the next drinking water event based on the time distribution and / or liquid volume distribution of the next drinking water event output by the drinking water event pattern model. When the first confirmed drinking event after the current drinking event sequence is obtained, the actual occurrence time of the first confirmed drinking event is compared with the target time range, and / or the actual liquid volume of the first confirmed drinking event is compared with the target liquid volume range; The degree of anomalousness of the drinking water event sequence is determined based on the comparison results.

10. The method according to claim 9, characterized in that, The process of determining the degree of anomalousness of the drinking water event sequence based on the comparison results includes: The time deviation of the actual occurrence time of the first confirmed drinking water event relative to the target time range is calculated by normalized distance, and / or the volume deviation of the actual liquid volume of the first confirmed drinking water event relative to the target volume range. The time deviation or the liquid volume deviation is determined as the degree of abnormality, or the maximum value of the time deviation and the liquid volume deviation is taken as the degree of abnormality.

11. The method according to claim 1, characterized in that, The process of inputting a drinking water event sequence into a drinking water event pattern model, and determining the degree of anomaly of the drinking water event sequence based on the time distribution and / or volume distribution of the next drinking water event output by the drinking water event pattern model, includes: Input the current drinking water event sequence into the drinking water event pattern model, and determine the target time range and / or target liquid volume range of the next drinking water event based on the time distribution and / or liquid volume distribution of the next drinking water event output by the drinking water event pattern model. If, from the reference time when the target time range and / or target liquid volume range are generated, the waiting time exceeds the target time range under the condition that the observation probability continuously reaches the set observation threshold, and the next drinking event is still not obtained, then the survival probability at the waiting time is calculated according to the time distribution of the next drinking event. The survival probability represents the probability that the next drinking event has not yet occurred after waiting for the waiting time. The degree of anomalousness of the drinking water event sequence is determined based on the survival probability.

12. The method according to claim 1, characterized in that, Also includes: Generate at least two sets of potentially missed drinking events during the unknown time period; Each group of potentially missed drinking water events is merged with the drinking water event sequence according to the occurrence time to obtain the candidate drinking water event sequence corresponding to each group of potentially missed drinking water events; For each candidate drinking water event sequence, the corresponding degree of abnormality is determined using the drinking water event pattern model. Based on the differences in the degree of abnormality corresponding to different candidate drinking water event sequences, it is determined whether the conclusion of the degree of abnormality of the drinking water event sequence is sensitive to missed drinking water events. If it is sensitive, no drinking water record deviation prompt is output, or the message "data insufficient" or "continue observation" is output.

13. The method according to claim 12, characterized in that, The process of generating at least two sets of potentially missed drinking events during the unknown time period includes: Based on the specified user's historical event interval range and liquid volume range under the same circumstances, generate different numbers, different times and different liquid volumes of possible missed drinking events within the unknown time period, and exclude possible missed drinking events that conflict with known device status or confirmed drinking events.

14. The method according to claim 12, characterized in that, The process of determining whether the anomaly degree conclusion of the drinking water event sequence is sensitive to missed drinking water events, based on the differences in anomaly degree corresponding to different candidate drinking water event sequences, includes: Compare the abnormality scores and / or abnormality conclusion categories corresponding to each candidate drinking water event sequence; If the anomaly conclusion category corresponding to each candidate drinking water event sequence covers at least two of the categories of normal, deviation, and insufficient data, or if the difference between the anomaly scores corresponding to each candidate drinking water event sequence exceeds the sensitivity threshold, then the anomaly conclusion of the drinking water event sequence is determined to be sensitive to missed drinking water events.

15. The method according to claim 12, characterized in that, Also includes: A drinking water record deviation warning will be output only if the observation quality of the drinking water event sequence meets the output requirements, the anomaly degree conclusion is not sensitive to missed drinking water events, and the anomaly degree meets the persistence condition; otherwise, the output will indicate insufficient data or continue observation. Wherein, the observation quality meeting the output requirements includes at least one of the following: The proportion of time periods in the drinking water event sequence where the observation probability reaches the observation threshold reaches a set proportion. The longest consecutive unknown duration in the drinking water event sequence did not exceed the set duration.

16. An electronic device, characterized in that, include: Memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the drinking water event sequence anomaly detection method as described in any one of claims 1 to 15.