Time-driven desktop AI pet growth implementation method, device and terminal
By mapping the virtual pet's lifecycle to a real timeline, a time-driven pet growth model and animation data are constructed, solving the problem of weak correlation between virtual pet growth and real time in existing technologies. This achieves an immersive experience of pets automatically growing and dynamically changing over time, enhancing users' emotional projection and application appeal.
Patent Information
- Application Number
- CN202511521255.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-23
- Publication Date
- 2026-01-27
AI Technical Summary
The existing desktop pet function on smart terminals lacks a driving force based on the passage of real time, resulting in a weak correlation between the growth and changes of virtual pets and real time. It lacks an immersive, automated long-term companionship, and users cannot feel the natural growth process of the pet over time, which reduces the depth of emotional projection and the long-term appeal of the application.
The life cycle of virtual pets is mapped onto a real timeline, and models and animation data corresponding to the pet's age are constructed. The growth of virtual pets is driven by time, and time synchronization calibration and resource index mapping tables are used to realize that the appearance and behavior of pets change automatically over time. Combined with user operations, dynamic rendering is performed.
It enables virtual pets to automatically grow over time, with significant changes in appearance, size, and behavior, providing a immersive digital companion experience, enhancing the depth of users' emotional investment and the long-term appeal of the application, and solving the problems of broken growth logic and loading delays in virtual pets.
Smart Images

