Pet space-time behavior deviation and regional intelligent deduction method and related equipment based on pet space-time behavior

By using a smart pet collar to monitor pet activity and location in real time, and comparing it with historical spatiotemporal behavioral characteristics, deviations are identified and the risk of getting lost is assessed. This solves the problem of inaccurate risk assessment in existing technologies and achieves more accurate prediction of pets getting lost.

CN123031883APending Publication Date: 2026-11-03TOPFLYTECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611508958.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-28
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

Current methods for monitoring lost pets mainly rely on the pet's current location or a single instance of abnormal behavior. They lack analysis of the continuous deviation between the pet's current spatiotemporal behavior and its historical behavior, making it difficult to accurately distinguish between changes in the pet's normal activities and actual lost behavior, resulting in low accuracy in assessing the risk of getting lost.

Method used

The system uses a smart pet collar to acquire the pet's real-time activity status and location, compares it with preset historical spatiotemporal behavioral characteristics, determines the current spatiotemporal behavioral deviation, and determines the degree of deviation by continuously acquiring multiple deviation results. It combines real-time location and historical behavioral characteristics to judge the risk of getting lost, and uses pet activity heatmaps and historical trajectories to predict and extend the trajectory.

Benefits of technology

It improves the accuracy of pet loss risk assessment by combining pet's historical activity patterns and real-time location changes, avoiding single abnormal judgments and achieving more accurate trajectory prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123031883A_ABST
    Figure CN123031883A_ABST
Patent Text Reader

Abstract

The application is suitable for the technical field of data processing, and provides a pet space-time behavior deviation and area intelligent deduction method and related equipment, which comprises the following steps: acquiring a real-time activity state and a real-time position of a pet at a current time through an intelligent pet collar, determining a reference space-time behavior feature matched with the current time, comparing the real-time activity state and the real-time position with the reference space-time behavior feature, determining a deviation duration, and determining a pet lost risk; when a prediction condition is met, determining a candidate activity area matched with a current pet behavior, continuously expanding the candidate activity area by using a historical trajectory formed by a historical space-time behavior feature and a pet activity heat map, and obtaining a corresponding prediction trajectory. The prediction trajectory is continuously expanded, so that the prediction trajectory is simultaneously subjected to the position distribution degree of a pet historical activity area and the historical position change relationship, thereby improving the accuracy of pet lost risk judgment and prediction trajectory determination.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a method and related equipment for intelligent extrapolation of deviations and regions based on pet spatiotemporal behavior. Background Technology

[0002] With the increasing number of pet owners and the development of smart wearable devices, smart pet collars are gradually being used for monitoring pets' daily activities and tracking their locations. Smart pet collars can collect information on a pet's movement, activity status, and location. By analyzing the collected data, they can obtain the pet's historical activity trajectory, activity area, and location distribution, which can then be used for monitoring pet behavior and predicting the location of a lost pet.

[0003] Existing methods for detecting lost pets typically rely on the pet's current location, activity status, or a preset activity range. When the pet's location is detected to be outside the preset range or its activity status is abnormal, a lost pet alert is output. Furthermore, the system can analyze the pet's possible locations by combining historical location data.

[0004] However, existing methods for monitoring lost pets mainly rely on the current location or a single abnormal behavior to make a judgment. Because they lack correlation analysis between the pet's current spatiotemporal behavior and its historical behavior, it is difficult to accurately distinguish between changes in the pet's normal activities and actual lost behavior, resulting in low accuracy in judging the risk of pets getting lost. Summary of the Invention

[0005] This invention provides a method and related equipment for intelligent extrapolation of deviation and region based on pet spatiotemporal behavior, in order to solve the problem of low accuracy in judging the risk of pets getting lost.

[0006] In a first aspect, embodiments of this application provide a method for intelligent extrapolation of deviations and regions based on pet spatiotemporal behavior, comprising: acquiring the real-time activity status and real-time location of the pet at the current moment through an intelligent pet collar; determining reference spatiotemporal behavior features matching the current moment from preset historical spatiotemporal behavior features; comparing the real-time activity status and the real-time location with the reference spatiotemporal behavior features to determine the current spatiotemporal behavior deviation result; continuously acquiring multiple current spatiotemporal behavior deviation results to determine the degree of deviation of the current spatiotemporal behavior relative to the historical spatiotemporal behavior features; and determining the pet's risk of getting lost based on the degree of deviation and the current spatiotemporal behavior deviation result; when the risk of getting lost meets preset trajectory prediction conditions, according to the current... The real-time location, real-time activity status, and historical spatiotemporal behavioral characteristics of the previous moment are used to determine candidate activity areas that match the current pet behavior. The historical spatiotemporal behavioral characteristics are organized into trajectory points according to the collection time, and their location distribution is statistically analyzed according to spatial regions to obtain a set of historical trajectory points and location distribution data. The positional change relationship between each trajectory point is determined based on the collection time corresponding to each trajectory point in the historical trajectory point set, and the trajectory points are connected according to the positional change relationship to obtain the historical trajectory. The degree of location distribution corresponding to different activity areas is determined based on the location distribution data to obtain a pet activity heatmap. The candidate activity areas are continuously expanded using the pet activity heatmap and the historical trajectory to obtain the corresponding predicted trajectory.

[0007] Secondly, embodiments of this application provide a deviation and regional intelligent extrapolation system based on pet spatiotemporal behavior, characterized by comprising: a data acquisition module, used to acquire the pet's real-time activity status and real-time location at the current moment through a smart pet collar, determine a reference spatiotemporal behavior feature matching the current moment from preset historical spatiotemporal behavior features, and compare the real-time activity status and the real-time location with the reference spatiotemporal behavior feature to determine the current spatiotemporal behavior deviation result; a risk analysis module, used to continuously acquire multiple current spatiotemporal behavior deviation results to determine the degree of deviation of the current spatiotemporal behavior relative to the historical spatiotemporal behavior features, and determine the pet's risk of getting lost based on the degree of deviation and the current spatiotemporal behavior deviation result; and a region determination module, used to determine the region when the risk of getting lost meets preset trajectory prediction conditions. Based on the current real-time location, real-time activity status, and historical spatiotemporal behavior characteristics, candidate activity areas matching the current pet behavior are determined. A distribution statistics module organizes the historical spatiotemporal behavior characteristics into trajectory points according to the collection time and performs location distribution statistics according to spatial regions, obtaining a set of historical trajectory points and location distribution data. A trajectory construction module determines the positional change relationship between trajectory points based on the collection time corresponding to each trajectory point in the historical trajectory point set, and connects the trajectory points according to the positional change relationship to obtain a historical trajectory. A region expansion module determines the degree of location distribution corresponding to different activity areas based on the location distribution data, obtains a pet activity heatmap, and continuously expands the candidate activity areas using the pet activity heatmap and the historical trajectories to obtain corresponding predicted trajectories.

[0008] Thirdly, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the above-described method for intelligent deduction of deviation and region based on pet spatiotemporal behavior.

[0009] Fourthly, embodiments of this application provide a readable storage medium storing a computer program that, when executed by a processor, implements the steps of the aforementioned method for intelligent deduction of deviations and regions based on pet spatiotemporal behavior.

[0010] Fifthly, embodiments of this application provide a computer program product, which includes a computer program that, when executed by a processor, enables the implementation of the steps of the above-described method for intelligent deduction of deviation and region based on pet spatiotemporal behavior.

[0011] In one solution provided by the aforementioned methods, systems, devices, media, and program products, the current spatiotemporal behavior deviation is determined by comparing the real-time activity status and real-time location with preset historical spatiotemporal behavior characteristics. Furthermore, the degree of deviation is determined by combining multiple continuously acquired current spatiotemporal behavior deviation results. This allows for the determination of the pet's risk of getting lost based on the continuous deviation of the pet's current spatiotemporal behavior from historical spatiotemporal behavior characteristics, avoiding reliance solely on a single location anomaly or activity status change for loss assessment. When the risk of getting lost meets preset trajectory prediction conditions, candidate activity areas are further determined by combining real-time location, real-time activity status, and historical spatiotemporal behavior characteristics. These candidate activity areas are then continuously expanded using historical trajectories formed from historical spatiotemporal behavior characteristics and pet activity heatmaps. This ensures that the predicted trajectory is simultaneously constrained by the distribution of the pet's historical activity areas and the relationship between historical location changes, thereby improving the accuracy of pet loss risk assessment and trajectory prediction. Attached Figure Description

[0012] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 This is a schematic diagram of the application architecture in one embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of a smart pet collar according to an embodiment of the present invention; Figure 3 This is a flowchart illustrating a method for intelligent extrapolation of deviations and regions based on pet spatiotemporal behavior in one embodiment of the present invention. Figure 4 This is a schematic diagram of a sub-process of step S10 in one embodiment of the present invention; Figure 5 This is a schematic diagram of a sub-process of step S30 in one embodiment of the present invention; Figure 6 This is a schematic diagram of the relationship between historical trajectory construction and position change in one embodiment of the present invention; Figure 7 This is a schematic diagram of the structure of a continuously extended predicted trajectory in one embodiment of the present invention; Figure 8 This is an active heat map in one embodiment of the present invention; Figure 9 This is a flowchart illustrating a deviation and regional intelligent inference system based on pet spatiotemporal behavior in one embodiment of the present invention. Figure 10This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention.

[0014] Explanation of reference numerals in the attached figures: 1. Smart pet collar. Detailed Implementation

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

[0016] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof. It should also be understood that, as used in this specification and the appended claims, the term "and / or" refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0017] Furthermore, in the description of this invention and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0018] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of the invention include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0019] It should be understood that the sequence number of each step in the following embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0020] To illustrate the technical solution of the present invention, specific embodiments are described below.

[0021] This invention provides a method for intelligent extrapolation of deviations and regions based on the spatiotemporal behavior of pets, which can be applied to, for example... Figure 1 The application architecture shown includes a server and terminal devices. The terminal devices communicate with the server via a network or bus. Each terminal device is equipped with a smart pet collar 1, which collects the pet's real-time activity status and location, and sends these data to the server. The server stores historical spatiotemporal behavioral characteristics and performs processing based on the real-time activity status, location, and historical behavioral characteristics, including determining current spatiotemporal behavior deviation, identifying the risk of getting lost, determining candidate activity areas, constructing historical trajectories, constructing pet activity heatmaps, and determining predicted trajectories.

[0022] like Figure 2 As shown, in practical applications, pets wear smart pet collar 1 for daily activities. The smart pet collar 1 continuously acquires the pet's activity and location data at preset collection intervals, determining the real-time activity status based on the activity data and the real-time location based on the location data. The server correlates the activity status, location, and corresponding collection time collected by the smart pet collar 1 within a historical time range to form historical spatiotemporal behavioral characteristics. When the smart pet collar 1 acquires the pet's current real-time activity status and location, the server determines a matching reference spatiotemporal behavioral characteristic from the historical spatiotemporal behavioral characteristics based on the time information corresponding to the current moment. The server then compares the real-time activity status and location with the reference spatiotemporal behavioral characteristics to determine the current spatiotemporal behavioral deviation result. The server continuously acquires multiple current spatiotemporal behavioral deviation results at preset time intervals, determines the degree of deviation based on the continuity between multiple current spatiotemporal behavioral deviation results, and determines the risk of the pet getting lost based on the degree of deviation and the current spatiotemporal behavioral deviation result. When the risk of getting lost meets the preset trajectory prediction conditions, the server filters candidate activity areas based on the current real-time location, real-time activity status, and historical spatiotemporal behavior characteristics. It also organizes trajectory points and performs location distribution statistics on historical spatiotemporal behavior characteristics to form a set of historical trajectory points and location distribution data. The server further determines historical trajectories based on the collection time and historical location in the set of historical trajectory points, determines a pet activity heatmap based on the location distribution data, and continuously expands the candidate activity areas based on the degree of location distribution of different activity areas in the pet activity heatmap and the relationship of location changes in the historical trajectories, thereby determining the predicted trajectory.

