Pet behavior monitoring method and device, equipment and storage medium
Through dual-mode switching technology, the pet wearable device collects inertial data in low-power mode and switches to high-precision mode as needed, solving the problems of short battery life and high false alarm rate of existing devices, and achieving a balance between low power consumption and high precision.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-05
- Publication Date
- 2026-03-31
AI Technical Summary
Existing wearable pet devices suffer from high power consumption leading to short battery life, and their reliance on single inertial data for behavior recognition results in a high false alarm rate. Furthermore, the lack of dynamic sampling strategies makes it impossible to balance low power consumption and high accuracy.
The system employs a dual-mode switching technology. In the first mode, the inertial measurement unit (IMU) is driven to collect data. Based on the inertial data, it is determined whether to activate audio-assisted recognition. In the second mode, the IMU and audio codec are driven to collect data simultaneously. After a preset time, the system automatically switches back to the first mode.
It enables on-demand adjustment of device operating status, reduces power consumption in non-critical monitoring scenarios, improves the accuracy of behavior recognition, solves the problem of short battery life caused by high power consumption, and achieves a dynamic balance between low power consumption and high precision.
Smart Images

Figure CN121753729A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent sensing and control technology, and in particular to a method, device, equipment and storage medium for monitoring pet behavior. Background Technology
[0002] With the increasing demands of pet ownership, wearable pet devices have gradually become important tools for monitoring pet health and behavior, and are widely used in the field of pet care. Most current mainstream wearable pet devices rely on inertial measurement units (IMUs) to collect data, thereby enabling the identification and monitoring of pet behavior. However, existing devices have many technical shortcomings that urgently need to be addressed in practical applications.
[0003] On the one hand, these devices generally employ a single, fixed sampling strategy, continuously driving the sensors at a high frequency, resulting in high power consumption and severely limiting battery life. This necessitates frequent charging by users, impacting the user experience. On the other hand, behavior recognition relies solely on inertial data dimensions such as acceleration, leading to a limited recognition dimension and difficulty in accurately distinguishing similar pet behaviors, resulting in a high false alarm rate. Furthermore, existing devices lack the ability to dynamically adjust sampling methods based on actual monitoring scenarios, failing to balance recognition accuracy with low power consumption. These issues collectively result in insufficient practicality and reliability of current pet wearable devices, failing to meet users' dual needs for accurate pet behavior monitoring and long-lasting battery life, thus limiting the further promotion and application of pet wearable devices in related fields. Summary of the Invention
[0004] The purpose of this application is to provide a method, device, equipment and storage medium for monitoring pet behavior, in order to solve the technical problem of high power consumption and short battery life of existing pet wearable devices.
[0005] To achieve the above objectives, this application proposes a pet behavior monitoring method, wherein the method is configured with a first mode and a second mode; the method includes: In the first mode, the inertial measurement unit is driven only for data acquisition during the first sampling period; Determine whether audio-assisted recognition needs to be activated based on the collected inertial data; If it is determined that it is necessary, switch to the second mode and drive the inertial measurement unit and audio codec to collect data simultaneously with the second sampling period; Once the preset duration of the second mode is reached, it will automatically switch back to the first mode.
[0006] In one embodiment, the first sampling period is greater than the second sampling period.
[0007] In one embodiment, the step of determining whether to activate audio-assisted recognition based on the collected inertial data includes: The collected inertial data is input into a lightweight behavior recognition model for inference; Determine whether audio-assisted recognition needs to be activated based on the inferred data.
[0008] In one embodiment, the step of switching to the second mode and simultaneously driving the inertial measurement unit and the audio codec to acquire data during the second sampling period if it is determined that it is necessary further includes: In the second mode, inertial data from the inertial measurement unit and audio data from the audio codec are acquired simultaneously; The inertial data is subjected to feature extraction to generate a first feature vector; The audio data is subjected to feature extraction to generate a second feature vector; The first feature vector and the second feature vector are concatenated to form a fused feature vector; The fused feature vector is input into the main behavior recognition model to output the behavior classification result.
[0009] In one embodiment, the main behavior recognition model adopts a dual encoder structure, including a first encoder for processing temporal features and a second encoder for processing spectral features.
[0010] In one embodiment, prior to the step of driving the inertial measurement unit to acquire data only during the first sampling period in the first mode, the method includes: A fixed-size memory pool is pre-allocated in the external storage medium; At least one behavior recognition model is loaded into the memory pool.
[0011] In one embodiment, after the step of loading at least one behavior recognition model into the memory pool, the method includes: During the reasoning process of the behavior recognition model, all memory requests exceeding a preset threshold are allocated from the memory pool.
[0012] Furthermore, to achieve the above objectives, this application also proposes a pet behavior monitoring device, the device comprising: The first acquisition module is used to drive the inertial measurement unit to acquire data only in the first mode with a first sampling period; The data determination module is used to determine whether audio-assisted recognition needs to be activated based on the collected inertial data. The second acquisition module is used to switch to the second mode if it is determined that it is necessary, and drive the inertial measurement unit and the audio codec to acquire data simultaneously with the second sampling period. The mode switching module is used to automatically switch back to the first mode after the preset duration of the second mode has been reached.
[0013] In addition, to achieve the above objectives, this application also proposes a pet behavior monitoring device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the pet behavior monitoring method as described above.
[0014] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the pet behavior monitoring method described above.
[0015] This application proposes a pet behavior monitoring method, device, equipment, and storage medium. By employing a dual-mode switching technology that configures a first mode and a second mode, it solves the problem of high power consumption caused by the lack of dynamic sampling strategies and the inability to continuously collect data in existing pet wearable devices. Compared with existing technologies, it achieves the basic effect of adjusting the device's working state as needed. By adopting the technique of driving only the inertial measurement unit for data acquisition in the first sampling cycle in the first mode, it solves the problem of power waste caused by the sensor operating at high frequency throughout the entire process in existing devices. Compared with existing technologies, it achieves low-power operation in non-critical monitoring scenarios. By employing a triggering technology that determines whether to activate audio-assisted recognition based on inertial data, it solves the problem of existing devices blindly collecting data or relying solely on data from a single inertial dimension. Compared with existing technologies, it achieves data acquisition... The strategy achieves intelligent adaptation; by employing the technique of simultaneously driving the inertial measurement unit and audio codec for data acquisition in the second mode with the second sampling period, it solves the problem of misjudgment caused by the single dimension of behavior recognition in existing devices, achieving a high-precision behavior recognition effect compared with existing technologies; by employing the technique of automatically switching back to the first mode after the second mode reaches the preset duration, it solves the problem of excessive power consumption when the device is running continuously in the high-precision acquisition state, achieving a dynamic balance between accurate recognition and low power consumption compared with existing technologies. Combining the above technical means, it finally solves the core technical problem of high power consumption and short battery life of existing pet wearable devices, achieving the dual effect of improved device battery life and optimized behavior recognition accuracy compared with existing technologies. Attached Figure Description
[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating an embodiment of the pet behavior monitoring method of this application. Figure 2 This is a flowchart illustrating Embodiment 2 of the pet behavior monitoring method of this application; Figure 3 This is a flowchart illustrating Embodiment 3 of the pet behavior monitoring method of this application; Figure 4 This is a schematic diagram of the module structure of the pet behavior monitoring device according to an embodiment of this application; Figure 5 This is a schematic diagram of the structure of a pet behavior monitoring device in the hardware operating environment of the pet behavior monitoring method in this application embodiment.
[0019] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0020] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0021] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0022] The main solution of this application embodiment is: the method configures a first mode and a second mode; the method includes: in the first mode, driving only the inertial measurement unit to collect data with a first sampling period; determining whether audio-assisted recognition needs to be started based on the collected inertial data; if it is determined that it is needed, switching to the second mode, and driving the inertial measurement unit and the audio codec to collect data simultaneously with a second sampling period; when the preset duration of the second mode is reached, automatically switching back to the first mode.
[0023] Because these devices generally employ a single, fixed sampling strategy, continuously driving the sensors at a high frequency, power consumption remains high, severely limiting battery life and requiring frequent charging, thus impacting the user experience. Furthermore, behavior recognition relies solely on inertial data dimensions such as acceleration, resulting in a limited recognition dimension and difficulty in accurately distinguishing similar pet behaviors, leading to a high false alarm rate. Simultaneously, existing devices lack the ability to dynamically adjust sampling methods based on actual monitoring scenarios, failing to balance recognition accuracy with low power consumption requirements.
[0024] This application provides a solution that, in a first mode, drives only the inertial measurement unit (IMU) for data acquisition during a first sampling period; determines whether audio-assisted recognition needs to be activated based on the acquired inertial data; if so, switches to a second mode and simultaneously drives the IMU and audio codec for data acquisition during a second sampling period; and automatically switches back to the first mode after a preset duration of the second mode has been reached. By employing the technique of automatically switching back to the first mode after the second mode has reached a preset duration, the problem of excessive power consumption during continuous operation in high-precision acquisition mode is solved, thus achieving a dynamic balance between accurate recognition and low power consumption.
[0025] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or a pet behavior monitoring device capable of performing the above functions. The following description uses a pet behavior monitoring device as an example to illustrate this embodiment and the subsequent embodiments.
[0026] Based on this, the embodiments of this application provide a method for monitoring pet behavior, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the pet behavior monitoring method of this application.
[0027] In this embodiment, the pet behavior monitoring method includes steps S10 to S40: Step S10: In the first mode, drive the inertial measurement unit only to acquire data during the first sampling period.
[0028] It should be understood that step S10 is the device's basic low-power data acquisition stage. The device initially defaults to the first mode, in which only the inertial measurement unit is controlled to continuously acquire data according to the preset first sampling period, without activating any other sensing components. The core purpose of this step is to minimize device power consumption while ensuring the acquisition of basic pet movement data, and to avoid power waste caused by the operation of unnecessary components.
[0029] It should be noted that the first mode is the device's low-power basic operating mode, which only activates the inertial measurement unit (IMU) for data acquisition. This is the default mode for the device and it operates for extended periods. The first sampling period is a fixed time interval for the IMU to acquire data in the first mode. Its duration is set with low power consumption as the core objective and is usually longer than the second sampling period.
[0030] Step S20: Determine whether audio-assisted recognition needs to be activated based on the collected inertial data.
[0031] It should be noted that step S20 is the core step in determining the mode switch. Based on the inertial data collected in step S10, it is processed through preset algorithm logic (such as behavioral feature matching, data fluctuation analysis, etc.) to determine whether the pet's behavior can be accurately identified by relying solely on the inertial data. If it is determined that the inertial data alone is insufficient for accurate identification, a subsequent mode switch is triggered; if it is determined that the inertial data is sufficient for identification, the first mode is maintained, thereby achieving on-demand adjustment of the data collection strategy.
[0032] It should be understood that the inertial measurement unit (IMU) is a sensing component used to collect data on the motion state of an object. It can obtain motion-related information such as the pet's acceleration and angular velocity, and is a core component for initial monitoring of pet behavior. Audio-assisted recognition is a technical method that combines the collection of audio data from the pet and its surrounding environment (such as pet barks and activity sounds) with inertial data for analysis, supplementing the blind spots of single inertial data and improving the accuracy of behavior recognition.
[0033] Step S30: If it is determined that it is necessary, switch to the second mode and drive the inertial measurement unit and the audio codec to collect data simultaneously with the second sampling period.
[0034] It should be understood that step S30 is a high-precision joint acquisition stage. When step S20 determines that audio-assisted recognition is needed, the device immediately switches from the first mode to the second mode. In the second mode, the device synchronously drives the inertial measurement unit and audio codec according to the set second sampling period, continuously acquiring pet movement data while also acquiring additional audio data. Through multi-dimensional data fusion of movement and audio, the accuracy of pet behavior recognition is improved, solving the problem of insufficient recognition dimensions of single inertial data.
[0035] It should be noted that the second mode is the device's high-precision joint operating mode, which simultaneously activates the inertial measurement unit and the audio codec for data acquisition, and only operates briefly when high-precision recognition is required. The second sampling period is a fixed time interval during which the inertial measurement unit and the audio codec synchronously acquire data in the second mode. Its duration is set with high-precision recognition as the core objective, and is usually shorter than the first sampling period.
[0036] Step S40: When the preset duration of the second mode is reached, automatically switch back to the first mode.
[0037] It should be understood that step S40 is the power consumption control and mode return stage. To avoid excessive power consumption caused by the dual-component operation in the second mode, a fixed preset duration is set for the second mode. When the device reaches this preset value after running in the second mode, it automatically switches back to the first mode without any additional operation, re-entering the low-power basic acquisition state, realizing a cycle of "high-precision recognition - low-power maintenance", balancing recognition accuracy and device battery life.
[0038] It should be noted that the audio codec is a component used to acquire, encode (convert analog audio into digital data), and decode audio signals. It can convert pet-related sound signals into analyzable digital data, providing audio dimension support for behavior recognition. The preset duration is a fixed running time pre-set for the second mode, used to limit the running time of the high-power second mode and avoid excessive power consumption. Its duration is set according to actual recognition needs.
[0039] In this embodiment, by employing a dual-mode switching technique that configures a first mode and a second mode, the problem of high power consumption caused by the lack of dynamic sampling strategies and the inability to continuously collect data in existing pet wearable devices is solved. Compared with existing technologies, this achieves the basic effect of adjusting the device's working state as needed. Furthermore, by adopting the technique of driving only the inertial measurement unit for data acquisition in the first sampling cycle in the first mode, the problem of power waste caused by the sensor operating at high frequency throughout the entire process is solved. Compared with existing technologies, this achieves low-power operation in non-critical monitoring scenarios. Finally, by employing a triggering technique that determines whether to activate audio-assisted recognition based on inertial data, the problem of blindly collecting data or relying solely on data from a single inertial dimension in existing devices is solved. Compared with existing technologies, this achieves... The system achieves intelligent adaptation of the data acquisition strategy. By employing the second mode's technique of simultaneously driving the inertial measurement unit and audio codec for data acquisition during the second sampling period, it solves the problem of misjudgment caused by the single dimension of behavior recognition in existing devices, achieving high-precision behavior recognition compared to existing technologies. Furthermore, by automatically switching back to the first mode after the second mode reaches a preset duration, it solves the problem of excessive power consumption during continuous operation in high-precision acquisition mode, achieving a dynamic balance between accurate recognition and low power consumption compared to existing technologies. Combining these technologies, the system ultimately solves the core technical problem of high power consumption and short battery life in existing pet wearable devices, achieving a dual effect of improved battery life and optimized behavior recognition accuracy compared to existing technologies.
[0040] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in Embodiment 1 above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 , Figure 2 This is a flowchart illustrating Embodiment 2 of the pet behavior monitoring method of this application.
[0041] In step S20, the pet behavior monitoring method further includes: Step S201: Input the collected inertial data into the lightweight behavior recognition model for inference.
[0042] It should be noted that the lightweight behavior recognition model is an artificial intelligence model that simplifies the model structure and reduces computational complexity. It is specifically designed to quickly process inertial data and output behavior recognition results. Its core design is to reduce the device's computing resource consumption and energy consumption while ensuring basic recognition performance, and to adapt to the hardware capabilities of pet wearable devices.
[0043] It should be understood that step S201 is the intelligent analysis and processing step of inertial data. After acquiring the inertial data collected in step S10, this data is directly input into a pre-deployed lightweight behavior recognition model. This model then performs inference calculations on the inertial data according to its built-in algorithm logic. The core purpose of this step is to process the data quickly through a lightweight model, ensuring basic recognition capabilities while avoiding increased device power consumption due to complex calculations, thus providing accurate data analysis support for deciding whether to activate audio-assisted recognition.
[0044] Step S202: Determine whether audio-assisted recognition needs to be activated based on the inferred data.
[0045] It should be understood that reasoning refers to the process of using pre-trained model parameters to calculate, analyze, and output results (such as behavior category, recognition confidence, etc.) on input inertial data in a lightweight behavior recognition model. It is the core link of applying the model's capabilities to actual data processing, and it is different from the model training stage, focusing more on the rapid processing of real-time data.
[0046] It should be noted that step S202 is the final determination step for mode switching. Based on the data results output by the lightweight behavior recognition model inference in step S201 (such as behavior recognition confidence, feature matching degree, etc.), according to the preset determination rules (such as determining that auxiliary recognition is needed if the confidence is lower than the threshold), it is determined whether accurate recognition of pet behavior can be achieved by relying solely on inertial data. If the inference data shows that the recognition accuracy does not meet expectations, it is determined that audio-assisted recognition needs to be activated, triggering the mode switching in step S30; if the inference data shows that the recognition accuracy meets the requirements, it is determined that activation is not necessary, and the first mode continues to operate to ensure the scientific and reasonable nature of the data collection strategy.
[0047] In step S30, the pet behavior monitoring method further includes: Step S301: In the second mode, inertial data from the inertial measurement unit and audio data from the audio codec are acquired simultaneously.
[0048] It should be noted that step S301 is the multi-dimensional data synchronous acquisition step in the second mode. After the device switches to the second mode, it simultaneously controls the inertial measurement unit to collect inertial data related to the pet's movement and the audio codec to collect audio data of the pet and its surrounding environment according to the set second sampling period. This ensures that the two types of data are synchronized in the time dimension, laying the foundation for subsequent multi-dimensional data fusion analysis and avoiding recognition deviations caused by data asynchrony.
[0049] Step S302: Extract features from the inertial data to generate a first feature vector.
[0050] It should be understood that feature extraction refers to the process of filtering and refining the core information (i.e., features strongly correlated with pet behavior) from raw inertial or audio data using specific algorithms. The aim is to remove redundant information from the raw data, retain key features, and provide efficient input for subsequent model analysis. The first feature vector refers to the result of presenting the extracted inertial feature information in vector form (a data structure composed of multiple feature values in a specific order) after feature extraction from the inertial data; it is a digital expression of the behavioral characteristics of the inertial dimension.
[0051] It should be noted that step S302 is the feature extraction step of inertial data. Based on the inertial data collected in step S301, the preset feature extraction algorithm (such as time domain feature extraction, frequency domain feature extraction, etc.) is used to screen and extract information that can reflect the key characteristics of pet behavior (such as movement amplitude, frequency, change trend, etc.) from the original inertial data. These feature information are then integrated to generate the first feature vector, realizing the transformation from raw data to effective features and reducing the complexity of subsequent model calculations.
[0052] Step S303: Extract features from the audio data to generate a second feature vector.
[0053] It should be understood that the second feature vector refers to the result of presenting the extracted audio feature information in vector form after feature extraction from the audio data; it is a digital expression of the audio dimension's behavioral characteristics. Step S303 is the feature extraction step for audio data, which is logically consistent with step S302. For the audio data collected in step S301, a feature extraction algorithm adapted to the audio signal (such as Mel frequency cepstral coefficient extraction, audio energy extraction, etc.) is used to extract key information that can characterize sound features (such as sound frequency, intensity, duration, etc.) from the original audio data, and integrate them to generate the second feature vector, providing effective feature support for audio dimension behavior recognition.
[0054] Step S304: Concatenate the first feature vector and the second feature vector to form a fused feature vector.
[0055] It should be noted that the fused feature vector refers to the new vector formed by concatenating and integrating the first feature vector and the second feature vector according to preset rules. It contains key features in both motion and audio dimensions, realizing the integration of multi-dimensional features and reflecting the pet's behavioral state more comprehensively.
[0056] It should be understood that step S304 is a multi-dimensional feature fusion and integration step. The first feature vector generated in step S302 and the second feature vector generated in step S303 are integrated according to preset splicing rules (such as dimension superposition, weighted combination, etc.) to form a fused feature vector containing motion features and audio features. This breaks the limitations of single-dimensional data recognition, realizes the complementarity of multi-dimensional information, and provides more comprehensive feature input for high-precision behavior recognition.
[0057] Step S305: Input the fused feature vector into the main behavior recognition model to output the behavior classification result.
[0058] It should be noted that the main behavior recognition model is used to process the fused feature vectors and output the behavior classification results. Compared with the lightweight model in step S20, it has a more complex structure and stronger recognition ability. It can comprehensively analyze multi-dimensional features to achieve high-precision classification and recognition of pet behavior. It is the core component for accurate recognition in the second mode.
[0059] It should be noted that step S305 is the precise identification step of the fused features. The fused feature vector formed in step S304 is input into the pre-trained main behavior recognition model. The model performs comprehensive analysis and reasoning calculations on the fused features and finally outputs a clear pet behavior classification result (such as "eating", "running", "resting" etc.), completing the complete process from multi-dimensional data collection to precise behavior recognition, and solving the problem of insufficient accuracy of single inertial data recognition.
[0060] It should be understood that the main behavior recognition model adopts a dual encoder structure, including a first encoder for processing temporal features and a second encoder for processing spectral features.
[0061] In this embodiment, steps S201-S202 function to rapidly infer inertial data using a lightweight behavior recognition model, accurately determining whether to activate audio-assisted recognition, avoiding blindly activating multi-component acquisition, and achieving intelligent triggering of the acquisition strategy. Steps S301-S305 are crucial for simultaneously acquiring inertial and audio data in the second mode. After feature extraction and vector concatenation to generate a fused feature vector, the main behavior recognition model outputs accurate classification results, achieving multi-dimensional high-precision behavior recognition while ensuring mode switching as needed. The use of a lightweight model for inference and judgment solves the power consumption waste caused by indiscriminate acquisition in traditional devices, achieving preliminary accurate screening under low power consumption compared to existing technologies. The use of dual-data synchronous acquisition, feature fusion, and main model recognition solves the problem of insufficient recognition dimensions for single inertial data, significantly reducing the false alarm rate compared to existing technologies. Since the entire process only activates high-power accurate recognition when necessary and reverts to low-power mode within a limited time, it solves the problem of balancing power consumption and recognition accuracy, achieving a dual improvement in device battery life and recognition performance compared to existing technologies.
[0062] Based on the first and / or second embodiments of this application, in the third embodiment of this application, the content that is the same as or similar to that in embodiments one and two above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 3 , Figure 3 This is a flowchart illustrating Embodiment 3 of the pet behavior monitoring method of this application. Before step S10, the pet behavior monitoring method further includes: Step S101: Pre-allocate a fixed-size memory pool in the external storage medium.
[0063] It should be understood that a memory pool is a fixed-size memory area pre-allocated in external storage media, specifically for a particular purpose (in this case, loading and running a behavior recognition model). It features dedicated resources and pre-planning, enabling efficient management and stable allocation of memory resources.
[0064] It should be noted that step S101 is the memory pre-configuration step before the device runs. Before the device starts and enters the pet behavior monitoring process, the external storage medium is operated to pre-allocate a fixed-size memory pool according to the preset memory requirements for the subsequent loading and running of the behavior recognition model. The core purpose of this step is to plan memory resources in advance, avoid resource conflicts caused by chaotic memory allocation during subsequent model loading or inference, and provide dedicated memory space support for the stable operation of the model.
[0065] Step S102: Load at least one behavior recognition model into the memory pool.
[0066] It should be noted that the behavior recognition model is an algorithmic model used to analyze and reason about collected pet-related data (such as inertial data and audio data) to identify pet behavior categories. It is the core algorithmic component for realizing pet behavior monitoring, and includes lightweight behavior recognition models and main behavior recognition models.
[0067] It should be understood that step S102 is the model pre-loading stage. After the memory pool pre-allocation in step S101 is completed, at least one model for behavior recognition (such as the lightweight behavior recognition model in step S201 and the main behavior recognition model in step S305) is loaded into the pre-allocated memory pool. This step ensures that the model can be quickly invoked after the monitoring process starts, without having to temporarily read model data from external storage media, reducing model startup latency and improving the overall response speed of the monitoring process.
[0068] Following step S102, the pet behavior monitoring method further includes: Step S103: During the reasoning process of the behavior recognition model, all memory requests exceeding the preset threshold are allocated from the memory pool.
[0069] It should be understood that memory allocation refers to the operation of requesting the allocation of required memory space from the system or a specified memory region during the execution of a program (in this case, a behavior recognition model inference program). This memory space is used to temporarily store data, intermediate results, and other information generated during the inference process. The preset threshold is a pre-set critical value used to judge the size of memory allocation requests. When the size of the memory allocation request exceeds this value, a specific memory allocation rule (in this case, allocation from the memory pool) is triggered. This is the core judgment criterion for implementing memory allocation control.
[0070] It should be noted that step S103 is a memory usage control step. During the subsequent inference calculations of the behavior recognition model, if a memory request is generated and the requested memory size exceeds a preset threshold, these memory requests will be uniformly allocated from the memory pool pre-allocated in step S101. This step can prevent large memory requests from temporarily occupying other system memory resources, prevent memory fragmentation from affecting the model's inference efficiency, and ensure a stable supply of memory resources during model inference, reducing inference interruptions caused by memory allocation issues.
[0071] In this embodiment, step S101 pre-allocates a fixed memory pool on the external storage medium, pre-planning the dedicated memory space for model operation; step S102 loads the behavior recognition model into the memory pool, preparing for subsequent fast invocation; step S103 manages memory requests, allocating requests exceeding a preset threshold from the memory pool to avoid occupying other system memory. Pre-allocating the memory pool solves the problem of chaotic memory allocation during model loading, achieving orderly planning of memory resources; pre-loading the model solves the problem of latency in temporarily reading the model, improving monitoring response speed; and managing the source of large memory requests solves the problems of memory fragmentation and resource conflicts, ensuring stable model inference. In summary, these steps lay an efficient and stable memory foundation for the subsequent behavior monitoring process, avoiding the impact of memory issues on overall performance, and significantly improving the reliability and efficiency of device operation compared to schemes without memory pre-planning.
[0072] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the pet behavior monitoring method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.
[0073] This application also provides a pet behavior monitoring device, please refer to... Figure 4 The pet behavior monitoring device includes: The first acquisition module 10 is used to drive the inertial measurement unit to acquire data only in the first mode with a first sampling period. The data determination module 20 is used to determine whether audio-assisted recognition needs to be activated based on the collected inertial data. The second acquisition module 30 is used to switch to the second mode if it is determined that it is necessary, and drive the inertial measurement unit and the audio codec to acquire data simultaneously with the second sampling period. The mode switching module 40 is used to automatically switch back to the first mode after the preset duration of the second mode has been reached.
[0074] Optionally, the first acquisition module 10 is further configured to set the first sampling period to be greater than the second sampling period.
[0075] Optionally, the data determination module 20 is further configured to input the collected inertial data into a lightweight behavior recognition model for inference; and determine whether audio-assisted recognition needs to be activated based on the inferred data.
[0076] Optionally, the second acquisition module 30 is further configured to, in the second mode, simultaneously acquire inertial data in the inertial measurement unit and audio data in the audio codec; extract features from the inertial data to generate a first feature vector; extract features from the audio data to generate a second feature vector; concatenate the first feature vector and the second feature vector to form a fused feature vector; and input the fused feature vector into the main behavior recognition model to output behavior classification results.
[0077] Optionally, the first acquisition module 10 is also used to pre-allocate a fixed-size memory pool in an external storage medium; and load at least one behavior recognition model into the memory pool.
[0078] Optionally, the first acquisition module 10 is also used to allocate all memory requests exceeding a preset threshold from the memory pool during the reasoning process of the behavior recognition model.
[0079] The pet behavior monitoring device provided in this application, employing the pet behavior monitoring method described in the above embodiments, can solve the technical problem of high power consumption and short battery life in existing pet wearable devices. Compared with the prior art, the beneficial effects of the pet behavior monitoring device provided in this application are the same as those of the pet behavior monitoring method provided in the above embodiments, and other technical features in the pet behavior monitoring device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0080] This application provides a pet behavior monitoring device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the pet behavior monitoring method in Embodiment 1 above.
[0081] The following is for reference. Figure 5 The diagram illustrates a structural schematic suitable for implementing the pet behavior monitoring device in the embodiments of this application. The pet behavior monitoring device in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The pet behavior monitoring device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of this application.
[0082] like Figure 5 As shown, the pet behavior monitoring device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory 1002 or a program loaded from a storage device 1003 into a random access memory 1004. The random access memory 1004 also stores various programs and data required for the operation of the pet behavior monitoring device. The processing unit 1001, the read-only memory 1002, and the random access memory 1004 are interconnected via a bus 1005. An input / output interface 1006 is also connected to the bus. Typically, the following systems can be connected to the input / output interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows the pet behavior monitoring device to communicate wirelessly or wiredly with other devices to exchange data. While the figures show pet behavior monitoring devices with various systems, it should be understood that implementing or having all of the systems shown is not required. More or fewer systems may be implemented alternatively.
[0083] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0084] The pet behavior monitoring device provided in this application, employing the pet behavior monitoring method described in the above embodiments, can solve the technical problem of high power consumption and short battery life in existing pet wearable devices. Compared with the prior art, the beneficial effects of the pet behavior monitoring device provided in this application are the same as those of the pet behavior monitoring method provided in the above embodiments, and other technical features of this pet behavior monitoring device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0085] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0086] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0087] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to perform the pet behavior monitoring method in the above embodiments.
[0088] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0089] The aforementioned computer-readable storage medium may be included in the pet behavior monitoring device; or it may exist independently and not incorporated into the pet behavior monitoring device.
[0090] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0091] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0092] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0093] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described pet behavior monitoring method, thereby solving the technical problem of high power consumption and short battery life in existing pet wearable devices. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the pet behavior monitoring method provided in the above embodiments, and will not be repeated here.
[0094] The above are only some embodiments of this application and do not limit the scope of implementation of this application. Any equivalent structural or procedural transformations made based on the content of this application specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the protection scope of this application.
Claims
1. A method for monitoring pet behavior, characterized in that, The method configures a first mode and a second mode; the method includes: In the first mode, only the inertial measurement unit is driven to acquire data during the first sampling period; Determine whether audio-assisted recognition needs to be activated based on the collected inertial data; If it is determined that it is necessary, switch to the second mode and drive the inertial measurement unit and audio codec to collect data simultaneously with the second sampling period; Once the preset duration of the second mode is reached, it will automatically switch back to the first mode.
2. The pet behavior monitoring method as described in claim 1, characterized in that, Prior to the step of driving the inertial measurement unit to acquire data only in the first mode with a first sampling period, the following steps are included: The first sampling period is set to be greater than the second sampling period.
3. The pet behavior monitoring method as described in claim 1, characterized in that, The step of determining whether to activate audio-assisted recognition based on the collected inertial data includes: The collected inertial data is input into a lightweight behavior recognition model for inference; Determine whether audio-assisted recognition needs to be activated based on the inferred data.
4. The pet behavior monitoring method as described in claim 1, characterized in that, The step of switching to the second mode and simultaneously driving the inertial measurement unit and audio codec to acquire data during the second sampling period if it is determined that it is necessary further includes: In the second mode, inertial data from the inertial measurement unit and audio data from the audio codec are acquired simultaneously; The inertial data is subjected to feature extraction to generate a first feature vector; The audio data is subjected to feature extraction to generate a second feature vector; The first feature vector and the second feature vector are concatenated to form a fused feature vector; The fused feature vector is input into the main behavior recognition model to output the behavior classification result.
5. The pet behavior monitoring method as described in claim 4, characterized in that, The main behavior recognition model adopts a dual encoder structure, including a first encoder for processing temporal features and a second encoder for processing spectral features.
6. The pet behavior monitoring method as described in claim 1, characterized in that, Prior to the step of driving the inertial measurement unit to acquire data only in the first mode with a first sampling period, the following steps are included: A fixed-size memory pool is pre-allocated in the external storage medium; At least one behavior recognition model is loaded into the memory pool.
7. The pet behavior monitoring method as described in claim 6, characterized in that, After the step of loading at least one behavior recognition model into the memory pool, the method includes: During the reasoning process of the behavior recognition model, all memory requests exceeding a preset threshold are allocated from the memory pool.
8. A pet behavior monitoring device, characterized in that, The device includes: The first acquisition module is used to drive the inertial measurement unit to acquire data only in the first mode with a first sampling period; The data determination module is used to determine whether audio-assisted recognition needs to be activated based on the collected inertial data. The second acquisition module is used to switch to the second mode if it is determined that it is necessary, and drive the inertial measurement unit and the audio codec to acquire data simultaneously with the second sampling period. The mode switching module is used to automatically switch back to the first mode after the preset duration of the second mode has been reached.
9. A pet behavior monitoring device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the pet behavior monitoring method as described in any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the pet behavior monitoring method as described in any one of claims 1 to 7.