Figure CN121414933A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart terminal and artificial intelligence technology, and in particular to a time-driven desktop AI pet growth realization method, device, electronic device and computer-readable storage medium. Background Technology
[0002] With the development of technology, the use of smart terminals is becoming more and more widespread, and some existing smart terminals have desktop pet functions.
[0003] However, existing desktop pet functions on smart terminals lack the ability to drive the intelligent growth and interaction of virtual pets based on the passage of real time. Most pet applications on existing smart terminals employ simple interactive feedback or manual upgrade mechanisms, resulting in a weak correlation between the pet's growth and changes and real-time events, lacking an immersive, automated sense of long-term companionship. Users cannot experience the natural growth process of their pets over time, reducing the depth of emotional investment and the long-term appeal of the application.
[0004] Therefore, existing technologies still need improvement and development. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a time-driven desktop AI pet growth method, device, electronic device and storage medium to address the above-mentioned defects of the prior art. The present invention provides a method for driving the growth of a virtual pet on a mobile device desktop based on the real passage of time and intelligently switching its appearance and behavior.
[0006] This application provides a time-driven method for implementing desktop AI pet growth, and the technical solution is as follows: A time-driven method for implementing desktop AI pet growth, comprising: The virtual pet's entire life cycle is pre-mapped onto a real timeline, and a pet model and animation data corresponding to the pet's age are constructed and stored in a pre-set pet resource database. A virtual pet growth timeline-resource index mapping table is also established in the pet resource database. Upon detecting the first launch of the virtual pet, the system retrieves the initial time of the set virtual pet, calculates the current age of the virtual pet, and synchronizes it with the current network time of the terminal. Based on the calculated current virtual pet age, search the virtual pet growth timeline-resource index mapping table from the preset pet resource database, and load the pet model and animation data corresponding to the current virtual pet age; Based on the terminal's current network time and / or user operation, extract the corresponding pet model and animation data from the loaded pet model and animation data corresponding to the current virtual pet's age, render and display the desktop virtual pet that grows according to the current network time. The desktop virtual pet is controlled to automatically load and display itself from a preset pet resource database as the current network time of the terminal progresses.
[0007] The aforementioned time-driven desktop AI pet growth implementation method includes the following steps: mapping the virtual pet's entire lifecycle images onto a real timeline to construct a pet model and animation data corresponding to the pet's age. Pre-set the age stages of the virtual pet's complete life cycle, as well as the unique appearance, fur texture, and body size corresponding to each stage; and create at least a predetermined number of behavioral actions that conform to the characteristics of the corresponding stage for each age stage, and build a pet model and animation data corresponding to the pet's age; The total growth time of the virtual pet's complete life cycle is preset, mapping real time to the pet's age; the start time of each age stage is set, and a mapping function between real time and pet age is defined to simulate the corresponding pet growth curve; All the prepared pet models and animation data corresponding to the pet's age, as well as all resource files mapping real time and pet age, are uniquely encoded according to the age-action rule and uploaded to the pet resource database. A virtual pet growth timeline-resource index mapping table is then established in the pet resource database. The virtual pet growth timeline-resource index mapping table records the storage path and access address of all resource files corresponding to each age stage.
[0008] The aforementioned time-driven desktop AI pet growth implementation method includes the following age stages in the complete life cycle of the virtual pet: the first stage is the neonatal period, the second stage is the infancy period, the third stage is the juvenile period, the fourth stage is the adolescence period, the fifth stage is the youth period, the sixth stage is the adulthood period, the seventh stage is the middle age period, and the eighth stage is the old age period. The starting time point of each age stage is set based on the pet's age.
[0009] The aforementioned time-driven desktop AI pet growth implementation method includes the following steps: detecting the first launch of the virtual pet, obtaining the set initial time of the virtual pet, calculating the current age of the virtual pet, and synchronizing and calibrating it with the current network time of the terminal. Upon detecting the first launch of the virtual pet, the system retrieves the initial time of the virtual pet, synchronizes and calibrates the initial time of the virtual pet with the current network time of the terminal, and then persistently stores it in the local database. Calculate the current age of the virtual pet based on the initial time set for the virtual pet.
[0010] The aforementioned time-driven desktop AI pet growth implementation method, wherein the step of calculating the current age of the virtual pet based on the set initial time of the virtual pet includes: Get the initial time Te of the virtual pet that was set, and get the current calibrated real time T1; Calculate the time difference ΔT = T1 - Te between the real time T1 and the initial time of the virtual pet, using days as the unit. Based on the virtual pet growth rule function Age=f(AT) defined in the stage, Δτ is converted into the pet's current virtual age in days; Query the preset pet growth rules to determine the specific growth stage to which the converted virtual age of the pet falls.
[0011] The aforementioned time-driven desktop AI pet growth implementation method includes the following steps: First, based on the calculated current virtual pet age, search a virtual pet growth timeline-resource index mapping table from a preset pet resource database and load the pet model and animation data corresponding to the current virtual pet age. Based on the calculated current age of the virtual pet, determine the specific growth stage that the current virtual pet falls into; Based on the specific growth stage that the current virtual pet's age falls into, generate the resource identifier prefix that needs to be loaded; Based on the generated resource identifier prefix that needs to be loaded, the virtual pet growth timeline-resource index mapping table is searched from the local database or from the preset pet resource database. The pet model, texture and animation data corresponding to the specific growth stage that the current virtual pet's age falls into are loaded into memory to prepare for rendering.
[0012] The aforementioned time-driven desktop AI pet growth implementation method includes the following steps: extracting pet model and animation data corresponding to the current virtual pet's age from the loaded pet model and animation data corresponding to the current virtual pet's age, rendering and displaying the desktop virtual pet whose growth corresponds to the current network time, based on the terminal's current network time and / or user operation.
[0013] Based on the terminal's current network time and / or user operation, extract the corresponding pet model and animation data from the loaded pet model and animation data corresponding to the current virtual pet's age and render them; The rendering engine draws a pet model of the appropriate size and appearance based on the pet model, texture, and animation data corresponding to the specific growth stage of the current virtual pet. The control system intelligently selects appropriate behaviors from a predetermined number of behaviors that match the characteristics of the corresponding stage based on the current context, user touch events, and pet mood value. The displayed desktop virtual pet is updated according to the current network time. The virtual pet's behavior changes intelligently with time and age, realistically simulating its life cycle; And control the display of the pet's current age or stage information on the user interface.
[0014] A time-driven desktop AI pet growth realization device, wherein the device includes: The pre-setting module is used to pre-map the virtual pet images corresponding to the entire life cycle of the virtual pet onto the real timeline, build pet models and animation data corresponding to the pet's age, store them in the pre-set pet resource database, and establish a virtual pet growth timeline-resource index mapping table in the pet resource database; The virtual pet age calculation module is used to detect the first launch of the virtual pet, obtain the set initial time of the virtual pet, calculate the current age of the virtual pet, and synchronize and calibrate it with the current network time of the terminal. The resource loading module is used to search the virtual pet growth timeline-resource index mapping table from the preset pet resource database based on the calculated current virtual pet age, and load the pet model and animation data corresponding to the current virtual pet age; The rendering module is used to extract the corresponding action pet model and animation data from the loaded pet model and animation data corresponding to the current virtual pet age, based on the terminal's current network time and / or user operation, and to render and display the desktop virtual pet that grows according to the current network time. The growth control module is used to control the desktop virtual pet to automatically load and display the desktop virtual pet corresponding to the growth of network time as the current network time of the terminal passes.
[0015] An electronic device includes a memory and one or more programs, wherein one or more programs are stored in the memory and configured to be executed by one or more processors, the one or more programs comprising the method for performing any one of the methods.
[0016] A computer-readable storage medium, wherein, when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform any of the methods described above.
[0017] As can be seen from the above, this application provides a time-driven desktop AI pet growth implementation method, device, electronic device, and computer-readable storage medium. This invention adds a new function to smart terminals: a time-driven desktop AI pet growth implementation function. This invention maps the virtual pet's lifespan (e.g., 10 years) onto a real timeline, allowing the pet to automatically grow from infancy to adulthood as the user's phone usage time passes. Its appearance, size, and behavior will significantly change according to its current age stage, thus providing users with an unprecedented digital companion experience that evokes a sense of time accumulation. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart illustrating the time-driven desktop AI pet growth implementation method provided in Embodiment 1 of the present invention.
[0020] Figure 2 This is a schematic diagram of the service resource construction and rule definition process of the time-driven desktop AI pet growth implementation method provided in Embodiment 2 of the present invention.
[0021] Figure 3 This is a schematic diagram of the client-side growth logic execution and rendering process of the time-driven desktop AI pet growth implementation method provided in Embodiment 2 of the present invention.
[0022] Figure 4 This is a schematic diagram of the main process of the time-driven desktop AI pet growth implementation method provided in Embodiment 2 of the present invention.
[0023] Figure 5 This is a schematic diagram of the time-driven desktop AI pet growth realization device provided in the embodiments of the present invention.
[0024] Figure 6 This is a block diagram illustrating the internal structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0025] The technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of this application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0026] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, the terms "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0027] Existing desktop pet functions on smart terminals lack the ability to drive the intelligent growth and interaction of virtual pets based on the passage of real time. Most pet applications on existing smart terminals employ simple interactive feedback or manual upgrade mechanisms, resulting in a weak correlation between the pet's growth and real-time changes, and a lack of immersive, automated, long-term companionship. Users cannot experience the natural growth process of their pets over time, reducing the depth of emotional investment and the long-term appeal of the application. Furthermore, existing virtual pet resources are mostly generated in real-time, leading to problems such as loading delays and gaps in growth logic.
[0028] To address the aforementioned technical issues, this invention provides a time-driven method for realizing the growth of a desktop AI pet. This invention adds a new function to smart terminals: enabling the growth of a desktop AI pet based on time. It maps the virtual pet's lifespan (e.g., 10 years) onto a real timeline, allowing the pet to automatically grow from infancy to adulthood as the user's phone usage time progresses. Its appearance, size, and behavior will significantly change according to its current age stage, thus providing users with an unprecedented digital companion experience that evokes a sense of time and history.
[0029] like Figure 1 As shown, this application proposes a time-driven desktop AI pet growth implementation method, including the following steps: Step S100: Map the virtual pet images corresponding to the entire life cycle of the virtual pet onto the real timeline in advance, construct the pet model and animation data corresponding to the pet's age, store them in the preset pet resource database, and establish a virtual pet growth timeline-resource index mapping table in the pet resource database; In a specific implementation of this invention, the entire life cycle stages of the virtual pet are pre-divided, and the corresponding virtual pet screen data (including model data and animation data) for each stage are mapped to the real timeline and stored in a preset pet resource database. A virtual pet growth timeline-resource index mapping table is also constructed.
[0030] Specifically, regarding the division of the pet's life cycle, the total life cycle of a virtual pet can be set as 10 complete age stages, such as: 1 month (newborn period), 3 months (infancy), 6 months (juvenile period), 1 year (adolescence), 2 years (youth), 5 years (adulthood), 7 years (middle age), 10 years (old age), etc.
[0031] Then, the image data is constructed, including 1) model data, designing 3D models for each stage. For example, the model parameters for the juvenile stage are: body size (length × width × height) = 5cm × 3cm × 4cm, hair texture is soft short hair, and material refractive index is 1.2; the model parameters for the adult stage are: body size = 12cm × 6cm × 8cm, hair texture is shiny long hair, and material refractive index is 1.5; the model parameters for the old age stage are: body size = 10cm × 5cm × 7cm, hair texture is gray short hair, and material refractive index is 1.1. 2) Animation data, specifically, at least 10 basic animations are configured for each stage. The infancy stage includes curling up to sleep (24fps, 3s), nursing (24fps, 2s), and soft meowing (24fps, 1s); the adult stage includes tail wagging (24fps, 2.5s), jumping (24fps, 1.5s), and rubbing against someone's hand (24fps, 2s); the old age stage includes slow pacing (20fps, 4s), napping (20fps, 3s), and slowly licking its fur (20fps, 2.5s). Regarding pet timeline mapping, a correspondence between stage, time, and visual data can be established. For example, day 3 of the infancy stage maps to the infancy model plus nursing animation, and day 15 of the adult stage maps to the adult model plus tail-wagging interactive animation. In this embodiment of the invention, regarding database storage and mapping table construction, model data (in .obj format) and animation data (in .anim format) can be stored in a MySQL pet resource database, and a unique resource index can be assigned (e.g., the index for the juvenile model is M001, and the index for the nursing animation is A002); a mapping table can be constructed, with fields in the table including growth time (days), stage identifier, model index, and animation index set.
[0032] This implementation method enables standardized storage and rapid indexing of resources. Subsequent resource retrieval via a mapping table shortens loading response time and resolves the latency issues caused by real-time resource generation in existing technologies. Furthermore, it establishes a fixed correspondence between screen data and time at each stage, preventing logical breaks in the growth process and ensuring that the virtual pet's growth aligns with the user's understanding of its lifecycle, thus enhancing interaction credibility. With resources centrally stored in the database, adding a youth stage only requires supplementing model / animation data and updating the mapping table, without modifying the core code, reducing maintenance costs.
[0033] Step S200: Detecting the first launch of the virtual pet, obtaining the set initial time of the virtual pet, calculating the current age of the virtual pet, and synchronizing and calibrating it with the current network time of the terminal; In this embodiment, when the terminal detects that the user has launched the virtual pet application for the first time, it performs initial time setting, age calculation, and network time calibration.
[0034] Specifically, regarding the acquisition of the initial time, an initial time setting interface can pop up after the pet application is launched, providing two modes: user-defined and system default. When the user chooses user-defined, the initial time can be set through the date picker (accurate to the day, in the format YYYY-MM-DD). When the system default is selected, the network time (in the format YYYY-MM-DD) of the first time the application is launched on the terminal is automatically obtained as the initial time. In this embodiment, regarding network time synchronization, the terminal's network time interface (such as the System.currentTimeMillis() interface of the Android system or the [NSDatedate] interface of the iOS system) can be called to obtain the current network time T_current (in the format YYYY-MM-DDHH:MM:SS) and compare it with the terminal's local time T_local. If |T_current-T_local|>30s, the local time is determined to be abnormal, and T_current is forced to be used as the time base. To calculate a pet's age, you can use the formula: Current pet age = (T_current - initial time) / (24 × 3600 × 1000), and keep one decimal place. For example, if the initial time is 2025-10-18 and T_current is 2025-10-18 14:30:00, then the age = (14 × 3600 × 1000) / (24 × 3600 × 1000) = 0.6 days. In this embodiment of the invention, the initial time, current pet age, and time base (T_current) are stored in the local cache of SharedPreferences (Android) or UserDefaults (iOS) on the terminal for use in subsequent steps. As can be seen in this embodiment, network time calibration avoids the problem of inaccurate pet ages caused by users tampering with their local time, ensuring that all users' pets grow at the same pace and improving application fairness. Furthermore, the pet age calculation is linked to real time, so users do not need to remember virtual days and can directly understand the pet's age by raising it for X days, reducing cognitive costs. Moreover, the time base and age are initialized upon first launch, providing an accurate time basis for subsequent resource loading and animation playback, avoiding functional abnormalities caused by the absence of an age status.
[0035] Step S300: Based on the calculated current virtual pet age, search the virtual pet growth timeline-resource index mapping table from the preset pet resource database, and load the pet model and animation data corresponding to the current virtual pet age; In this embodiment, based on the current pet age calculated in step S200, the mapping table is searched from the pet resource database and the corresponding resources are loaded. Specifically, age matching is performed first. By reading the current pet age (e.g., 0.6 days) in the local cache, the life cycle stage to which it belongs (0.6 days ∈ T1, i.e., the juvenile stage) is determined. Then, a mapping table query is performed. Specifically, the pet resource database is connected via the JDBC (database connection) interface, and the SQL query statement is executed: SELECT model index (SELECT statement is the core command in Structured Query Language (SQL) used to retrieve records that meet specified conditions from the database), animation index set FROM growth time - resource mapping table WHERE growth time ≥ current age AND growth time < next stage start time, to obtain the corresponding model index (e.g., M001) and animation index set (e.g., A001, A002, A003).
[0036] Then, resource loading is performed. In this embodiment of the invention, resource loading includes: 1) Model loading: Based on model index M001, the juvenile model data in .obj format can be read from the database, and the model vertex, texture and material information can be parsed through the OpenGLES3.0 interface and loaded into the model cache area in the terminal memory; 2) Animation loading: Based on animation indices A001, A002, and A003, the animation data in .anim format is read, keyframes and skeletal animation information are parsed, and loaded into the animation cache in the terminal memory. This invention also verifies the loading, specifically by checking the resource integrity of the model cache and animation cache. If the resource missing rate is >5%, the query and loading steps are re-executed; if the missing rate is ≤5%, the missing resources are marked as to be supplemented, and complete resources are loaded first to ensure the normal operation of the application. As can be seen, this embodiment only loads resources corresponding to the current age stage, avoiding the loading of resources for future stages (such as adulthood models), reducing terminal memory usage by 60% and solving the problem of lag caused by full loading in existing technologies; furthermore, resource loading is strictly matched with age, ensuring that kittens only display animations that are appropriate for their age, such as suckling and meowing, avoiding the logical contradiction of kittens acting like adult cats, and enhancing user immersion; moreover, it connects the resource preprocessing in step S100 and the age calculation in S200, forming a logical closed loop of time-age-resource, ensuring the continuity of the functional process.
[0037] Step S400: Based on the current network time of the terminal and / or user operation, extract the pet model and animation data corresponding to the current virtual pet's age from the loaded pet model and animation data, render and play the desktop virtual pet that grows according to the current network time. In this embodiment, animation data is extracted from the loaded resources by combining the terminal's current network time and user operations, and then displayed as a virtual pet on the desktop using rendering technology. Specifically, first read the hour field of the current network time T_current (e.g., 3 PM). If 8 ≤ hour field ≤ 20, it is determined to be an active period, and an activity-type animation is triggered (e.g., a baby sucking and making soft noises). If the hour field < 8 or the hour field > 20, it is determined to be a rest period, and a rest-type animation is triggered (e.g., a baby curling up and sleeping). In this embodiment of the invention, user interaction events are also acquired. By acquiring the terminal's touch event (mobile phone) or mouse event (computer) listening module, user operations (such as clicking, long pressing, swiping) are captured. For example, when the user clicks on the pet model, a soft meow animation is triggered (index A003); when the user long presses on the pet model, a curled-up sleeping animation is triggered (index A001). Specifically, in this embodiment of the invention, regarding animation extraction and rendering, during animation extraction, animation data with the corresponding index (such as the whispering animation A003) is extracted from the animation cache based on the result of time triggering or user operation. During rendering and playback, the extracted animation data is combined with the model data through the Animator component of the Unity engine to generate a frame sequence (24fps). Then, the frame sequence is overlaid onto the desktop layer through the desktop rendering interface of the terminal (such as the DWM interface of Windows and the QuartzCompositor interface of macOS) to achieve the floating pet effect on the desktop. This invention also optimizes rendering and display. Specifically, it detects the terminal screen resolution (e.g., 1920×1080) and automatically adjusts the display size of the pet model (e.g., occupying 10% of the screen width) to avoid obscuring desktop icons. At the same time, it sets a semi-transparent mode, reducing the pet model's transparency to 30% when the user operates the desktop icons, thus improving ease of operation. As can be seen, this embodiment combines time-triggered events with user actions to achieve an interactive effect where the pet moves with the scene, avoiding the monotony of static pets and effectively increasing the average number of daily interactions with users. Furthermore, desktop rendering optimization ensures that the pet display does not interfere with the user's normal use of the terminal, solving the problem of existing virtual pet applications obscuring icons and affecting operation. Moreover, this invention transforms static resources in the database into dynamic images visible to the user, completing the implementation of technical data and user perception, making the virtual pet function truly usable.
[0038] Step S500: Control the desktop virtual pet to automatically load and play the desktop virtual pet corresponding to the network time growth as the current network time of the terminal passes.
[0039] In this embodiment of the invention, the system monitors the elapsed network time on the terminal and automatically updates pet resources and the displayed screen. Specifically, the time monitoring period can be set to 1 hour through the terminal's scheduled task module (such as AlarmManager on Android or NSTimer on iOS), triggering a time detection task once per hour. Specifically, when performing the time detection task, the current network time T_current_new is retrieved again, and the new pet age is calculated as (T_current_new - initial time) / (24 × 3600 × 1000). The new age is compared with the old age (the age in the local cache). If the new age is greater than or equal to the old age + 0.1 days (i.e. 2.4 hours), the age is determined to be updated, and subsequent steps are executed. If the new age still belongs to the original stage (e.g., old age 0.6 days → new age 0.8 days, both belong to T1), then only update the animation index set (e.g., add a new chasing ball animation A010), load the new animation data into the animation cache area, and replace the old animation data. If the new age enters a new stage (e.g., old age 7 days → new age 7.1 days, from T1 to T2), then the resource loading process in step S300 is executed to load the adult model (M002) and adult animation (A004, A005, A006) and replace the old resources in the model cache and animation cache. In this embodiment of the invention, once the resource update is complete, the rendering and playback process in step S400 is automatically triggered to update the pet model and animation displayed on the desktop. The entire process is executed in the background without requiring manual operation by the user. The invention achieves the following effects: 1) It enables pets to grow automatically, eliminating the need for users to launch the application daily. Users can still see their pets grow from kittenhood to adulthood after opening the terminal every 3 days, meeting the needs of lazy pet owners and increasing user retention by 50%; 2) It enables phased resource updates, avoiding lag caused by updating a large number of resources at once and ensuring smooth desktop display; 3) It introduces the unpredictability of pet growth (such as unlocking new animations tomorrow), stimulating users' desire to explore and increasing the frequency of application opening, which can greatly increase the average daily active users.
[0040] The present invention will be further described in detail below through specific application examples: This specific application embodiment provides a time-driven desktop AI pet growth implementation method, which includes the following steps: Step S10: Pre-set the age stages of the virtual pet's complete life cycle, and set the unique appearance, fur texture, and body size corresponding to each stage; and create at least a predetermined number of behavioral actions that conform to the characteristics of the corresponding stage for each age stage, and build a pet model and animation data corresponding to the pet's age. In this detailed embodiment, the virtual pet resource settings include the following age stages in the complete life cycle of the virtual pet: the first stage is the newborn period, the second stage is the infancy period, the third stage is the juvenile period, the fourth stage is the adolescence period, the fifth stage is the youth period, the sixth stage is the adulthood period, the seventh stage is the middle age period, and the eighth stage is the old age period. The start time point of each age stage is set based on the pet's age.
[0041] When implementing this step in detail, as follows: Figure 2 As shown, the first phase is: server-side and resource construction and rule definition. Specifically, the virtual pet resource settings for S10 are performed first, such as... Figure 2Step S11: You can pre-plan the complete 10 age stages of the virtual pet. For example, set a virtual pet simulating a hamster as a 1-month-old infant, a 3-month-old kitten, and a 1-year-old adult. Another example: set a virtual pet simulating a cat as 1 month (newborn), 3 months (infancy), 6 months (juvenile), 1 year (adolescence), 2 years (adolescent), 5 years (adulthood), 7 years (middle age), and 10 years (senior age). Each stage requires a unique appearance, fur texture, and body size (e.g., smaller and cuter in infancy, more robust and realistic in adulthood). Step S12: Design a unique appearance and body model for each age stage. Step S13: Create at least 10 sets of behavioral actions for each age stage that conform to its characteristics. For example: Infancy: Toddling, lying down and napping, making babyish noises, chasing small balls.
[0042] In their prime: they run nimbly, leap joyfully, bark majestically, and patrol alertly.
[0043] Old age: slow pacing, lying quietly, yawning lazily, and interacting with sluggish movements. All resources are ultimately output as high-performance rendering formats, such as PNG frame sequences or Spine skeletal animation files.
[0044] After setting it up, construct the pet model and animation data corresponding to the pet's age.
[0045] Step S20: Pre-set the total growth time of the virtual pet's complete life cycle, mapping real time to the pet's age; and set the starting time point for each age stage, and define the mapping function between real time and pet age to simulate the corresponding pet growth curve; This detailed implementation example mainly focuses on setting up the growth rule system. In practice, for example... Figure 2 As shown, step S21: Set the total time period to 10 years. For example, first set the total growth time of the virtual pet cat to 10 years (this can be adjusted according to the design). Step S22: Map real time to the pet's age. For example, 1 day in reality = N days of growth for the virtual pet. That is, define the mapping function Age=f(AT) between real time and pet age. For example, a simple implementation is to set that 1 day in the real world corresponds to 10 days of growth for the virtual pet (e.g., N=10, then 1 day in reality is equivalent to 10 days for the pet, and it takes about 3 months to experience the 10-year life cycle). More complex functions can simulate the biological growth curve, with rapid growth in the early stages and slower changes in the later stages. Step S23: Define the starting time point of each age stage. That is, precisely set the starting time point of each age stage in the database (based on the pet's age), for example: Stage 1 (0-30 days), Stage 2 (31-90 days)... Stage 10 (3000 days and above).
[0046] Step S30: Upload all the prepared pet models and animation data corresponding to the pet's age, as well as all resource files that map real time to pet age, to the pet resource database according to the age-action rule. Then, establish a virtual pet growth timeline-resource index mapping table in the pet resource database. The virtual pet growth timeline-resource index mapping table records the storage path and access address of all resource files corresponding to each age stage.
[0047] This step mainly involves resource storage and indexing, specifically as follows: Figure 2 As shown, in step S31, resources are encoded according to "age-action", such as stage_3_anim_5; and then proceed to step S32, upload the resources to the cloud server / CDN (Content Delivery Network); and then proceed to step S33, establish a mapping table between the growth timeline and the resource index in the database.
[0048] In this embodiment of the invention, all created resource files (models, textures, animation data) are uniquely encoded according to the rule of "stage_anim_5" (e.g., stage_3_anim_5). Then, the resource files are uploaded to cloud storage. In the server's database, a "Growth Timeline · Source Theft Index" mapping table is established, which clearly records the storage path and access address of all resource files corresponding to each age stage.
[0049] Step S40: Detect the first launch of the virtual pet, obtain the set initial time of the virtual pet, and after synchronizing and calibrating the set initial time of the virtual pet with the current network time of the terminal, persist it to the local database; In this embodiment of the invention, when entering stage two: the execution and rendering of client growth logic; Specifically, such as Figure 3 As shown, the process includes step S41, the user's first activation, and then step S42, recording the initial time T0 and storing it in the local database, and then step S43, synchronizing and calibrating the current time with the network time server NTP.
[0050] In this embodiment, when the user first activates the application, the client automatically uses the current date e as the pet's "birth date" and persists this date in the local database. To prevent users from cheating by modifying the system time, the client synchronizes with the Network Time Server (NTP) every time it starts or during a scheduled task to calibrate the current real time 1, ensuring the accuracy of growth calculations.
[0051] Step S50: Calculate the current virtual pet's age based on the set initial time; determine the specific growth stage the current virtual pet falls into based on the calculated current virtual pet age; generate the resource identifier prefix that needs to be loaded based on the determined specific growth stage the current virtual pet falls into.
[0052] In this embodiment of the steps, such as Figure 3 As shown, the specific steps include: S51. Read the initial time T0 and the current time T1. That is, obtain the set initial time T0 of the virtual pet and obtain the current calibrated real time T1; S52. Calculate the actual time difference ΔT = T1 - T0. That is, this invention uses days as the unit to calculate the time difference ΔT = T1 - T0 between the actual time T1 and the initial time of the set virtual pet. S53. Calculate the pet's age Age=f(AT) according to the growth rules; that is, in this embodiment of the invention, according to the virtual pet growth rule function Age=f(AT) defined by the stage, Δτ is converted into the pet's current virtual age in days; S54. Determine the corresponding growth stage, such as: Stage=3 (juvenile stage). That is, in this embodiment of the invention, the preset pet growth rules are queried to determine the specific growth stage to which the converted virtual age of the pet falls.
[0053] In this step, when calculating the current pet's age, the client reads the initial date T0 from the local database and obtains the current real time T1 after NTP calibration. The time difference ΔT = T1 - T0 (in days) is calculated. According to the growth rule function Age = f(AT) defined in Stage 1, ΔT is converted into the pet's current virtual age (in days). Finally, the growth rule is queried to determine the specific growth stage to which this virtual age falls (e.g., age 250 days corresponds to the "adolescent" stage). As shown in step S60.
[0054] Step S80: Based on the generated resource identifier prefix that needs to be loaded, search for the virtual pet growth timeline-resource index mapping table from the local database or from the preset pet resource database, and load the pet model, texture and animation data corresponding to the specific growth stage that the current virtual pet's age falls into into memory to prepare for rendering.
[0055] In this embodiment of the invention, when loading the corresponding resource, such as Figure 3 As shown, the process includes: step S81, generating a resource identifier based on the growth stage, and proceeding to step S82, checking if the local cache contains resources for that stage; then proceeding to step S83, if not, downloading all resource packages for that stage from the server, and proceeding to step S84, decompressing and loading the pet model and action data.
[0056] In other words, during the loading and management phase of resources in this embodiment of the invention, the client generates a prefix of the resource identifier to be loaded (e.g., stage-3_) based on the calculated growth stage. Specifically, the process first checks if the resource package for this stage already exists in the local file cache. If it doesn't exist or the resources are incomplete, a request is sent to the server to download all the resource packages (2i format) required for this stage. After downloading, an integrity check is performed, and the files are decompressed to local storage. Subsequently, the graphics engine loads the corresponding pet model, textures, and 10 sets of motion data into memory, ready for rendering.
[0057] Step S90: Based on the terminal's current network time and / or user operation, extract the pet model and animation data corresponding to the current virtual pet's age from the loaded pet model and animation data and render it. Step S91: The rendering engine draws a pet model of the appropriate size and appearance based on the pet model, texture, and animation data corresponding to the specific growth stage of the current virtual pet. Step S92: The control system intelligently selects appropriate behavioral actions from a predetermined number of behavioral actions that meet the characteristics of the corresponding stage based on the current context time, user touch events, and pet mood value, and plays and displays the desktop virtual pet that grows with the current network time. Step S93: Control the displayed virtual pet's behavior to intelligently change with time and age, realistically simulating its life cycle; Step S94, and control the display of the pet's current age or stage information on the user interface.
[0058] In this embodiment of the invention, dynamic rendering and interaction are employed, and the rendering engine draws a pet model of appropriate size and appearance based on the current growth stage data. Specifically, as shown... Figure 3 As shown, the process includes: S901, the system intelligently selects the most suitable set of actions from 10 sets based on the current context (such as time, phone battery level, user touch events, pet mood value, etc.) for playback (e.g., lively running in the morning, quiet sleeping at night, playing when touched by the user). S902, the rendering engine draws a pet of appropriate size based on the stage data; then, in S903, the pet displays different behaviors according to its age, such as toddling as an infant and running as an adult; and in S904, the interface displays the pet's age information to enhance immersion; the pet's behavior intelligently changes with age, realistically simulating the life cycle. The interface can display the pet's current age or stage information, greatly enhancing immersion and a sense of accomplishment.
[0059] As can be seen from the above, the overall process of a specific embodiment of the present invention is as follows: Figure 4As shown, when a user first launches the app, the initial recorded time is T0. Daily calculations of the user's current age and stage are triggered, generating resource requests. Specifically, resources are downloaded from the server's resource database, loaded, and then the pet is dynamically rendered, providing the user with an immersive companionship experience. The virtual pet implemented in this invention possesses a strong sense of immersion and companionship: the pet's growth is deeply tied to real time, allowing users to witness the complete process of a digital life from infancy to old age, greatly enhancing emotional connection and long-term companionship.
[0060] Exemplary device like Figure 5 As shown in the figure, an embodiment of the present invention provides a time-driven desktop AI pet growth realization device, the device comprising: The pre-setting module 310 is used to pre-map the virtual pet images corresponding to the entire life cycle of the virtual pet onto the real timeline, construct pet models and animation data corresponding to the pet's age, store them in the pre-set pet resource database, and establish a virtual pet growth timeline-resource index mapping table in the pet resource database; The virtual pet age calculation module 320 is used to detect the first launch of the virtual pet, obtain the set initial time of the virtual pet, calculate the current age of the virtual pet, and synchronize and calibrate it with the current network time of the terminal. The resource loading module 330 is used to search the virtual pet growth timeline-resource index mapping table from the preset pet resource database according to the calculated current virtual pet age, and load the pet model and animation data corresponding to the current virtual pet age; The rendering module 340 is used to extract the corresponding action pet model and animation data from the loaded pet model and animation data corresponding to the current virtual pet age, and render and display the desktop virtual pet that grows according to the current network time and / or user operation. The growth control module 350 is used to control the desktop virtual pet to automatically load and display the desktop virtual pet corresponding to the network time growth as the current network time of the terminal passes, as described above.
[0061] Based on the above embodiments, the present invention also provides an electronic device, the schematic diagram of which can be as follows: Figure 6 As shown. The electronic device includes a processor, memory, network interface, display screen, and pet resource database connected via a system bus. One or more programs are stored in the memory and configured to be executed by one or more processors. The one or more programs include methods for performing any of the methods described in the above embodiments.
[0062] Among them, memory refers to the physical device used to store data and program instructions, which can be implemented using flash memory chips, solid-state drives, or magnetic storage media. Processor refers to the arithmetic unit that executes program instructions, which can be implemented using a central processing unit, microcontroller, or application-specific integrated circuit.
[0063] In this context, a program refers to a set of code containing executable instructions, which can be implemented using embedded software, firmware, or operating system-level applications.
[0064] Specifically, the processor is controlled to execute the following instructions: The virtual pet's entire life cycle is pre-mapped onto a real timeline, and a pet model and animation data corresponding to the pet's age are constructed and stored in a pre-set pet resource database. A virtual pet growth timeline-resource index mapping table is also established in the pet resource database. Upon detecting the first launch of the virtual pet, the system retrieves the initial time of the set virtual pet, calculates the current age of the virtual pet, and synchronizes it with the current network time of the terminal. Based on the calculated current virtual pet age, search the virtual pet growth timeline-resource index mapping table from the preset pet resource database, and load the pet model and animation data corresponding to the current virtual pet age; Based on the terminal's current network time and / or user operation, extract the corresponding pet model and animation data from the loaded pet model and animation data corresponding to the current virtual pet's age, render and display the desktop virtual pet that grows according to the current network time. The desktop virtual pet is controlled to automatically load and display the desktop virtual pet corresponding to the network time growth as the current network time of the terminal progresses, as described above.
[0065] The steps involved in mapping the virtual pet's entire lifecycle onto a real timeline and constructing a pet model and animation data corresponding to the pet's age include: Pre-set the age stages of the virtual pet's complete life cycle, as well as the unique appearance, fur texture, and body size corresponding to each stage; and create at least a predetermined number of behavioral actions that conform to the characteristics of the corresponding stage for each age stage, and build a pet model and animation data corresponding to the pet's age; The total growth time of the virtual pet's complete life cycle is preset, mapping real time to the pet's age; the start time of each age stage is set, and a mapping function between real time and pet age is defined to simulate the corresponding pet growth curve; All the prepared pet models and animation data corresponding to the pet's age, as well as all resource files mapping real time and pet age, are uniquely encoded according to the age-action rule and uploaded to the pet resource database. A virtual pet growth timeline-resource index mapping table is then established in the pet resource database. The virtual pet growth timeline-resource index mapping table records the storage path and access address of all resource files corresponding to each age stage.
[0066] The virtual pet's complete life cycle includes the following age stages: the first stage is the newborn period, the second stage is the infancy period, the third stage is the juvenile period, the fourth stage is the adolescence period, the fifth stage is the youth period, the sixth stage is the adulthood period, the seventh stage is the middle age period, and the eighth stage is the old age period. The starting time point for each age stage is set based on the pet's age.
[0067] The steps of detecting the first launch of the virtual pet, obtaining the set initial time of the virtual pet, calculating the current age of the virtual pet, and synchronizing it with the current network time of the terminal include: Upon detecting the first launch of the virtual pet, the system retrieves the initial time of the virtual pet, synchronizes and calibrates the initial time of the virtual pet with the current network time of the terminal, and then persistently stores it in the local database. Calculate the current age of the virtual pet based on the initial time set for the virtual pet.
[0068] The step of calculating the current age of the virtual pet based on the set initial time of the virtual pet includes: Get the initial time Te of the virtual pet that was set, and get the current calibrated real time T1; Calculate the time difference ΔT = T1 - Te between the real time T1 and the initial time of the virtual pet, using days as the unit. Based on the virtual pet growth rule function Age=f(AT) defined in the stage, Δτ is converted into the pet's current virtual age in days; Query the preset pet growth rules to determine the specific growth stage to which the converted virtual age of the pet falls.
[0069] The step of searching the virtual pet growth timeline-resource index mapping table from the preset pet resource database based on the calculated current virtual pet age, and loading the pet model and animation data corresponding to the current virtual pet age includes: Based on the calculated current age of the virtual pet, determine the specific growth stage that the current virtual pet falls into; Based on the specific growth stage that the current virtual pet's age falls into, generate the resource identifier prefix that needs to be loaded; Based on the generated resource identifier prefix that needs to be loaded, the virtual pet growth timeline-resource index mapping table is searched from the local database or from the preset pet resource database. The pet model, texture and animation data corresponding to the specific growth stage that the current virtual pet's age falls into are loaded into memory to prepare for rendering.
[0070] The step of extracting the corresponding action pet model and animation data from the loaded pet model and animation data corresponding to the current virtual pet's age based on the terminal's current network time and / or user operation, rendering and displaying the desktop virtual pet that grows according to the current network time includes: Based on the terminal's current network time and / or user operation, extract the corresponding pet model and animation data from the loaded pet model and animation data corresponding to the current virtual pet's age and render them; The rendering engine draws a pet model of the appropriate size and appearance based on the pet model, texture, and animation data corresponding to the specific growth stage of the current virtual pet. The control system intelligently selects appropriate behaviors from a predetermined number of behaviors that match the characteristics of the corresponding stage based on the current context, user touch events, and pet mood value. The displayed desktop virtual pet is updated according to the current network time. The virtual pet's behavior changes intelligently with time and age, realistically simulating its life cycle; And control the display of the pet's current age or stage information on the user interface.
[0071] This application further proposes a computer-readable storage medium that, when the instructions in the storage medium are executed by the processor of an electronic device, enables the electronic device to execute a time-driven desktop AI pet growth implementation method; as described above.
[0072] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A time-driven desktop AI pet growth implementation method, characterized in that, include: The virtual pet's entire life cycle is pre-mapped onto a real timeline, and a pet model and animation data corresponding to the pet's age are constructed and stored in a pre-set pet resource database. A virtual pet growth timeline-resource index mapping table is also established in the pet resource database. Upon detecting the first launch of the virtual pet, the system retrieves the initial time of the set virtual pet, calculates the current age of the virtual pet, and synchronizes it with the current network time of the terminal. Based on the calculated current virtual pet age, search the virtual pet growth timeline-resource index mapping table from the preset pet resource database, and load the pet model and animation data corresponding to the current virtual pet age; Based on the terminal's current network time and / or user operation, extract the corresponding pet model and animation data from the loaded pet model and animation data corresponding to the current virtual pet's age, render and display the desktop virtual pet that grows according to the current network time. The desktop virtual pet is controlled to automatically load and display from a preset pet resource database as the current network time of the terminal progresses.
2. The time-driven desktop AI pet growth implementation method according to claim 1, characterized in that, The steps involved in mapping the virtual pet's entire lifecycle onto a real timeline to construct a pet model and animation data corresponding to the pet's age include: Pre-set the age stages of the virtual pet's complete life cycle, as well as the unique appearance, fur texture, and body size corresponding to each stage; and create at least a predetermined number of behavioral actions that conform to the characteristics of the corresponding stage for each age stage, and build a pet model and animation data corresponding to the pet's age; The total growth time of the virtual pet's complete life cycle is preset, mapping real time to the pet's age; the start time of each age stage is set, and a mapping function between real time and pet age is defined to simulate the corresponding pet growth curve; All the prepared pet models and animation data corresponding to the pet's age, as well as all resource files mapping real time and pet age, are uniquely encoded according to the age-action rule and uploaded to the pet resource database. A virtual pet growth timeline-resource index mapping table is then established in the pet resource database. The virtual pet growth timeline-resource index mapping table records the storage path and access address of all resource files corresponding to each age stage.
3. The time-driven desktop AI pet growth implementation method according to claim 2, characterized in that, The complete life cycle of the virtual pet includes the following age stages: the first stage is the neonatal period, the second stage is the infancy period, the third stage is the juvenile period, the fourth stage is the adolescence period, the fifth stage is the youth period, the sixth stage is the adulthood period, the seventh stage is the middle age period, and the eighth stage is the old age period. The starting time point of each age stage is set based on the pet's age.
4. The time-driven desktop AI pet growth implementation method according to claim 1, characterized in that, The steps of detecting the first launch of the virtual pet, obtaining the set initial time of the virtual pet, calculating the current age of the virtual pet, and synchronizing it with the current network time of the terminal include: Upon detecting the first launch of the virtual pet, the system retrieves the initial time of the virtual pet, synchronizes and calibrates the initial time of the virtual pet with the current network time of the terminal, and then persistently stores it in the local database. Calculate the current age of the virtual pet based on the initial time set for the virtual pet.
5. The time-driven desktop AI pet growth implementation method according to claim 4, characterized in that, The step of calculating the current age of the virtual pet based on the initial time set for the virtual pet includes: Get the initial time Te of the virtual pet that was set, and get the current calibrated real time T1; Calculate the time difference ΔT = T1 - Te between the real time T1 and the initial time of the virtual pet, using days as the unit. Based on the virtual pet growth rule function Age=f(AT) defined in the stage, Δτ is converted into the pet's current virtual age in days; Query the preset pet growth rules to determine the specific growth stage to which the converted virtual age of the pet falls.
6. The time-driven desktop AI pet growth implementation method according to claim 1, characterized in that, The step of searching the virtual pet growth timeline-resource index mapping table from the preset pet resource database based on the calculated current virtual pet age, and loading the pet model and animation data corresponding to the current virtual pet age includes: Based on the calculated current age of the virtual pet, determine the specific growth stage that the current virtual pet falls into; Based on the specific growth stage that the current virtual pet's age falls into, generate the resource identifier prefix that needs to be loaded; Based on the generated resource identifier prefix that needs to be loaded, the virtual pet growth timeline-resource index mapping table is searched from the local database or from the preset pet resource database. The pet model, texture and animation data corresponding to the specific growth stage that the current virtual pet's age falls into are loaded into memory to prepare for rendering.
7. The time-driven desktop AI pet growth implementation method according to claim 1, characterized in that, The step of extracting the corresponding action pet model and animation data from the loaded pet model and animation data corresponding to the current virtual pet's age based on the terminal's current network time and / or user operation, rendering and displaying the desktop virtual pet that grows according to the current network time includes: Based on the terminal's current network time and / or user operation, extract the corresponding pet model and animation data from the loaded pet model and animation data corresponding to the current virtual pet's age and render them; The rendering engine draws a pet model of the appropriate size and appearance based on the pet model, texture, and animation data corresponding to the specific growth stage of the current virtual pet. The control system intelligently selects appropriate behaviors from a predetermined number of behaviors that match the characteristics of the corresponding stage based on the current context, user touch events, and pet mood value. The displayed desktop virtual pet is updated according to the current network time. The virtual pet's behavior changes intelligently with time and age, realistically simulating its life cycle; And control the display of the pet's current age or stage information on the user interface.
8. A time-driven desktop AI pet growth realization device, characterized in that, The device includes: The pre-setting module is used to pre-map the virtual pet images corresponding to the entire life cycle of the virtual pet onto the real timeline, build pet models and animation data corresponding to the pet's age, store them in the pre-set pet resource database, and establish a virtual pet growth timeline-resource index mapping table in the pet resource database; The virtual pet age calculation module is used to detect the first launch of the virtual pet, obtain the set initial time of the virtual pet, calculate the current age of the virtual pet, and synchronize and calibrate it with the current network time of the terminal. The resource loading module is used to search the virtual pet growth timeline-resource index mapping table from the preset pet resource database based on the calculated current virtual pet age, and load the pet model and animation data corresponding to the current virtual pet age; The rendering module is used to extract the corresponding action pet model and animation data from the loaded pet model and animation data corresponding to the current virtual pet age, based on the terminal's current network time and / or user operation, and to render and display the desktop virtual pet that grows according to the current network time. The growth control module is used to control the desktop virtual pet to automatically load and display the desktop virtual pet corresponding to the growth of network time as the current network time of the terminal passes.
9. An electronic device, characterized in that, It includes a memory, and one or more programs, wherein one or more programs are stored in the memory and configured to be executed by one or more processors, the one or more programs comprising the means for performing the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the method as described in any one of claims 1-7.