[0023] In this context, "terminal device" refers to a device capable of communicating with a server and acquiring or processing pet-related data. Terminal devices include, but are not limited to, personal computers, laptops, smartphones, tablets, and portable wearable devices. In this embodiment, the smart pet collar 1 is a portable wearable device. The smart pet collar 1 is equipped with an activity data collector and a location data collector. The activity data collector is used to collect movement data during the pet's activities, and the location data collector is used to obtain the pet's location.

[0024] The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The server includes a data storage area for storing historical spatiotemporal behavioral characteristics, corresponding historical activity status data, historical location data, and collection time. The server can also receive real-time activity status and location data from the smart pet collar 1 via the network and perform correlation processing on the received data.

[0025] In one embodiment, such as Figure 3 As shown, a deviation and region intelligent extrapolation method based on pet spatiotemporal behavior is provided, which is then applied to... Figure 1 Taking the application architecture in [the document] as an example, the following steps are included: S10: Obtain the pet's real-time activity status and real-time location at the current moment through the smart pet collar 1, determine the reference spatiotemporal behavior features that match the current moment from the preset historical spatiotemporal behavior features, and compare the real-time activity status and real-time location with the reference spatiotemporal behavior features to determine the deviation result of the current spatiotemporal behavior.

[0026] S20: Continuously acquire multiple current spatiotemporal behavior deviation results to determine the degree of deviation of the current spatiotemporal behavior relative to the historical spatiotemporal behavior characteristics, and determine the risk of the pet getting lost based on the degree of deviation and the current spatiotemporal behavior deviation results.

[0027] S30: When the risk of getting lost meets the preset trajectory prediction conditions, determine the candidate activity area that matches the current pet's behavior based on the real-time location, real-time activity status, and historical spatiotemporal behavior characteristics at the current moment.

[0028] S40: Organize the historical spatiotemporal behavioral characteristics into trajectory points according to the collection time, and perform location distribution statistics according to spatial regions to obtain the historical trajectory point set and location distribution data.

[0029] S50: Determine the positional change relationship between each trajectory point based on the collection time corresponding to each trajectory point in the historical trajectory point set, and connect each trajectory point according to the positional change relationship to obtain the historical trajectory.

[0030] S60: Determine the degree of location distribution corresponding to different activity areas based on location distribution data, obtain a pet activity heat map, and continuously expand the candidate activity areas using the pet activity heat map and historical trajectories to obtain the corresponding predicted trajectories.

[0031] In this embodiment, by comparing and associating real-time activity status and real-time location with reference spatiotemporal behavior features corresponding to historical spatiotemporal behavior features, the deviation result of the current spatiotemporal behavior is determined. The degree of deviation duration is determined by the continuity between multiple current spatiotemporal behavior deviation results. This ensures that the risk of a pet getting lost is no longer determined solely by a single real-time location or a single real-time activity status, but rather by continuously judging the current spatiotemporal behavior in conjunction with the pet's own historical activity patterns. When the risk of getting lost meets the preset trajectory prediction conditions, candidate activity areas are further determined based on real-time activity status, real-time location, and historical spatiotemporal behavior features. The historical spatiotemporal behavior features are then organized into trajectory points and their location distribution is statistically analyzed to form a historical trajectory point set and location distribution data. Based on the historical trajectory point set, a historical trajectory with the direction and distance of location change is formed. A pet activity heatmap is generated based on the location distribution data. The candidate activity areas are continuously expanded using the degree of location distribution in the pet activity heatmap and the relationship of location change in the historical trajectory. This ensures that the determination of the predicted trajectory is simultaneously constrained by the distribution patterns of the pet's historical activity areas and its historical movement patterns, thereby improving the accuracy of judging the risk of pet getting lost and determining the predicted trajectory.

[0032] like Figure 4 As shown, in one embodiment, step S10 involves obtaining the pet's real-time activity status and location at the current moment through the smart pet collar 1, determining a reference spatiotemporal behavior feature that matches the current moment from preset historical spatiotemporal behavior features, and comparing the real-time activity status and location with the reference spatiotemporal behavior feature to determine the deviation result of the current spatiotemporal behavior. Specifically, this includes the following steps: S11: Obtain the pet's real-time activity status and location at the current moment through the smart pet collar 1, determine the current time period based on the time information corresponding to the current moment, and filter the historical activity status data and historical location data corresponding to the current time period from historical spatiotemporal behavior characteristics.

[0033] The smart pet collar 1 acquires the pet's real-time activity status and location. The real-time activity status represents the pet's activity at any given moment, while the real-time location represents the pet's spatial position. The smart pet collar 1 continuously collects the pet's motion and location data at preset time intervals, determining the real-time activity status based on the motion data and the real-time location based on the location data. The real-time activity status can be categorized into moving and stationary states based on the motion data collected by the smart pet collar 1, and the real-time location can be represented using latitude and longitude coordinates.

[0034] The server obtains the current time corresponding to the real-time activity status and real-time location, and determines the current time period based on the time information corresponding to the current time. The current time period is used to filter historical activity status data and historical location data that are under the same time conditions as the current time from historical spatiotemporal behavior features. Historical spatiotemporal behavior features include historical activity status data, historical location data, and the collection time corresponding to the historical activity status data and historical location data. Each piece of historical activity status data and each piece of historical location data is stored in association with its corresponding collection time.

[0035] After determining the current time period, the server filters out historical activity status data and historical location data whose collection time falls within the current time period from the historical spatiotemporal behavior characteristics, and then associates the filtered historical activity status data and historical location data according to their corresponding collection time. In this way, the real-time activity status and real-time location at the current moment are mapped to historical activity status data and historical location data with the same time conditions.

[0036] The current time period can be divided according to the time range within a day. For example, a day can be divided into multiple current time periods such as 00:00 to 06:00, 06:00 to 09:00, 09:00 to 12:00, 12:00 to 18:00, and 18:00 to 24:00. When the current moment falls into one of the current time periods, historical activity status data and historical location data corresponding to that current time period are selected from historical spatiotemporal behavior characteristics.

[0037] For example, at 08:20, the server determines the current time period to be from 06:00 to 09:00 based on the corresponding time information. It then filters historical activity status data and historical location data collected within the past 30 days that fell between 06:00 and 09:00 from historical spatiotemporal behavior characteristics. Assuming the filtered historical activity status data includes 180 pieces of motion status data and 20 pieces of stationary status data, and the filtered historical location data includes 150 pieces of location data within the first activity area, 40 pieces within the second activity area, and 10 pieces within the third activity area, the server uses this historical activity status data and historical location data as the historical activity status data and historical location data corresponding to the current time period.

[0038] S12: Determine the reference activity state corresponding to the current time period based on the frequency of occurrence of activity states in historical activity state data, and determine the reference activity area corresponding to the current time period based on the spatial distribution of locations in historical location data. Associate the reference activity state and the reference activity area as reference spatiotemporal behavior features.

[0039] The server counts the occurrence frequency of different activity states in the historical activity status data corresponding to the current time period, and determines the reference activity state corresponding to the current time period based on the occurrence frequency of each activity state. Specifically, the server counts the occurrence frequency of the moving state and the stationary state in the historical activity status data, and determines the activity state with the most occurrences as the reference activity state corresponding to the current time period, so that the reference activity state represents the historical activity state of the pet with a high occurrence frequency in the current time period.

[0040] The server further performs spatial distribution statistics on the historical location data corresponding to the current time period, categorizes the historical location data according to preset spatial regions, and counts the number of historical location data corresponding to each preset spatial region. Based on the distribution of historical location data in different preset spatial regions, a reference activity region corresponding to the current time period is determined. A preset spatial region with a historical location data quantity reaching a preset location quantity threshold can be determined as the reference activity region, or the preset spatial region with the largest number of historical location data can be determined as the reference activity region. In this embodiment, to avoid the reference activity region shifting due to a single historical location data point, consecutive adjacent preset spatial regions with a historical location data quantity reaching the preset location quantity threshold are associated to form a reference activity region.

[0041] The server associates the determined reference activity state with the reference activity area, and combines the associated reference activity state, reference activity area, and current time period to form a reference spatiotemporal behavioral feature. This reference spatiotemporal behavioral feature characterizes the pet's historical activity patterns within the current time period, ensuring that the reference activity state and reference activity area share the same temporal conditions.

[0042] For example, if the current time period is from 06:00 to 09:00, and the historical activity status data shows 180 occurrences of the motion state and 20 occurrences of the stationary state, then the server will determine the motion state as the reference activity state corresponding to the current time period. At the same time, in the historical location data, the first activity area corresponds to 150 historical location data, the second activity area corresponds to 40 historical location data, and the third activity area corresponds to 10 historical location data. If the preset location number threshold is set to 30, then the server will determine the first and second activity areas as the reference activity areas corresponding to the current time period, and associate the motion state with the reference activity area formed by the first and second activity areas to obtain the reference spatiotemporal behavior characteristics corresponding to the current time period.

[0043] S13: Compare the real-time activity state with the reference activity state in the reference spatiotemporal behavior features to obtain the state consistency comparison result. Compare the real-time location with the reference activity region in the reference spatiotemporal behavior features to obtain the location consistency comparison result.

[0044] The server compares the real-time activity status with the reference activity status in the reference spatiotemporal behavior characteristics to determine whether the real-time activity status matches the pet's historical activity status for the current time period. Specifically, when the real-time activity status is the same as the reference activity status, the result of the consistency comparison is determined to be consistent; when the real-time activity status is different from the reference activity status, the result of the consistency comparison is determined to be inconsistent.

[0045] The server simultaneously compares the real-time location with the reference activity area in the reference spatiotemporal behavior characteristics to determine whether the pet's current real-time location is within the historical activity area corresponding to the current time period. When the real-time location is within the reference activity area, the location consistency comparison result is determined to be consistent; when the real-time location is outside the reference activity area, the location consistency comparison result is determined to be inconsistent.

[0046] When comparing the real-time location with the reference activity area, the determination can be made based on the latitude and longitude coordinates of the real-time location and the spatial boundary of the reference activity area. If the latitude and longitude coordinates of the real-time location are within the spatial boundary of the reference activity area, the real-time location is determined to be within the reference activity area; if the latitude and longitude coordinates of the real-time location are outside the spatial boundary of the reference activity area, the real-time location is determined to be outside the reference activity area.

[0047] For example, the reference activity state corresponding to the current time period is a motion state, and the reference activity area includes a first activity area and a second activity area. When the real-time activity state acquired by the smart pet collar 1 is a motion state, the server determines that the state consistency comparison result is consistent. When the real-time location is within the first or second activity area, the server determines that the location consistency comparison result is consistent. At this time, both the real-time activity state and the real-time location are consistent with the reference spatiotemporal behavioral characteristics. When the real-time activity state is a stationary state and the real-time location is outside the first activity area, the server determines that the state consistency comparison result is inconsistent and the location consistency comparison result is inconsistent, respectively.

[0048] S14: Determine the corresponding behavior deviation component based on the state consistency comparison result and the position consistency comparison result, and determine the current spatiotemporal behavior deviation result based on the behavior deviation component.

[0049] The server determines the behavior deviation component based on the state consistency comparison result and the location consistency comparison result. The behavior deviation component is used to simultaneously characterize the state deviation between the real-time activity state and the reference activity state, as well as the location deviation between the real-time location and the reference activity area.

[0050] Specifically, the server determines the state deviation condition and the position deviation condition based on the state consistency comparison result and the position consistency comparison result, respectively: when the state consistency comparison result is a state inconsistency, the state deviation condition is determined to be met; when the position consistency comparison result is a position inconsistency, the position deviation condition is determined to be met. The server determines the behavior deviation component based on the combination of the state deviation condition and the position deviation condition, and further determines the behavior deviation component as a first deviation level, a second deviation level, or a third deviation level according to a preset deviation level judgment rule.

[0051] Among them, the first deviation level is used to characterize the simultaneous deviation of the real-time activity state and real-time position from the reference spatiotemporal behavior characteristics; the second deviation level is used to characterize the deviation of either the real-time activity state or the real-time position from the reference spatiotemporal behavior characteristics; and the third deviation level is used to characterize the consistency of both the real-time activity state and the real-time position with the reference spatiotemporal behavior characteristics.

[0052] For example, if the current real-time activity state is stationary and the real-time location is outside the reference activity area, while the reference activity state is in motion, the server determines that the state consistency comparison result is inconsistent and the location consistency comparison result is inconsistent. Since both the real-time activity state and the real-time location deviate from the reference spatiotemporal behavior characteristics, the server determines the corresponding behavior deviation component as the first deviation level. When the real-time activity state is stationary but the real-time location is within the reference activity area, the server determines the behavior deviation component as the second deviation level. When the real-time activity state is in motion and the real-time location is within the reference activity area, the server determines the behavior deviation component as the third deviation level.

[0053] Furthermore, the steps for determining the current spatiotemporal behavioral deviation result based on the behavioral deviation components specifically include: When the real-time activity state is inconsistent with the reference activity state and the real-time location is outside the reference activity area, the behavioral deviation component is determined as the first deviation level.

[0054] When the server determines that both the real-time activity state and real-time location deviate from the reference spatiotemporal behavioral characteristics due to inconsistencies in both state and location consistency comparisons, it assigns the behavioral deviation component as the first deviation level. The first deviation level corresponds to the situation where both state and location deviation conditions are met simultaneously.

[0055] For example, the reference activity state corresponding to the current time period is the movement state, and the reference activity area is the residential area where the pet's historical location data is mainly distributed during the current time period; when the real-time activity state obtained by the smart pet collar 1 is the stationary state, and the real-time location is outside the residential area, the server determines that the real-time activity state is inconsistent with the reference activity state, and determines that the real-time location is outside the reference activity area, and determines the corresponding behavior deviation component as the first deviation level.

[0056] When only the real-time activity state is inconsistent with the reference activity state, or when only the real-time location is outside the reference activity area, the behavioral deviation component is determined as the second deviation level.

[0057] To avoid overlap between the criteria for determining the first and second deviation levels, the server prioritizes the first deviation level when determining behavioral deviation components. The first deviation level criterion is met when the state consistency comparison result and the location consistency comparison result differ. However, if the real-time activity state is inconsistent with the reference activity state, or the real-time location is outside the reference activity area, the behavioral deviation component is determined to be at the second deviation level.

[0058] In other words, when only the state deviation condition or only the position deviation condition is met, it is determined to be the second deviation level; when both the state deviation condition and the position deviation condition are met, since the judgment condition of the first deviation level has already been met, the behavioral deviation component is no longer determined to be the second deviation level.

[0059] For example, when the reference activity state is in motion, the reference activity area is the residential perimeter area, and the real-time activity state is stationary while the real-time location is still within the residential perimeter area, the server determines that the state consistency comparison result is inconsistent and the location consistency comparison result is consistent, and classifies the behavioral deviation component as the second deviation level. When the real-time activity state is in motion and the real-time location is outside the residential perimeter area, the server determines that the state consistency comparison result is consistent and the location consistency comparison result is inconsistent, and similarly classifies the behavioral deviation component as the second deviation level. When the real-time activity state is stationary and the real-time location is outside the residential perimeter area, both the state deviation condition and the location deviation condition are met. In this case, it is classified as the first deviation level according to the priority judgment rule of the first deviation level, and is no longer classified as the second deviation level.

[0060] When the real-time activity state is consistent with the reference activity state and the real-time location is within the reference activity area, the behavioral deviation component is determined as the third deviation level.

[0061] When the state consistency comparison result indicates that the real-time activity state is consistent with the reference activity state, and the location consistency comparison result indicates that the real-time location is within the reference activity area, the server determines that both the current real-time activity state and the current real-time location conform to the historical spatiotemporal behavior characteristics corresponding to the current time period, and identifies the behavior deviation component as the third deviation level. The third deviation level serves as a state indicator that the current spatiotemporal behavior has not deviated.

[0062] For example, the reference activity state corresponding to the current time period is the movement state, and the reference activity area includes the first activity area and the second activity area around the residence. When the real-time activity state obtained by the smart pet collar 1 is the movement state, and the real-time location is within the first activity area or the second activity area, the server determines that the state consistency comparison result is consistent, the location consistency comparison result is consistent, and the behavior deviation component is determined as the third deviation level.

[0063] The first, second, or third deviation level is taken as the deviation result of the current spatiotemporal behavior.

[0064] The server will use the first deviation level, second deviation level, or third deviation level determined by the state consistency comparison result and the position consistency comparison result as the current spatiotemporal behavior deviation result corresponding to the current moment, and store the current spatiotemporal behavior deviation result in association with the collection time corresponding to the current moment.

[0065] The first, second, and third deviation levels correspond to different degrees of deviation from the current spatiotemporal behavior. The first deviation level indicates that both the real-time activity state and real-time location deviate from the reference spatiotemporal behavior characteristics simultaneously; the second deviation level indicates that either the real-time activity state or real-time location deviates from the reference spatiotemporal behavior characteristics; and the third deviation level indicates that both the real-time activity state and real-time location conform to the reference spatiotemporal behavior characteristics. The server records the current spatiotemporal behavior deviation results according to the collection time, enabling multiple deviation results to form a continuous sequence based on chronological order.

[0066] For example, at current time T1, if the real-time activity state matches the reference activity state and the real-time location is within the reference activity area, the server will use the third deviation level as the current spatiotemporal behavior deviation result. At current time T2, if the real-time activity state does not match the reference activity state but the real-time location is within the reference activity area, the server will use the second deviation level as the current spatiotemporal behavior deviation result. At current time T3, if the real-time activity state does not match the reference activity state but the real-time location is outside the reference activity area, the server will use the first deviation level as the current spatiotemporal behavior deviation result. The server associates and records the three current spatiotemporal behavior deviation results according to the collection time of T1, T2, and T3, forming corresponding current spatiotemporal behavior deviation result records.

[0067] In this embodiment, historical activity state data and historical location data with the same time conditions are filtered from historical spatiotemporal behavior features based on the time information corresponding to the current moment. Reference activity state and reference activity area are determined based on the frequency of occurrence of historical activity state data and the spatial distribution of historical location data, respectively. This ensures that the reference spatiotemporal behavior features simultaneously include the pet's activity state pattern and location distribution pattern under the corresponding time conditions. Furthermore, the real-time activity state is compared with the reference activity state for consistency, and the real-time location is compared with the reference activity area for consistency. Based on the two comparison results, a behavior deviation component is formed. The case where both state deviation and location deviation occur simultaneously is determined as the first deviation level, the case where only state deviation or location deviation occurs is determined as the second deviation level, and the case where both state and location are consistent is determined as the third deviation level. Thus, the changes in the pet's activity state and location at the current moment are uniformly incorporated into the determination process of the current spatiotemporal behavior deviation result, and different degrees of spatiotemporal behavior deviation are distinguished by the first deviation level, the second deviation level, and the third deviation level.

[0068] In one embodiment, step S20 involves continuously acquiring multiple current spatiotemporal behavior deviation results to determine the degree of deviation of the current spatiotemporal behavior from historical spatiotemporal behavior characteristics, and determining the risk of the pet getting lost based on the degree of deviation and the current spatiotemporal behavior deviation results. Specifically, this includes the following steps: S21: Continuously acquire multiple current spatiotemporal behavior deviation results according to a preset time interval, and sort the multiple current spatiotemporal behavior deviation results acquired continuously according to the corresponding acquisition time to obtain a deviation result sequence.

[0069] The server continuously acquires multiple current spatiotemporal behavior deviation results corresponding to the smart pet collar 1 at preset time intervals. Each current spatiotemporal behavior deviation result corresponds to a collection time, and each current spatiotemporal behavior deviation result includes a first deviation level, a second deviation level, or a third deviation level.

[0070] The preset time interval is determined based on the frequency of real-time activity status and real-time location collection by the smart pet collar 1, and maintains the same time interval between adjacent current spatiotemporal behavior deviation results. After the server obtains the current spatiotemporal behavior deviation results corresponding to multiple consecutive collection times, it sorts them from earliest to latest according to the collection time corresponding to each current spatiotemporal behavior deviation result, and associates the sorted current spatiotemporal behavior deviation results to obtain a deviation result sequence.

[0071] Each current spatiotemporal behavioral deviation result in the deviation result sequence has a corresponding collection time and deviation level, enabling the deviation result sequence to characterize the pet's behavioral changes relative to historical spatiotemporal behavioral characteristics over a continuous period. The preset time interval can be set according to the collection cycle of the smart pet collar 1, for example, set to 10 seconds; the number of consecutively acquired current spatiotemporal behavioral deviation results can be set according to the time window for judging the risk of getting lost, for example, acquiring 30 current spatiotemporal behavioral deviation results within 5 consecutive minutes.

[0072] For example, the smart pet collar 1 acquires real-time activity status and location at 10-second intervals, and obtains the corresponding current spatiotemporal behavior deviation result according to step S10. The server continuously acquires five current spatiotemporal behavior deviation results corresponding to collection times of 10:00:00, 10:00:10, 10:00:20, 10:00:30, and 10:00:40, with deviation levels of third deviation level, second deviation level, second deviation level, first deviation level, and first deviation level, respectively. The server sorts these results according to the above collection times and associates them to form a deviation result sequence, i.e., obtaining the deviation result sequence "third deviation level\second deviation level\second deviation level\first deviation level\first deviation level".

[0073] S22: Determine the number of consecutive deviations of the current spatiotemporal behavior deviation result based on the continuity between adjacent current spatiotemporal behavior deviation results in the deviation result sequence, and determine the degree of deviation duration based on the number of consecutive deviations.

[0074] The server determines the continuity of deviation levels for adjacent current spatiotemporal behavior deviations according to the chronological order of the deviation results. When adjacent current spatiotemporal behavior deviations both indicate that the current spatiotemporal behavior has deviated from the reference spatiotemporal behavior characteristics, the adjacent current spatiotemporal behavior deviations are determined to be continuous deviation results. Among them, the first and second deviation levels both indicate that deviation has occurred, and the third deviation level indicates that no deviation has occurred.

[0075] The server uses the current spatiotemporal behavior deviation result in the deviation result sequence at the current time as the current judgment node, and sequentially obtains adjacent current spatiotemporal behavior deviation results from the current judgment node in the direction of decreasing acquisition time. When the continuously obtained current spatiotemporal behavior deviation results are all of the first deviation level or the second deviation level, the number of consecutive deviations is accumulated; when the third deviation level is obtained, the accumulation of the current number of consecutive deviations stops, and the current number of consecutive deviations is determined as the number of consecutive deviations corresponding to the current time.

[0076] The server determines the duration of deviation based on the number of consecutive deviations. A larger number of consecutive deviations indicates a longer period of continuous deviation between the current spatiotemporal behavior and the reference spatiotemporal behavior characteristics. To ensure the duration of deviation corresponds to the actual data acquisition time, the deviation duration can be determined based on the number of consecutive deviations and a preset time interval, and the degree of deviation duration can then be determined based on this deviation duration.

[0077] For example, with a preset time interval of 10 seconds, the current deviation result sequence in chronological order is "Third Deviation Level\Second Deviation Level\Second Deviation Level\First Deviation Level\First Deviation Level". Taking the last first deviation level as the current spatiotemporal behavior deviation result corresponding to the current moment, the previous current spatiotemporal behavior deviation result is checked sequentially from the current moment backward, resulting in four consecutive deviation results: first deviation level, first deviation level, second deviation level, and second deviation level. Therefore, the current consecutive deviation count is determined to be 4 times. Calculated according to the preset time interval of 10 seconds, the corresponding deviation duration is 40 seconds, and the degree corresponding to this deviation duration is determined as the deviation duration degree at the current moment.

[0078] For example, when the deviation result sequence is "third deviation level\second deviation level\second deviation level\third deviation level\first deviation level", the last first deviation level is taken as the current spatiotemporal behavior deviation result corresponding to the current moment. Only the last current spatiotemporal behavior deviation result is continuous with its previous current spatiotemporal behavior deviation result. Then, the third deviation level is obtained. Therefore, the current consecutive deviation count is determined to be 1, and the corresponding deviation duration is 10 seconds.

[0079] S23: Determine the deviation level change based on the deviation level corresponding to each current spatiotemporal behavior deviation result in the deviation result sequence, determine the missing risk level through the degree of deviation duration and the deviation level change, and determine the pet's missing risk based on the missing risk level.

[0080] The server compares the deviation levels of adjacent current spatiotemporal behavior deviation results according to the collection time of each current spatiotemporal behavior deviation result in the deviation result sequence to determine the change in deviation level. The change in deviation level is used to characterize whether the degree of deviation of the current spatiotemporal behavior relative to the reference spatiotemporal behavior feature continues to increase, decrease, or remain unchanged.

[0081] The first, second, and third deviation levels are sorted from highest to lowest degree of deviation, with the first level corresponding to the highest degree of deviation, the second level to a moderate degree, and the third level to no deviation. When an adjacent current spatiotemporal behavior deviation result changes from the third to the second level, or from the second to the first level, the change in deviation level indicates an increase in the degree of deviation of the current spatiotemporal behavior. When an adjacent current spatiotemporal behavior deviation result changes from the first to the second level, or from the second to the third level, the change in deviation level indicates a decrease in the degree of deviation of the current spatiotemporal behavior. When adjacent current spatiotemporal behavior deviation results have the same deviation level, the change in deviation level indicates that the degree of deviation of the current spatiotemporal behavior remains unchanged.

[0082] The server determines the missing person risk level based on both the duration of deviation and the change in deviation level. The duration of deviation characterizes the duration of the current spatiotemporal behavioral deviation, while the change in deviation level characterizes the direction of change in the degree of deviation. The server divides the duration of deviation into multiple duration intervals and the change in deviation level into three categories: increasing deviation, unchanged deviation, and decreasing deviation. The missing person risk level is then determined based on the combination of the duration of deviation and the change in deviation level.

[0083] For example, the risk level of getting lost can be set as low risk, medium risk, and high risk. When the duration of the deviation is less than 30 seconds, the deviation duration is defined as short duration; when the duration of the deviation is between 30 and 120 seconds, the deviation duration is defined as medium duration; and when the duration of the deviation is greater than 120 seconds, the deviation duration is defined as long duration.

[0084] When the deviation duration is short and the deviation level change indicates that the deviation degree remains unchanged, the missing risk level is determined to be low risk; when the deviation duration is medium and the deviation level change indicates that the deviation degree increases, the missing risk level is determined to be medium risk; when the deviation duration is long and the deviation level change indicates that the deviation degree continues to increase, the missing risk level is determined to be high risk. The server will use the determined missing risk level as the pet's missing risk.

[0085] Furthermore, the steps for determining the risk of a pet getting lost based on the risk level are as follows: When the degree of deviation increases and the change in the deviation level indicates that the current spatiotemporal behavior continues to deviate from the characteristics of the reference spatiotemporal behavior, the risk level of getting lost is increased.

[0086] The server continuously compares the degree of deviation persistence at the current moment with the degree of deviation persistence at the previous moment. When the number of consecutive deviations at the current moment is greater than the number of consecutive deviations at the previous moment, the server determines that the degree of deviation persistence has increased.

[0087] Simultaneously, the server determines whether the degree of deviation of the current spatiotemporal behavior continues to deviate from the reference spatiotemporal behavior characteristics based on the changes in the deviation level in the deviation result sequence. When the deviation result of the current spatiotemporal behavior continuously maintains the first deviation level, or changes from the second deviation level to the first deviation level and continues to maintain the first deviation level, it is determined that the change in deviation level indicates that the current spatiotemporal behavior continues to deviate from the reference spatiotemporal behavior characteristics.

[0088] When it is determined that the degree of deviation is increasing and the change in the deviation level indicates that the current spatiotemporal behavior is continuously deviating from the characteristics of the reference spatiotemporal behavior, the server will raise the current missing person risk level by one risk level. If the current missing person risk level is low risk level, it will be raised to medium risk level; if the current missing person risk level is medium risk level, it will be raised to high risk level; if the current missing person risk level is already high risk level, it will remain high risk level.

[0089] For example, if the current deviation result sequence is "Third Deviation Level\Second Deviation Level\Second Deviation Level\First Deviation Level\First Deviation Level", and the current consecutive deviation count is 4, which is an increase compared to the 3 consecutive deviation counts at the previous judgment time, and the deviation level changes from the second deviation level to the first deviation level and remains at the first deviation level, then the server determines that the degree of deviation persistence has increased, and the change in deviation level indicates that the current spatiotemporal behavior is continuously deviating from the reference spatiotemporal behavior characteristics. If the current missing person risk level is medium risk level, then the current missing person risk level will be raised to high risk level.

[0090] The risk level of getting lost is reduced when the degree of deviation decreases and the current spatiotemporal behavior deviation result returns from the deviation state to the consistent state.

[0091] The server determines whether the degree of deviation has decreased by comparing the number of consecutive deviations at the current moment with the number of consecutive deviations at the previous moment. If the number of consecutive deviations at the current moment is less than the number of consecutive deviations at the previous moment, the server determines that the degree of deviation has decreased.

[0092] The server further determines whether the current spatiotemporal behavior deviation result has recovered from a deviation state to a consistent state. The second and first deviation levels are both determined to be deviation states, while the third deviation level is determined to be a consistent state. When the current spatiotemporal behavior deviation result corresponding to the current moment changes from the first or second deviation level corresponding to the previous determination moment to the third deviation level, it is determined that the current spatiotemporal behavior deviation result has recovered from a deviation state to a consistent state.

[0093] When the server determines that the degree of deviation is decreasing and the current spatiotemporal behavior deviation result has returned to a consistent state, the server will reduce the current missing person risk level by one risk level. If the current missing person risk level is high risk level, it will be reduced to medium risk level; if the current missing person risk level is medium risk level, it will be reduced to low risk level; if the current missing person risk level is already low risk level, it will remain low risk level.

[0094] For example, the consecutive parts in the current deviation result sequence are "Second Deviation Level\First Deviation Level\First Deviation Level\Third Deviation Level". When the current spatiotemporal behavior deviation result corresponding to the current moment is the third deviation level, the server determines that the current spatiotemporal behavior deviation result has recovered from the deviation state to the consistent state; at the same time, the current consecutive deviation count decreases from 3 times in the previous judgment moment to 0 times, indicating that the degree of deviation persistence has decreased. If the current missing person risk level is high risk level, the server will reduce the current missing person risk level to medium risk level.

[0095] The risk of a pet getting lost is determined based on whether the risk level has been increased or decreased at the current moment.

[0096] The server determines the direction of adjustment of the missing person risk level based on the degree of deviation and the change in deviation level at the current moment. When the conditions for increasing the risk level are met, the server adopts the increased missing person risk level; when the conditions for decreasing the risk level are met, the server adopts the decreased missing person risk level. When neither the conditions for increasing nor decreasing the risk level are met, the server maintains the missing person risk level corresponding to the previous judgment moment.

[0097] The server determines the current risk level of the pet's disappearance as the pet's risk level and records the disappearance risk in association with the current real-time activity status, real-time location, and deviation from the current spatiotemporal behavior.

[0098] The risk of getting lost includes at least three levels: low risk, medium risk, and high risk, with each level corresponding to a different risk status. A low risk level indicates that there is no sustained and significant deviation between the current spatiotemporal behavior and its historical characteristics; a medium risk level indicates that the current spatiotemporal behavior deviates continuously to the predetermined risk assessment criteria; and a high risk level indicates that the current spatiotemporal behavior deviates continuously and the degree of deviation further increases, triggering the candidate activity area determination in step S30 when the predetermined trajectory prediction criteria are met.

[0099] For example, at the current moment, if the current spatiotemporal behavior deviation result is at the first deviation level, with 15 consecutive deviations and a preset time interval of 10 seconds, then the corresponding deviation duration is 150 seconds. Furthermore, the most recent multiple current spatiotemporal behavior deviation results in the deviation result sequence change from the second deviation level to the first deviation level and remain at the first deviation level. Based on this, the server determines that the deviation duration has increased, and the change in deviation level indicates that the current spatiotemporal behavior is continuously deviating from the reference spatiotemporal behavior characteristics. Therefore, the original medium-risk level is raised to a high-risk level, and this upgraded high-risk level is identified as the risk of the pet getting lost.

[0100] For example, at the current moment, the deviation result of the current spatiotemporal behavior has been restored from the second deviation level to the third deviation level, the number of consecutive deviations has decreased from 6 times at the previous judgment time to 0 times, the degree of deviation has decreased, and at the same time, the deviation result of the current spatiotemporal behavior has been restored to a consistent state. If the missing risk corresponding to the previous judgment time was a medium risk level, then the server will reduce the missing risk level to a low risk level, and determine the reduced low risk level as the missing risk level of the pet at the current moment.

[0101] In this embodiment, multiple current spatiotemporal behavior deviation results are continuously acquired at preset time intervals, and a deviation result sequence is formed according to the acquisition time. The number of consecutive deviations is determined based on the continuity of the first deviation level, the second deviation level, and the third deviation level in the deviation result sequence. The degree of deviation is further determined based on the number of consecutive deviations. At the same time, the direction of the change in the degree of deviation of the current spatiotemporal behavior is determined by the change in the deviation level between adjacent current spatiotemporal behavior deviation results, and the degree of deviation is correlated with the change in the deviation level to dynamically increase or decrease the level of the risk of getting lost. This avoids determining the risk of the pet getting lost based solely on a single current spatiotemporal behavior deviation result, and allows the risk of the pet getting lost to be continuously determined based on the duration and degree of deviation of the current spatiotemporal behavior deviation.

[0102] like Figure 5 As shown, in one embodiment, step S30, i.e., when the risk of getting lost meets the preset trajectory prediction conditions, determines the candidate activity area that matches the current pet's behavior based on the current real-time location, real-time activity status, and historical spatiotemporal behavioral characteristics. This specifically includes the following steps: S31: When the risk of getting lost meets the preset trajectory prediction conditions, based on the time information corresponding to the current time, historical activity areas that match the current time conditions are selected from historical spatiotemporal behavior characteristics, and activity areas that match the real-time activity status are selected from historical activity areas based on the real-time activity status, thus obtaining a set of candidate areas.

[0103] When the server determines that the risk of a pet getting lost meets the preset trajectory prediction conditions, it obtains the time information corresponding to the current moment and determines the current time conditions based on the time information corresponding to the current moment. The current time conditions are consistent with the method of determining the current time period in step S11, so as to associate the real-time activity status and real-time location corresponding to the current moment with the historical spatiotemporal behavior characteristics under the same time conditions.

[0104] The server filters historical location data from historical spatiotemporal behavior characteristics, collecting data whose time falls within the current time condition. Based on the filtered historical location data, it determines the historical activity area corresponding to the current time condition. Specifically, the server categorizes the historical location data under the current time condition into preset spatial regions, counts the number of historical location data corresponding to each preset spatial region, and determines the preset spatial region whose number of historical location data reaches a preset location quantity threshold as the historical activity area. When multiple adjacent preset spatial regions all meet the preset location quantity threshold, the multiple adjacent preset spatial regions are associated to form a historical activity area.

[0105] The server further obtains the real-time activity status corresponding to the current moment and compares it with the historical activity status corresponding to each historical activity region. It then filters out activity regions whose historical activity status matches the real-time activity status. These filtered activity regions are then associated to form a candidate region set, ensuring that the activity regions in the candidate region set simultaneously satisfy both the current time condition and the real-time activity status condition.

[0106] The preset location quantity threshold can be determined based on the amount of historical data corresponding to historical spatiotemporal behavior characteristics. For example, 5% of the total number of historical location data corresponding to the current time condition can be set as the preset location quantity threshold; when the number of historical location data in a certain preset spatial area is not less than the preset location quantity threshold, the preset spatial area is determined as a historical activity area. For historical activity states, the reference activity state determined in step S12 can be directly used as the historical activity state, or the activity state that appears most frequently in each historical activity area can be used as the corresponding historical activity state.

[0107] For example, if the current time is 18:20 and the risk of getting lost has reached a high-risk level, the server determines the current time condition as 18:00 to 21:00 based on the current time, and filters historical location data corresponding to 18:00 to 21:00 within the past 30 days from historical spatiotemporal behavior characteristics. Assume the filtered historical location data are distributed in the first, second, third, and fourth activity regions, where the historical activity states corresponding to the first and second activity regions are in motion, the historical activity state corresponding to the third activity region is in a stationary state, and the historical activity state corresponding to the fourth activity region is in motion. If the real-time activity state corresponding to the current time is in motion, the server retains the first, second, and fourth activity regions and forms a candidate region set from these activity regions.

[0108] S32: Determine the location distance between each active region in the candidate region set and the real-time location based on the real-time location, and sort the active regions in the candidate region set according to the location distance to obtain the sorted active regions.

[0109] The server obtains the real-time location corresponding to the current moment and determines the location distance between each active region in the candidate region set and the real-time location. Specifically, the server determines the location distance based on the longitude and latitude coordinates corresponding to the real-time location and the region location corresponding to each active region.

[0110] For each activity area, the server can use the center position of the activity area as the location of the activity area and calculate the spatial distance between the real-time location and the center position of the area. When the activity area is formed by multiple adjacent preset spatial areas, the center position of the multiple adjacent preset spatial areas is determined as the center position of the activity area.

[0111] The server sorts the active regions in the candidate region set according to their location distance from smallest to largest, resulting in a sorted list of active regions. Among these, active regions located earlier in the sorting list have smaller location distances to the current real-time location, while active regions located later in the sorting list have larger location distances to the current real-time location.

[0112] To avoid a lack of differentiation in the sorting results due to the close proximity of activity areas, the server can further sort the activity areas based on the amount of historical location data corresponding to each activity area when the location distance is the same, placing the activity areas with a larger amount of historical location data first.

[0113] For example, if the current real-time location is P0, and the candidate region set includes the first active region, the second active region, and the fourth active region, the server determines that the distance between the real-time location P0 and the center location P1 of the first active region is 80 meters, the distance between the real-time location P0 and the center location P2 of the second active region is 150 meters, and the distance between the real-time location P0 and the center location P4 of the fourth active region is 320 meters. Then, the first active region, the second active region, and the fourth active region are arranged in ascending order of distance as the first active region\second active region\fourth active region, resulting in the sorted active regions.

[0114] S33: Based on the historical activity status, historical location, and historical location change relationship of each activity area after sorting, determine the degree of behavioral matching between each activity area and the current pet behavior, and determine the candidate activity areas from the candidate area set based on the degree of behavioral matching.

[0115] The server retrieves the historical activity status, historical location, and historical location change relationships for each sorted activity area. The historical activity status represents the pet's historical activity within the corresponding activity area, the historical location represents the pet's historical location distribution within the corresponding activity area, and the historical location change relationship represents the direction and distance of the pet's position change when moving from one activity area to another.

[0116] The server compares the real-time activity status with the historical activity status of each activity area to determine the matching status; it compares the direction of location change corresponding to the real-time location with the historical location change relationship corresponding to each activity area to determine the matching status of location change; and it combines the location distance between each activity area and the real-time location to determine the degree of behavioral matching between each activity area and the current pet behavior.

[0117] Specifically, an activity state matching component, a location change matching component, and a distance matching component can be set separately. These matching components are then weighted and summed according to preset matching weights to obtain the behavioral matching degree corresponding to each activity area. The activity state matching component represents the consistency between the real-time activity state and the historical activity state corresponding to the activity area; the location change matching component represents the consistency between the current real-time location's location change trend and the historical location change relationship; and the distance matching component represents the proximity between the activity area and the current real-time location.

[0118] To avoid overly complex calculations, the degree of behavior matching can be determined using a hierarchical approach. For example, activity state matching, location change matching, and distance matching can be set to two states: satisfied and not satisfied, each assigned a corresponding matching score. When the real-time activity state matches the historical activity state corresponding to the activity area, the activity state matching component is set to 1; otherwise, it is set to 0. When the direction of location change corresponding to the real-time location matches the direction of location change corresponding to the historical location of the activity area, the location change matching component is set to 1; otherwise, it is set to 0. When the distance between the activity area and the real-time location is less than a preset distance threshold, the distance matching component is set to 1; otherwise, it is set to 0. The server then adds these three matching components to obtain the degree of behavior matching.

[0119] The server compares the sorted activity regions according to their behavior matching degree from high to low, and identifies the activity region with the highest behavior matching degree that meets the preset matching degree threshold as the candidate activity region. When multiple activity regions have the same behavior matching degree, further filtering is performed based on the location distance between each activity region and the real-time location, and the activity region with the smaller location distance is identified as the candidate activity region.

[0120] The preset matching threshold is determined based on the number of activity state matching components, location change matching components, and distance matching components. For example, when three matching components are set, the preset matching threshold can be set to 2 points, meaning that the activity area is considered to meet the preset matching threshold when it satisfies at least two of the activity state matching, location change matching, and distance matching criteria.

[0121] For example, the sorted activity areas are designated as the first, second, and fourth activity areas, with a real-time activity state of "movement." The server retrieves the historical activity state of the first activity area as "movement," the historical position change direction as "east," and the position distance from the real-time location as 80 meters; the historical activity state of the second activity area as "movement," the historical position change direction as "north," and the position distance from the real-time location as 150 meters; and the historical activity state of the fourth activity area as "movement," the historical position change direction as "east," and the position distance from the real-time location as 320 meters. If the current real-time location's position change direction is east, and the preset distance threshold is 200 meters, then the first activity area satisfies all three conditions: activity state matching, position change matching, and distance matching, corresponding to a behavior matching score of 3. The second activity area satisfies both activity state matching and distance matching, corresponding to a behavior matching score of 2. The fourth activity area satisfies both activity state matching and position change matching, but not the distance matching condition, corresponding to a behavior matching score of 2. The server determines the first activity area as the activity area with the highest behavior matching score and designates it as a candidate activity area.

[0122] In this embodiment, after the risk of getting lost meets the preset trajectory prediction conditions, a set of candidate regions is selected from historical spatiotemporal behavioral characteristics by combining the current time conditions and real-time activity status. Then, the regions are sorted according to the distance between the real-time location and each activity region. Furthermore, the degree of behavior matching is determined by combining the historical activity status, historical location, and historical location change relationship of each activity region. Instead of simply selecting the prediction starting point according to distance, the current activity status, current spatial location, and historical activity patterns of the pet are used together to determine the candidate activity regions. This ensures that the determined candidate activity regions can maintain a correspondence with the pet's current behavior status and historical activity path, providing a clear candidate starting point for subsequent continuous trajectory expansion using pet activity heatmaps and historical trajectories.

[0123] In one embodiment, step S40 involves organizing the historical spatiotemporal behavioral features into trajectory points according to the collection time and statistically analyzing their location distribution according to spatial regions to obtain a set of historical trajectory points and location distribution data. This specifically includes the following steps: S41: Extract historical location data and corresponding collection time from historical spatiotemporal behavior features, sort the historical location data according to the order of collection time, and associate the sorted historical location data and corresponding collection time to form historical trajectory points.

[0124] The server extracts historical location data and the corresponding collection time for each historical location from historical spatiotemporal behavioral characteristics. Historical location data includes at least the longitude and latitude information of the pet at the corresponding collection time, with the collection time representing the specific point in time when the corresponding historical location data was acquired. The server sorts the historical location data in ascending order of collection time and associates each sorted historical location with its corresponding collection time to form a historical trajectory point, ensuring that each historical trajectory point contains both location and time attributes.

[0125] To avoid duplicate location data caused by positioning anomalies in historical location data, the server performs a time validity check on the historical location data sorted by collection time. Duplicate historical location data with the same collection time and the same historical location data are retained as one historical location data. For historical location data with discontinuous collection time, the corresponding historical trajectory points are still retained according to the actual collection time, and missing historical location data are not manually supplemented.

[0126] For example, Figure 6 As shown, the historical spatiotemporal behavior features include historical location data collected between 18:00 and 21:00 on August 10, 2026. The first historical location data was collected at 18:00:00, the second at 18:00:10, and the third at 18:00:20. These three historical location data correspond to longitudes of 113.1230, 113.1231, and 113.1233, and latitudes of 23.0120, 23.0122, and 23.0125, respectively. The server sorts the three historical location data according to their collection time and associates each historical location data with its corresponding collection time to form the first historical trajectory point, the second historical trajectory point, and the third historical trajectory point.

[0127] S42: Divide each historical trajectory point into a preset time period according to the collection time corresponding to the historical trajectory point, and classify the historical trajectory points within the same time period according to the preset spatial region to obtain a set of historical trajectory points.

[0128] The server divides continuous historical time into multiple preset time periods based on the collection time corresponding to each historical trajectory point, and assigns the historical trajectory points to the corresponding preset time periods according to their collection time. The preset time periods are used to categorize historical trajectory points with the same time range on different dates, in order to preserve the historical activity patterns of pets under the same time conditions on different dates.

[0129] After determining the preset time period, the server categorizes historical trajectory points belonging to the same preset time period according to preset spatial regions. Each preset spatial region consists of multiple pre-divided spatial units, each corresponding to a fixed geographical location range. The preset spatial region to which a historical trajectory point belongs is determined based on its historical location data. The server then categorizes historical trajectory points belonging to the same preset time period and located within the same preset spatial region, resulting in a corresponding set of historical trajectory points.

[0130] Preset time periods can be divided according to fixed time lengths, such as dividing a day into multiple 30-minute preset time periods, and grouping historical trajectory points within the same time range on different dates into the same preset time period. Preset spatial areas can be formed using a regular grid division method, that is, setting fixed spatial intervals along both the longitude and latitude directions to divide the pet's activity range into multiple spatial units, and determining the corresponding preset spatial areas based on the longitude and latitude intervals where the historical location data is located.

[0131] For example, if a day is divided into 30-minute preset time periods, then 18:00 to 18:30 corresponds to the first preset time period, and 18:30 to 19:00 corresponds to the second preset time period. The server assigns historical trajectory points collected from 18:00 to 18:30 on August 10th, 11th, and 12th to the first preset time period. Furthermore, the pet's activity range is divided into multiple preset spatial regions in every 0.001° of longitude and every 0.001° of latitude. If historical trajectory points collected at 18:05 on August 10th, 18:12 on August 11th, and 18:20 on August 12th are all located within the same preset spatial region, the server categorizes these historical trajectory points into the same set of historical trajectory points corresponding to the first preset time period.

[0132] S43: Count the number of historical trajectory points in each preset spatial area, and determine the location distribution data of each preset spatial area based on the correlation between the number of historical trajectory points in each preset spatial area and the corresponding time period.

[0133] The server counts the number of historical trajectory points in each preset spatial area for each preset time period, and associates the number of historical trajectory points in each preset spatial area with the corresponding preset time period to form location distribution data. The location distribution data includes at least the correspondence between the preset time period, the preset spatial area, and the number of historical trajectory points, to characterize the historical location distribution of pets in different preset spatial areas under different time conditions.

[0134] For each preset spatial region within the same preset time period, the server counts the number of historical trajectory points belonging to that preset time period and located within that preset spatial region, and determines the location distribution degree of the corresponding preset spatial region based on the number of historical trajectory points. To eliminate differences in the total number of historical trajectory points across different preset time periods, the server can calculate the ratio of the number of historical trajectory points within a preset spatial region to the total number of historical trajectory points within the same preset time period, and use this ratio as the location distribution degree of the corresponding preset spatial region, associating this location distribution degree with the location distribution data.

[0135] Specifically, for any preset time period, the number of historical trajectory points in a certain preset spatial region within that preset time period is recorded as the first quantity, and the sum of the number of historical trajectory points in all preset spatial regions within that preset time period is recorded as the second quantity. The degree of positional distribution of the preset spatial region within that preset time period can then be determined based on the ratio between the first quantity and the second quantity. The resulting positional distribution data can simultaneously characterize the positional distribution of the preset spatial region and the corresponding time conditions.

[0136] For example, within a preset time period from 18:00 to 18:30, a total of 1000 historical trajectory points are collected. The first preset spatial region contains 300 historical trajectory points, the second preset spatial region contains 200, the third preset spatial region contains 100, and the remaining historical trajectory points are distributed across other preset spatial regions. The server associates the first preset spatial region, the 18:00-18:30 time period, and the 300 historical trajectory points. The server sets the location distribution degree corresponding to the first preset spatial region at 30%, the second preset spatial region at 20%, and the third preset spatial region at 10%, thus obtaining location distribution data that includes the correspondence between different preset time periods, preset spatial regions, the number of historical trajectory points, and the location distribution degree.

[0137] In this embodiment, historical location data and corresponding collection times are extracted from historical spatiotemporal behavior features to form historical trajectory points. These historical trajectory points are then classified according to preset time periods and preset spatial regions. The location distribution data is determined by combining the correlation between the number of historical trajectory points in each preset spatial region and the corresponding time period. This process organizes the discrete historical location data in the historical spatiotemporal behavior features into structured data with time conditions and spatial region correspondences. At the same time, the historical location distribution of pets in different time periods is preserved, thus providing a clear location distribution basis for subsequent determination of pet activity heatmaps and prediction trajectory expansion using pet activity heatmaps.

[0138] In one embodiment, step S50, which involves determining the positional change relationship between each trajectory point based on the acquisition time corresponding to each trajectory point in the historical trajectory point set, and connecting each trajectory point according to the positional change relationship to obtain the historical trajectory, specifically includes the following steps: S51: Determine adjacent historical trajectory points according to the collection time corresponding to each historical trajectory point in the historical trajectory point set, and obtain the historical position corresponding to each adjacent historical trajectory point.

[0139] For each historical trajectory point in the historical trajectory point set, the server reads the corresponding collection time and arranges the historical trajectory points in ascending order of collection time, identifying two historical trajectory points with adjacent collection times as adjacent historical trajectory points. For each group of adjacent historical trajectory points, the server extracts the historical locations corresponding to the two adjacent historical trajectory points to establish a correspondence between adjacent historical trajectory points and historical locations.

[0140] The determination of adjacent historical trajectory points is based on the collection time. That is, for a sequence of historical trajectory points sorted by collection time, the i-th historical trajectory point and the (i+1)-th historical trajectory point are determined as a pair of adjacent historical trajectory points. For two historical trajectory points whose collection time interval exceeds a preset time interval threshold, an adjacency relationship is not directly established to avoid incorrectly connecting two actually discontinuous locations due to long periods of missing historical location data.

[0141] For example, historical trajectory points P1, P2, P3, and P4 are obtained by sorting them according to their collection time, with collection times of 18:00:00, 18:00:10, 18:00:20, and 18:00:30, respectively. If the preset time interval threshold is 20 seconds, then P1 and P2, P2 and P3, and P3 and P4 constitute adjacent historical trajectory points. If the collection time of P3 is 18:01:00, then the collection time interval between P2 and P3 is 50 seconds, which is greater than the preset time interval threshold, and in this case, P2 and P3 are not adjacent. The server obtains the longitude and latitude information corresponding to P1, P2, P3, and P4, respectively, as their corresponding historical locations.

[0142] S52: Determine the direction and distance of position change between adjacent historical trajectory points based on their historical positions, and determine the position change relationship between adjacent historical trajectory points based on their direction and distance of position change.

[0143] For each set of adjacent historical trajectory points, the server determines the changes in longitude and latitude between the historical positions based on the historical positions corresponding to the two adjacent historical trajectory points, and determines the corresponding direction of position change based on the changes in longitude and latitude.

[0144] Specifically, the historical location corresponding to the earlier collected historical trajectory point is determined as the starting historical location, and the historical location corresponding to the later collected historical trajectory point is determined as the ending historical location. The direction of position change is determined based on the longitude and latitude differences between the ending and starting historical locations. When the longitude and latitude differences together indicate that the pet has moved from the starting historical location to the ending historical location, this direction is determined as the corresponding direction of position change.

[0145] The server further calculates the distance of position change based on the latitude and longitude coordinates between two historical locations. For pet activity areas with a small latitude and longitude range, a planar distance calculation method based on latitude and longitude coordinates can be used; when the activity range is large, the Haversine distance algorithm in existing technology can be used to calculate the spherical distance between two latitude and longitude coordinates. This yields the distance of position change between adjacent historical trajectory points.

[0146] The server correlates the direction and distance of position change to obtain the position change relationship between adjacent historical trajectory points, so that each position change relationship contains both the direction and distance of movement information.

[0147] For example, the historical location corresponding to the first historical trajectory point is 113.1230° longitude and 23.0120° latitude, and the historical location corresponding to the second historical trajectory point is 113.1235° longitude and 23.0123° latitude. The server determines the direction of the pet's movement from the first historical trajectory point to the second historical trajectory point based on the difference in longitude and latitude between the two historical locations, and calculates that the distance of the position change between the two historical locations is about 58 meters. Therefore, "moving from the location corresponding to the first historical trajectory point to the location corresponding to the second historical trajectory point, with a position change distance of about 58 meters" is determined as the position change relationship between the first historical trajectory point and the second historical trajectory point.

[0148] S53: Connect adjacent historical trajectory points with positional change relationships according to the collection time corresponding to the historical trajectory points, and associate the positional change relationships corresponding to the continuously connected historical trajectory points to obtain the historical trajectory.

[0149] The server sequentially connects adjacent historical trajectory points with positional change relationships, according to the collection time of the historical trajectory points from earliest to latest. For each group of adjacent historical trajectory points connected, the positional change relationship corresponding to that group of adjacent historical trajectory points is associated with the corresponding connection relationship, so that the connected historical trajectory simultaneously retains the time sequence of the historical trajectory points, the historical position, and the direction and distance of positional change between adjacent historical trajectory points.

[0150] For multiple sets of adjacent historical trajectory points with continuous positional changes, the server continuously associates the positional changes according to the collection time, thus forming a historical trajectory composed of multiple historical trajectory points and multiple positional changes. For historical trajectory points that have not established an adjacent relationship due to the collection time interval exceeding a preset time interval threshold, they are not directly connected to the previous historical trajectory point to maintain the temporal continuity in the historical trajectory.

[0151] Furthermore, the server can segment the formed historical trajectory according to the collection time of the historical trajectory points, and divide the historical trajectory points with continuous collection time and continuous position change relationship into the same historical trajectory segment; when there is no position change relationship between adjacent historical trajectory points, the corresponding historical trajectory segment is broken, thereby obtaining a historical trajectory composed of one or more historical trajectory segments.

[0152] For example, historical trajectory points are obtained sequentially according to the collection time: the first, second, third, and fourth historical trajectory points. The positional change relationships between the first and second historical trajectory points, between the second and third historical trajectory points, and between the third and fourth historical trajectory points are determined respectively. The server connects these four historical trajectory points sequentially according to the collection time and associates them with the three sets of positional change relationships to form a continuous historical trajectory. If there is no positional change relationship between the second and third historical trajectory points due to a large collection time interval, the server forms a first historical trajectory segment and a second historical trajectory segment, without establishing a direct connection between the second and third historical trajectory points.

[0153] In this embodiment, adjacent historical trajectory points are determined according to the collection time, and the direction and distance of position change are determined by combining the historical positions corresponding to the adjacent historical trajectory points. Then, adjacent historical trajectory points with position change relationships are connected sequentially according to the collection time. This makes the historical trajectory not only include the spatial distribution of the pet's historical position, but also retain the temporal relationship, position change direction, and position change distance between each historical position. In this way, the scattered historical position data is organized into historical trajectories with continuous position change relationships, providing specific historical trajectory basis for subsequently combining pet activity heatmaps to determine the expansion direction and expansion distance between candidate activity areas.

[0154] like Figure 7 and Figure 8 As shown, in one embodiment, step S60, which involves determining the degree of location distribution corresponding to different activity areas based on location distribution data to obtain a pet activity heatmap, and continuously expanding the candidate activity areas using the pet activity heatmap and historical trajectories to obtain the corresponding predicted trajectories, specifically includes the following steps: S61: Determine the historical location percentage of each activity area within the corresponding time period based on the location distribution data corresponding to each activity area, and determine the location distribution degree of each activity area based on the historical location percentage.

[0155] The server retrieves the number of historical trajectory points corresponding to each activity area and the total number of historical trajectory points within the corresponding time period from the location distribution data. It then determines the historical location percentage of each activity area within the corresponding time period based on the ratio between the number of historical trajectory points for each activity area and the total number of historical trajectory points within the corresponding time period. The historical location percentage characterizes the proportion of a pet's historical location within a given activity area within that time period.

[0156] Specifically, for any activity area, the server obtains the number of historical trajectory points for that activity area within the target time period, and sums the number of historical trajectory points for all activity areas within the target time period. The server then divides the number of historical trajectory points for that activity area by the sum of the historical trajectory points to obtain the historical position percentage of that activity area within the target time period. The server uses this historical position percentage as the degree of positional distribution for the corresponding activity area. When the same activity area corresponds to multiple time periods, the server calculates the historical position percentage for that activity area in each time period separately, and determines the degree of positional distribution used for trajectory prediction based on the time period corresponding to the current time conditions.

[0157] To ensure that the location distribution corresponds to the current pet behavior, the server can prioritize the location distribution over the time period corresponding to the current moment. When the number of historical trajectory points within the current time period is less than a preset historical number threshold, the time periods adjacent to the current time period are included in the statistical scope, and the number of historical trajectory points corresponding to each time period included in the statistical scope is merged to calculate the historical location percentage. The preset historical number threshold is determined based on the number of historical trajectory points corresponding to the current time period; for example, 20 historical trajectory points can be used as the preset historical number threshold.

[0158] For example, if the current time period is from 18:00 to 18:30, the location distribution data shows that there are a total of 1000 historical trajectory points within this time period. Among them, the first activity area contains 300 historical trajectory points, the second activity area contains 200 historical trajectory points, the third activity area contains 100 historical trajectory points, and the remaining historical trajectory points are distributed in other activity areas. Then the server determines the proportion of historical locations corresponding to the first activity area as 30%, the proportion of historical locations corresponding to the second activity area as 20%, and the proportion of historical locations corresponding to the third activity area as 10%, and determines 30%, 20%, and 10% as the location distribution degree of the first activity area, the second activity area, and the third activity area, respectively.

[0159] S62: Correlate the corresponding activity areas according to the degree of location distribution of each activity area to obtain a pet activity heat map that represents the differences in location distribution between different activity areas.

[0160] The server associates activity areas according to their spatial distribution, and connects activity areas with the same spatial adjacency according to their corresponding spatial distribution degree to obtain a pet activity heatmap. The pet activity heatmap includes at least the spatial relationships between activity areas and the corresponding spatial distribution degree of each activity area, so that differences in spatial distribution between different activity areas can be distinguished by their respective spatial distribution degrees.

[0161] Specifically, the server divides the location distribution of each activity area into multiple location distribution levels and associates activity areas belonging to the same location distribution level. For adjacent activity areas with different location distribution levels, the server retains the location distribution level corresponding to each activity area and establishes the location distribution difference relationship between adjacent activity areas, thereby forming a pet activity heat map composed of multiple activity areas and their location distribution levels.

[0162] Location distribution levels can be categorized based on the numerical range of location distribution severity. For example, activity areas with a location distribution severity of less than 10% are classified as Level 1, those with a severity of 10% to 20% as Level 2, those with a severity of 20% to 30% as Level 3, and those with a severity of greater than 30% as Level 4. The server associates each activity area with its corresponding location distribution level and retains the severity of location distribution for each activity area.

[0163] For example, the location distribution level of the first activity area is 30%, the location distribution level of the second activity area is 20%, the location distribution level of the third activity area is 10%, and the location distribution level of the fourth activity area is 5%. The server determines that the first activity area belongs to the third location distribution level, the second activity area belongs to the third location distribution level, the third activity area belongs to the second location distribution level, and the fourth activity area belongs to the first location distribution level, respectively, and associates them according to the spatial adjacency relationships between each activity area to obtain a pet activity heatmap representing the location distribution differences among the first, second, third, and fourth activity areas.

[0164] S63: Determine the associated activity areas corresponding to the candidate activity areas based on the distribution of the candidate activity areas in the pet activity heat map, and determine the direction and distance of positional change between the candidate activity areas and the associated activity areas through historical trajectories.

[0165] The server determines the locational distribution of candidate activity areas in the pet activity heatmap and filters related activity areas from those that are spatially adjacent to the candidate activity areas. Related activity areas are those that have historical activity connections with the candidate activity areas and can serve as the trajectory extension direction of the candidate activity areas.

[0166] Specifically, the server obtains the location distribution degree corresponding to the candidate activity areas, and sorts the activity areas that are spatially adjacent to the candidate activity areas according to the location distribution degree from high to low. The activity areas whose location distribution degree reaches the preset distribution degree threshold are identified as candidate associated activity areas. The server further searches for historical trajectory points that pass through the candidate activity areas and extend into the candidate associated activity areas from the historical trajectory. Based on the collection time corresponding to the historical trajectory points, the server determines the historical location change direction and historical location change distance when the pet moves from the candidate activity area to the candidate associated activity area, and determines the corresponding historical location change direction and historical location change distance as the location change direction and location change distance between the candidate activity area and the associated activity area.

[0167] The preset distribution threshold is determined based on the location distribution of the activity area corresponding to the current time period. For example, 50% of the location distribution of the candidate activity area is set as the preset distribution threshold to filter related activity areas with a high historical location distribution.

[0168] When multiple activity areas meet the preset distribution threshold, the server further filters based on the number of historical trajectories pointing from candidate activity areas to each activity area, and determines the activity area with a larger number of historical trajectories as the associated activity area; when the number of historical trajectories is the same, the server filters based on the distance of position change between candidate activity areas and each activity area, and determines the activity area with a smaller distance of position change as the associated activity area.

[0169] For example, the location distribution degree corresponding to the candidate activity area is 30%, and the location distribution degrees of the first associated area, the second associated area, and the third associated area adjacent to the candidate activity area are 25%, 18%, and 8%, respectively. If the preset distribution degree threshold is set to 50% of the location distribution degree of the candidate activity area, i.e., 15%, then the first associated area and the second associated area meet the preset distribution degree threshold. The server further counts the number of historical trajectories extending from the candidate activity area to the first associated area and the second associated area from the historical trajectories. If the number of historical trajectories corresponding to the first associated area is 35 and the number of historical trajectories corresponding to the second associated area is 18, then the first associated area is determined as the associated activity area, and its orientation is determined according to north at the top, south at the bottom, west on the left, and east on the right. At this time, the historical trajectory determines that the direction of the change in position of the candidate activity area moving towards the first associated area is northeast, with a change in position distance of 120m, and the direction of the change in position of the first associated area moving towards the second associated area is southeast, with a change in position distance of 180m.

[0170] S64: Extend the trajectory from the candidate activity area to the associated activity area according to the direction and distance of the position change, and continue to determine the next associated activity area in the extended associated activity area until the preset trajectory extension condition is met. Connect the continuously extended activity areas according to the corresponding position change relationship to obtain the predicted trajectory.

[0171] The server uses candidate activity areas as the starting area for predicting the trajectory. It determines the trajectory expansion path based on the direction and distance of positional change between the candidate activity area and related activity areas, and connects the candidate activity area and related activity areas to form the first segment of the predicted trajectory. The server then uses the expanded related activity areas as the new starting point for trajectory expansion and re-determines the next related activity area corresponding to this one in the pet activity heatmap. Based on historical trajectories, it determines the direction and distance of positional change between the current related activity area and the next related activity area, and continues trajectory expansion according to the determined direction and distance.

[0172] The server determines the associated activity areas and expands the trajectory step by step in the above manner, and associates the positional change relationships corresponding to each trajectory expansion, so that the predicted trajectory consists of the candidate activity area, the associated activity areas obtained by continuous expansion, and the positional change relationships between the activity areas.

[0173] The preset trajectory expansion conditions include at least one or more of the following: trajectory expansion count condition, location distribution degree condition, and trajectory expansion distance condition. When the number of consecutive trajectory expansions reaches the preset expansion count, the location distribution degree of the activity area to be expanded is lower than the preset distribution degree threshold, or the cumulative trajectory expansion distance reaches the preset expansion distance, trajectory expansion stops, and the activity areas that have been continuously expanded are connected according to their corresponding location change relationships to obtain the predicted trajectory.

[0174] For example, using a candidate activity area as the starting area for the predicted trajectory, the server determines, based on historical trajectories, that the candidate activity area's position change direction towards the first associated activity area is eastward, with a change distance of 120 meters. Therefore, the candidate activity area is extended eastward by 120 meters to the first associated activity area. The server then determines a second associated activity area based on the distribution of the first associated activity area in the pet activity heatmap, and, based on historical trajectories, determines that the position change direction from the first associated activity area to the second associated activity area is northeastward, with a change distance of 180 meters. Therefore, it continues to extend northeastward by 180 meters. If the preset number of extensions is 3, the server will continue to perform the associated activity area determination and trajectory extension once more until the preset number of extensions is reached, at which point trajectory extension stops. The server then connects the activity areas in the order of candidate activity area\first associated activity area\second associated activity area\third associated activity area to obtain the corresponding predicted trajectory.

[0175] In this embodiment, the location distribution degree of each activity area within the corresponding time period is determined based on location distribution data, and the location distribution degree is correlated with the spatial location of the activity area to form a pet activity heat map. Then, the direction and distance of location change between the candidate activity area and the associated activity area are determined by combining historical trajectory data, so that the expansion of the predicted trajectory is constrained by both the historical location distribution and historical movement path of the pet. By continuing to use the expanded associated activity area as the starting point of the trajectory expansion, and controlling the continuous expansion process according to the preset trajectory expansion conditions, the obtained predicted trajectory is continuously composed of activity areas with historical location distribution characteristics and location change relationships with historical movement relationships.

[0176] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0177] In one embodiment, a deviation and region intelligent inference system based on pet spatiotemporal behavior is provided, which corresponds one-to-one with the deviation and region intelligent inference system based on pet spatiotemporal behavior in the above embodiment. Figure 9As shown, this intelligent deviance and regional inference system based on pet spatiotemporal behavior includes a data acquisition module, a risk analysis module, a region determination module, a distribution statistics module, a trajectory construction module, and a region expansion module. Detailed descriptions of each functional module are as follows: The data acquisition module is used to acquire the pet's real-time activity status and real-time location at the current moment through the smart pet collar, determine the reference spatiotemporal behavior features that match the current moment from the preset historical spatiotemporal behavior features, and compare the real-time activity status and real-time location with the reference spatiotemporal behavior features to determine the deviation result of the current spatiotemporal behavior.

[0178] The risk analysis module is used to continuously acquire multiple current spatiotemporal behavior deviation results to determine the degree of deviation of the current spatiotemporal behavior from historical spatiotemporal behavior characteristics, and to determine the risk of the pet getting lost based on the degree of deviation and the current spatiotemporal behavior deviation results.

[0179] The area determination module is used to determine candidate activity areas that match the current pet's behavior when the risk of getting lost meets the preset trajectory prediction conditions, based on the pet's real-time location, real-time activity status, and historical spatiotemporal behavioral characteristics at the current moment.

[0180] The distribution statistics module is used to organize historical spatiotemporal behavioral characteristics into trajectory points according to the collection time, and to perform location distribution statistics according to spatial regions, so as to obtain a set of historical trajectory points and location distribution data.

[0181] The trajectory construction module is used to determine the positional change relationship between each trajectory point based on the acquisition time corresponding to each trajectory point in the historical trajectory point set, and to connect each trajectory point according to the positional change relationship to obtain the historical trajectory.

[0182] The region expansion module is used to determine the degree of location distribution corresponding to different activity areas based on location distribution data, obtain a pet activity heatmap, and continuously expand the candidate activity areas using the pet activity heatmap and historical trajectories to obtain the corresponding predicted trajectories.

[0183] It should be noted that the information interaction and execution process between the above systems / modules are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.

[0184] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0185] This application also provides a computer device, such as... Figure 10 As shown, the computer device includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor. When the processor executes the computer program, it implements the steps in any of the above method embodiments, or when the processor executes the computer program, it implements the functions of each module / unit in the above system embodiments.

[0186] For example, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete this application. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the computer device.

[0187] Those skilled in the art will understand that Figure 10 The computer device described is merely an example and does not constitute a limitation on the computer device. It may include more or fewer components than shown, or combine certain components, or different components. For example, the computer device may also include input / output devices, network access devices, buses, etc.

[0188] The aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0189] The memory can be an internal storage unit of the computer device, such as a hard drive or RAM. The memory can also be an external storage device of the computer device, such as a plug-in hard drive, SmartMediaCard (SMC), SecureDigital (SD) card, or FlashCard. Furthermore, the memory can include both internal and external storage units of the computer device.

[0190] This application also provides a readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.

[0191] This application provides a computer program product that, when run on an electronic device, enables the electronic device to perform the steps described in the various method embodiments above.

[0192] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographic device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0193] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0194] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0195] In the embodiments provided in this application, it should be understood that the disclosed systems / devices and methods can be implemented in other ways. For example, the system / device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between systems or units may be electrical, mechanical, or other forms.

[0196] The units described as separate components may or may not be physically separate. 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 units can be selected to achieve the purpose of this embodiment according to actual needs.

[0197] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A deviation and region intelligent inference method based on pet spatiotemporal behavior, characterized in that, include: The system obtains the pet's real-time activity status and location at the current moment through a smart pet collar, determines the reference spatiotemporal behavior features that match the current moment from preset historical spatiotemporal behavior features, and compares the real-time activity status and the real-time location with the reference spatiotemporal behavior features to determine the deviation result of the current spatiotemporal behavior. Multiple current spatiotemporal behavior deviation results are continuously acquired to determine the degree of deviation of the current spatiotemporal behavior relative to the historical spatiotemporal behavior characteristics, and the risk of the pet getting lost is determined based on the degree of deviation and the current spatiotemporal behavior deviation results; When the risk of getting lost meets the preset trajectory prediction conditions, a candidate activity area matching the current pet's behavior is determined based on the real-time location, real-time activity status, and historical spatiotemporal behavior characteristics at the current moment. The historical spatiotemporal behavioral characteristics are organized into trajectory points according to the collection time, and the location distribution is statistically analyzed according to spatial regions to obtain a set of historical trajectory points and location distribution data. The positional change relationship between each trajectory point is determined based on the collection time corresponding to each trajectory point in the historical trajectory point set, and the trajectory points are connected according to the positional change relationship to obtain the historical trajectory; Based on the location distribution data, the degree of location distribution corresponding to different activity areas is determined to obtain a pet activity heatmap. The candidate activity areas are then continuously expanded using the pet activity heatmap and the historical trajectory to obtain the corresponding predicted trajectory.

2. The method as described in claim 1, characterized in that, The steps of acquiring the pet's real-time activity status and location through a smart pet collar, determining reference spatiotemporal behavior features matching the current moment from preset historical spatiotemporal behavior features, and comparing the real-time activity status and location with the reference spatiotemporal behavior features to determine the deviation of the current spatiotemporal behavior from the result include: The smart pet collar acquires the pet's real-time activity status and location at the current moment, determines the current time period based on the time information corresponding to the current moment, and filters the historical activity status data and historical location data corresponding to the current time period from the historical spatiotemporal behavior features. The reference activity state corresponding to the current time period is determined according to the frequency of occurrence of the activity state in the historical activity state data, and the reference activity area corresponding to the current time period is determined according to the spatial distribution of the location in the historical location data. The reference activity state and the reference activity area are associated as reference spatiotemporal behavior features. The real-time activity state is compared with the reference activity state in the reference spatiotemporal behavior features to obtain a state consistency comparison result. The real-time location is compared with the reference activity region in the reference spatiotemporal behavior features to obtain a location consistency comparison result. The corresponding behavioral deviation component is determined based on the state consistency comparison result and the position consistency comparison result, and the current spatiotemporal behavioral deviation result is determined based on the behavioral deviation component.

3. The method as described in claim 2, characterized in that, The step of determining the current spatiotemporal behavior deviation result based on the behavior deviation component includes: When the real-time activity state is inconsistent with the reference activity state and the real-time location is outside the reference activity area, the behavior deviation component is determined as the first deviation level; When only the real-time activity state is inconsistent with the reference activity state or only the real-time location is outside the reference activity area, the behavior deviation component is determined as the second deviation level; When the real-time activity state is consistent with the reference activity state and the real-time position is within the reference activity area, the behavior deviation component is determined as the third deviation level; The first deviation level, the second deviation level, or the third deviation level is taken as the current spatiotemporal behavior deviation result.

4. The method as described in claim 2, characterized in that, The step of continuously acquiring multiple current spatiotemporal behavior deviation results to determine the degree of deviation of the current spatiotemporal behavior relative to the historical spatiotemporal behavior characteristics, and determining the risk of the pet getting lost based on the degree of deviation and the current spatiotemporal behavior deviation results, includes: Multiple current spatiotemporal behavior deviation results are continuously acquired at preset time intervals, and the multiple consecutively acquired current spatiotemporal behavior deviation results are sorted according to the corresponding acquisition time to obtain a deviation result sequence; The number of consecutive deviations of the current spatiotemporal behavior deviation result is determined based on the continuity between adjacent current spatiotemporal behavior deviation results in the deviation result sequence, and the degree of deviation duration is determined based on the number of consecutive deviations. The deviation level change is determined based on the deviation level corresponding to each current spatiotemporal behavior deviation result in the deviation result sequence. The missing risk level is determined by the degree of deviation and the deviation level change. The missing risk level is then used to determine the pet's missing risk.

5. The method as described in claim 4, characterized in that, The step of determining the risk of a pet getting lost based on the aforementioned risk level includes: When the degree of deviation increases and the change in the deviation level indicates that the current spatiotemporal behavior continues to deviate from the reference spatiotemporal behavior characteristics, the level of risk of getting lost is increased. When the degree of deviation decreases and the current spatiotemporal behavior deviation result returns from a deviated state to a consistent state, the level of the risk of getting lost is reduced; The risk of a pet getting lost is determined based on whether the risk level has been increased or decreased at the current moment.

6. The method as described in claim 1, characterized in that, The step of determining candidate activity areas matching the current pet's behavior based on the real-time location, real-time activity status, and historical spatiotemporal behavioral characteristics when the risk of getting lost meets preset trajectory prediction conditions includes: When the risk of getting lost meets the preset trajectory prediction conditions, the historical activity areas that match the current time conditions are selected from the historical spatiotemporal behavior features according to the time information corresponding to the current time, and the activity areas that match the real-time activity status are selected from the historical activity areas according to the real-time activity status, so as to obtain a candidate area set. The location distance between each active region in the candidate region set and the real-time location is determined based on the real-time location, and the active regions in the candidate region set are sorted according to the location distance to obtain the sorted active regions. Based on the historical activity status, historical location, and historical location change relationship of each sorted activity area, the degree of behavioral matching between each activity area and the current pet behavior is determined, and candidate activity areas are determined from the candidate area set based on the degree of behavioral matching.

7. The method as described in claim 1, characterized in that, The steps of organizing the historical spatiotemporal behavioral features into trajectory points according to the collection time and statistically analyzing their location distribution according to spatial regions to obtain a set of historical trajectory points and location distribution data include: Extract historical location data and corresponding collection time from the historical spatiotemporal behavior features, sort the historical location data according to the order of collection time, and associate the sorted historical location data and corresponding collection time to form historical trajectory points. The historical trajectory points are divided into preset time periods according to the collection time corresponding to the historical trajectory points, and the historical trajectory points located in the same time period are classified according to preset spatial regions to obtain a set of historical trajectory points. The number of historical trajectory points in each preset spatial area is counted, and the location distribution data of each preset spatial area is determined based on the correlation between the number of historical trajectory points in each preset spatial area and the corresponding time period.

8. The method as described in claim 1, characterized in that, The step of determining the positional change relationship between trajectory points based on the acquisition time corresponding to each trajectory point in the historical trajectory point set, and connecting the trajectory points according to the positional change relationship to obtain the historical trajectory, includes: The adjacent historical trajectory points are determined according to the collection time corresponding to each historical trajectory point in the set of historical trajectory points, and the historical positions corresponding to each adjacent historical trajectory point are obtained respectively. The direction and distance of position change between adjacent historical trajectory points are determined based on their historical positions, and the position change relationship between adjacent historical trajectory points is determined based on the direction and distance of position change. According to the collection time corresponding to the historical trajectory point, connect adjacent historical trajectory points with the position change relationship in sequence, and associate the position change relationship corresponding to the continuously connected historical trajectory points to obtain the historical trajectory.

9. The method as described in claim 6, characterized in that, The steps of determining the degree of location distribution corresponding to different activity areas based on the location distribution data to obtain a pet activity heatmap, and continuously expanding the candidate activity areas using the pet activity heatmap and the historical trajectory to obtain the corresponding predicted trajectory, include: The historical location percentage of each activity area within the corresponding time period is determined based on the location distribution data corresponding to each activity area, and the location distribution degree of each activity area is determined based on the historical location percentage. By associating the corresponding activity areas according to their location distribution, a heat map of pet activity is obtained. Based on the degree of positional distribution of the candidate activity areas in the pet activity heatmap, the associated activity areas corresponding to the candidate activity areas are determined, and the direction and distance of positional change between the candidate activity areas and the associated activity areas are determined by the historical trajectory. The trajectory is extended from the candidate activity region to the associated activity region according to the direction and distance of the position change. The extended activity regions are then connected according to their corresponding position change relationships to obtain the predicted trajectory.

10. A deviation and region intelligent inference system based on pet spatiotemporal behavior, characterized in that, include: The data acquisition module is used to acquire the real-time activity status and real-time location of the pet at the current moment through the smart pet collar, determine the reference spatiotemporal behavior features that match the current moment from the preset historical spatiotemporal behavior features, and compare the real-time activity status and the real-time location with the reference spatiotemporal behavior features to determine the current spatiotemporal behavior deviation result. The risk analysis module is used to continuously acquire multiple current spatiotemporal behavior deviation results to determine the degree of deviation of the current spatiotemporal behavior relative to the historical spatiotemporal behavior characteristics, and to determine the risk of the pet getting lost based on the degree of deviation and the current spatiotemporal behavior deviation results. The area determination module is used to determine a candidate activity area that matches the current pet's behavior based on the real-time location, real-time activity status, and historical spatiotemporal behavior characteristics when the risk of getting lost meets the preset trajectory prediction conditions. The distribution statistics module is used to organize the historical spatiotemporal behavioral features into trajectory points according to the collection time, and to perform location distribution statistics according to spatial regions, so as to obtain a set of historical trajectory points and location distribution data. The trajectory construction module is used to determine the positional change relationship between each trajectory point based on the acquisition time corresponding to each trajectory point in the historical trajectory point set, and to connect each trajectory point according to the positional change relationship to obtain the historical trajectory; The region expansion module is used to determine the degree of location distribution corresponding to different activity areas based on the location distribution data, obtain a pet activity heatmap, and continuously expand the candidate activity areas using the pet activity heatmap and the historical trajectory to obtain the corresponding predicted trajectory.

11. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the deviation and region intelligent inference method based on pet spatiotemporal behavior as described in any one of claims 1 to 9.

12. A readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the deviation and region intelligent inference method based on pet spatiotemporal behavior as described in any one of claims 1 to 9.

13. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, enables the implementation of the steps of the deviation and region intelligent inference method based on pet spatiotemporal behavior as described in any one of claims 1 to 9.