A virtual companion asynchronous interaction triggering method and system based on multi-dimensional space-time constraints, a terminal, and a storage medium

By using an asynchronous interaction triggering method with multidimensional spatiotemporal constraints, nonlinear time parameters and sliding window counts are dynamically generated. Combined with a time-domain compensation algorithm, the problems of uneven system load and user experience gaps in virtual companion interaction events are solved, enabling dynamic resource scheduling and precise response to user behavior.

CN122431809APending Publication Date: 2026-07-21GUANGDONG CHUANGSHI TECHNOLOGY ADVERTISING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGDONG CHUANGSHI TECHNOLOGY ADVERTISING CO LTD
Filing Date
2026-03-04
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing virtual companion interaction event triggering mechanisms, due to their use of fixed time points or probability models, result in uneven system load, unreasonable resource allocation, and an inability to adapt to user activity levels, thus affecting system stability and user experience.

Method used

An asynchronous interactive triggering method based on multidimensional spatiotemporal constraints is adopted. By dynamically generating nonlinear time parameters, sliding window counting, and time-domain compensation algorithms, combined with user behavior and work-rest patterns, dynamic scheduling and balancing of resources are achieved.

Benefits of technology

Effectively balance system load, avoid peak database pressure, improve the targeting of resource allocation and user experience, and enhance system stability and user satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122431809A_ABST
    Figure CN122431809A_ABST
Patent Text Reader

Abstract

The application discloses a kind of virtual companion asynchronous interaction trigger method, system, terminal and storage medium based on multidimensional space-time constraint, the method includes: response travel instruction, generate nonlinear time parameter containing random disturbance term according to destination category, including silence period, reward window and secondary compensation point;In reward window, user access frequency is monitored based on sliding window counting;When access frequency reaches threshold and current time is located in reward window, generate resource issue instruction and dynamically calculate home time;If instruction execution time falls into late night low active period, it is executed by asynchronous scheduling engine by time domain compensation algorithm translation to user active period after.The application realizes dynamic scheduling and optimization, improves resource utilization efficiency, guarantees system stability, improves user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of software function technology, and in particular to a method, system, terminal, and computer-readable storage medium for triggering asynchronous interaction of virtual companions based on multidimensional spatiotemporal constraints. Background Technology

[0002] With the widespread adoption of mobile internet and smart devices, virtual pet simulation applications (such as virtual companions and electronic pets) have gradually become an important part of users' daily entertainment. These applications typically enhance user immersion and engagement by simulating real-life interactive behaviors (such as posting on social media, sending virtual items, and traveling). However, current mainstream technologies still generally employ time-based or fixed-probability scheduling mechanisms when triggering interactive events, which have significant technical limitations.

[0003] In existing technologies, common methods for triggering interactive events mainly include the following two: Scheduled task model: The system pre-sets a fixed time point (such as 05:00 every day) to trigger an event, such as the virtual companion "automatically returning home" or "sending a reward". This method is simple to implement, but in large-scale user scenarios, it can easily cause the concentrated consumption of system resources at a specific time point, forming instantaneous high-concurrency database read and write pressure, which may lead to database connection pool exhaustion, slow service response, or even a cascading crash in severe cases.

[0004] Fixed probability model: The system sets a fixed probability value (e.g., 50% probability of obtaining a reward) to determine whether an event is triggered. This method lacks the ability to perceive and dynamically adjust to user behavior, causing highly active users to feel bored due to frequent triggers, while inactive users miss out on rewards due to scarce trigger opportunities, ultimately affecting user experience and retention rate.

[0005] The technical shortcomings of the aforementioned traditional methods in practical applications are mainly reflected in the following aspects: Uneven resource allocation: The system cannot dynamically adjust based on users' real-time activity levels, resulting in a lack of targeted allocation of interactive resources. This fails to effectively incentivize highly active users or mitigate the risk of churn among inactive users.

[0006] The system load fluctuates wildly: Due to a large number of users triggering state changes or task scheduling at the same time on the hour, the database I / O surges instantly, which can easily cause connection congestion, response delays or even service unavailability, seriously affecting the system's stability and scalability.

[0007] The user experience is noticeably fragmented: the timing of interactive events does not take into account users' sleep patterns, which may result in unnecessary notifications or expired rewards during users' rest periods at night, causing user resentment or decreased willingness to participate.

[0008] Therefore, existing technologies still need to be improved and developed. Summary of the Invention

[0009] The main objective of this invention is to provide a method, system, terminal, and computer-readable storage medium for triggering asynchronous interaction of virtual companions based on multidimensional spatiotemporal constraints. This invention aims to solve the problems in the prior art where the virtual companion interaction event triggering mechanism uses fixed time points or probability models, resulting in uneven system load, unreasonable resource allocation, and inability to adapt to the user's active state, thus causing poor system stability and a disconnect in user experience.

[0010] To achieve the above objectives, the present invention provides a method for triggering asynchronous interaction of virtual companions based on multidimensional spatiotemporal constraints. The method includes the following steps: In response to a user triggering a travel instruction from a virtual companion, a nonlinear time parameter with random perturbation terms is dynamically generated based on a preset destination category. The nonlinear time parameter includes a quiet period, a reward window, and a secondary compensation point. Within the reward window, the user's access behavior is monitored in real time based on a sliding window counting mechanism, and the frequency of the user's access within the reward window is counted. When the access frequency is detected to reach a preset trigger threshold, a resource distribution instruction is generated based on whether the current time is within the reward window, and the automatic home time of the virtual companion is dynamically calculated. When the preset execution time of the resource issuance instruction falls into a low-activity period at night, the execution time of the instruction is automatically shifted to the user's active period through a time-domain compensation algorithm, and then executed by the asynchronous scheduling engine.

[0011] Optionally, in the virtual companion asynchronous interaction triggering method based on multidimensional spatiotemporal constraints, the silent period represents the time period during which no rewards are issued after the trip; the reward window represents the time interval from the end of the silent period to the end of the reward issuance; and the secondary compensation point represents the time point at which rewards are issued again after the end of the reward window.

[0012] Optionally, the virtual companion asynchronous interaction triggering method based on multidimensional spatiotemporal constraints, wherein the step of dynamically generating nonlinear time parameters with random perturbation terms according to a preset destination category in response to a user triggering a travel instruction from the virtual companion specifically includes: When a user triggers a travel instruction from a virtual companion, the travel destination type of the virtual companion is determined according to a preset destination category, wherein the destination category includes one of the following: unnamed places, domestic attractions, and international attractions. Based on the destination category, the corresponding quiet period x, reward window y, and secondary compensation point z are dynamically generated using a nonlinear parameter engine. When generating the quiet period x, the reward window y, and the secondary compensation point z, a random perturbation term is introduced to make each time parameter exhibit a non-linear distribution within a preset range. The random disturbance term is used to ensure that the time parameters corresponding to different travel events have differentiated characteristics, so as to avoid system load concentration caused by fixed time point triggering.

[0013] Optionally, the virtual companion asynchronous interaction triggering method based on multidimensional spatiotemporal constraints, wherein the step of monitoring the user's access behavior in real time based on a sliding window counting mechanism within the reward window and counting the user's access frequency within the reward window specifically includes: After the reward window is opened, the Java interceptor collects every access behavior of the user to the virtual companion in real time, wherein the access behavior includes the user's operation of entering the virtual companion interaction interface; A sliding window counting mechanism is implemented using Redis. The reward window is used as the time span to count the cumulative number of visits by users within the reward window. The sliding window counting mechanism maintains the user-level access counter through Redis's atomic auto-increment command and sets an expiration time aligned with the reward window. The system monitors the changes in the access counter value in real time and updates the current statistical value each time a user accesses the system. The statistical value is used to determine the user's activity level within the reward window and serves as the trigger for subsequent resource issuance instructions.

[0014] Optionally, the virtual companion asynchronous interaction triggering method based on multidimensional spatiotemporal constraints, wherein when the access frequency is detected to reach a preset trigger threshold, a resource distribution instruction is generated based on whether the current time is within the reward window, and the automatic return time of the virtual companion is dynamically calculated, specifically includes: When the frequency of a user's access within the reward window reaches a preset trigger threshold, it is determined whether the current time is within the time interval of the reward window. If the current time is within the reward window, a resource distribution instruction is immediately sent through the message queue to distribute the corresponding reward to the user. At the same time as the resource issuance instruction is generated, the automatic return time of the virtual companion is dynamically calculated based on the current actual reward distribution time; The automatic return time is calculated as follows: based on the current reward distribution time, a random remaining time value generated based on the destination category is superimposed. The random remaining time value is dynamically generated by the cascaded state regression model according to the destination category, which is used to realize the association and binding between the virtual companion's return time and the actual reward distribution time.

[0015] Optionally, the virtual companion asynchronous interaction triggering method based on multi-dimensional spatiotemporal constraints, wherein when the preset execution time of the resource issuance instruction falls into a low-activity period at night, the instruction execution time is automatically shifted to the user's active period through a time-domain compensation algorithm, and the instruction is issued by the asynchronous scheduling engine, specifically includes: After the resource issuance instruction is generated, a time-domain conflict check is performed on the preset execution time of the instruction. The time-domain conflict check includes determining whether the preset execution time falls within a preset low-activity period at night, wherein the low-activity period at night is from 02:00 to 06:00. If it is determined that the preset execution time falls within the low-activity period at night, the sleep time domain compensation algorithm is triggered to automatically shift the instruction execution time. The shifting process involves adding a fixed time offset to the preset execution time to generate the actual execution time. The actual execution time after the shift is taken as the new scheduling time, and the instructions are pushed to the task queue by the time wheel algorithm through the asynchronous scheduling engine.

[0016] Optionally, the method for triggering asynchronous interaction of virtual companions based on multidimensional spatiotemporal constraints further includes: When a user triggers a travel instruction from the virtual companion, the virtual companion's state is switched from the home state to the travel state via a Java state machine; While the virtual companion is in a travel state, the generated quiet period, reward window, and secondary compensation point are submitted to the asynchronous scheduling engine as delayed task parameters. When user behavior triggers a resource distribution instruction or the system performs a time-domain compensation shift, the asynchronous scheduling engine pushes the corresponding resource distribution task to the message queue based on the calculated actual execution time. The message queue is used to decouple task scheduling from task execution. After the resource distribution task is completed, the state machine switches the virtual companion's status from travel status back to home status based on the dynamically calculated automatic return time.

[0017] Furthermore, to achieve the above objectives, the present invention also provides a virtual companion asynchronous interaction triggering system based on multidimensional spatiotemporal constraints, wherein the virtual companion asynchronous interaction triggering system based on multidimensional spatiotemporal constraints includes: The parameter generation module is used to respond to the user's triggering of the virtual companion's travel command and dynamically generate nonlinear time parameters with random perturbation terms according to the preset destination category. The nonlinear time parameters include a quiet period, a reward window, and a secondary compensation point. The behavior monitoring module is used to monitor the user's access behavior in real time within the reward window based on a sliding window counting mechanism, and to count the frequency of the user's access within the reward window. The trigger calculation module is used to generate a resource distribution instruction and dynamically calculate the automatic home time of the virtual companion when the access frequency is detected to reach a preset trigger threshold, combined with whether the current time is within the reward window. The time-domain compensation module is used to automatically shift the execution time of the resource issuance instruction to the user's active period through a time-domain compensation algorithm when the preset execution time of the instruction falls into the low-activity period at night, and then execute the instruction issuance by the asynchronous scheduling engine.

[0018] Furthermore, to achieve the above objectives, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and a virtual companion asynchronous interaction triggering program based on multidimensional spatiotemporal constraints stored in the memory and executable on the processor, wherein when the virtual companion asynchronous interaction triggering program based on multidimensional spatiotemporal constraints is executed by the processor, it implements the steps of the virtual companion asynchronous interaction triggering method based on multidimensional spatiotemporal constraints as described above.

[0019] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a virtual companion asynchronous interaction triggering program based on multidimensional spatiotemporal constraints, and when the virtual companion asynchronous interaction triggering program based on multidimensional spatiotemporal constraints is executed by a processor, it implements the steps of the virtual companion asynchronous interaction triggering method based on multidimensional spatiotemporal constraints as described above.

[0020] In this invention, in response to a user triggering a travel command from a virtual companion, a nonlinear time parameter with random perturbation is dynamically generated based on a preset destination category. This nonlinear time parameter includes a quiet period, a reward window, and a secondary compensation point. Within the reward window, the user's access behavior is monitored in real time using a sliding window counting mechanism, and the frequency of user access within the reward window is counted. When the access frequency reaches a preset trigger threshold, a resource delivery command is generated based on whether the current time falls within the reward window, and the automatic return time of the virtual companion is dynamically calculated. When the preset execution time of the resource delivery command falls within a low-activity period at night, the command execution time is automatically shifted to the user's active period using a time-domain compensation algorithm, and then executed by an asynchronous scheduling engine. This invention introduces a multi-dimensional spatiotemporal constraint mechanism, transforming the triggering of virtual companion interaction events from a traditional fixed-time point or fixed-probability model to a dynamic scheduling mode based on destination category, real-time user behavior, and user's daily routine. This achieves closed-loop control through nonlinear time parameter generation, sliding window behavior counting, dynamic homecoming time calculation, and automatic shifting during late-night periods. This effectively balances system load, avoids instantaneous peak pressure on the database, and improves the targeted nature of resource allocation and the continuity of user experience. Attached Figure Description

[0021] Figure 1 This is a flowchart of a preferred embodiment of the asynchronous interaction triggering method for virtual companions based on multidimensional spatiotemporal constraints of the present invention; Figure 2 This is a structural diagram of a preferred embodiment of the virtual companion asynchronous interaction triggering system based on multidimensional spatiotemporal constraints of the present invention; Figure 3 This is a structural diagram of a preferred embodiment of the terminal of the present invention. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of this invention clearer and more explicit, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0023] The preferred embodiment of the present invention describes an asynchronous interaction triggering method for virtual companions based on multidimensional spatiotemporal constraints, such as... Figure 1 As shown, the asynchronous interaction triggering method for virtual companions based on multidimensional spatiotemporal constraints includes the following steps: Step S10: In response to the user triggering the virtual companion's travel instruction, dynamically generate a nonlinear time parameter with random perturbation terms according to the preset destination category. The nonlinear time parameter includes a quiet period, a reward window, and a secondary compensation point.

[0024] Specifically, when a user triggers a travel instruction from the virtual companion, the travel destination type of the virtual companion is determined according to a preset destination category. This destination category includes one of the following: unnamed places, domestic attractions, and international attractions. The non-linear time parameters include a quiet period x, a reward window y, and a secondary compensation point z. The quiet period x represents the time period during which no rewards are issued after the virtual companion travels; the reward window y represents the time interval from the end of the quiet period to the end of the reward issuance period, which is the quiet period plus a random perturbation value; and the secondary compensation point z represents the time point at which rewards are issued again after the reward window ends, calculated by adding another random perturbation value to the reward window y.

[0025] Based on the destination category, a corresponding quiet period x, reward window y, and secondary compensation point z are dynamically generated using a nonlinear parameter engine. When generating the quiet period x, reward window y, and secondary compensation point z, a random perturbation term is introduced to make each time parameter exhibit a nonlinear distribution within a preset range. The random perturbation term is used to ensure that the time parameters corresponding to different travel events have differentiated characteristics, so as to avoid system load concentration caused by fixed time point triggering.

[0026] In this embodiment, the user triggers the "Open Time Gate" operation through the virtual companion application interface, instructing the virtual companion (such as Xiaoli) to go on a trip. After receiving the travel instruction, the system backend first determines the type of the virtual companion's travel destination according to the preset destination category, such as unnamed places, domestic attractions, and international attractions.

[0027] When generating the aforementioned nonlinear time parameters, the system introduces a random disturbance term to ensure that each time parameter exhibits a nonlinear distribution within a preset range. For example, for the destination "domestic attractions," the system randomly generates a quiet period x = 4 hours, a reward window y = 5.5 hours (i.e., a reward window 1.5 hours after the end of the quiet period), and a secondary compensation point z = y + 1.5 hours. The introduction of this random disturbance term ensures that the time parameters corresponding to different travel events have differentiated characteristics, avoiding system load concentration caused by fixed time point triggers.

[0028] Step S20: Within the reward window, monitor the user's access behavior in real time based on the sliding window counting mechanism, and count the frequency of the user's access within the reward window.

[0029] Specifically, after the reward window opens, a Java interceptor collects every user's access behavior to the virtual companion in real time. This access behavior includes actions such as entering the virtual companion's interactive interface and viewing the virtual companion's status. To achieve accurate statistics on user access frequency, a sliding window counting mechanism is implemented using Redis. Using the reward window as the time span, the cumulative number of user visits within the reward window is counted. This sliding window counting mechanism maintains a user-level access counter using Redis's atomic increment command and sets an expiration time aligned with the reward window. For example, each time a user visits, the backend atomically increments the user-level access counter using Redis's INCR command, such as executing "INCR user:123:visit_count". Simultaneously, the system sets an expiration time for the counter aligned with the reward window, ensuring the counting range is always limited to the current reward window. The system monitors the changes in the access counter value in real time and updates the current statistical value each time a user visits. This statistical value is used to determine the user's activity level within the reward window, serving as the trigger for subsequent resource issuance commands.

[0030] Step S30: When the access frequency is detected to reach the preset trigger threshold, a resource distribution instruction is generated based on whether the current time is within the reward window, and the automatic home time of the virtual companion is dynamically calculated.

[0031] Specifically, when the frequency of a user's access within the reward window reaches a preset trigger threshold, it is determined whether the current time is within the time interval of the reward window. If the current time is within the reward window, a resource distribution instruction is immediately sent through a message queue to distribute the corresponding reward to the user. Simultaneously with the generation of the resource distribution instruction, the automatic return time of the virtual companion is dynamically calculated based on the current actual reward distribution time. The automatic return time is calculated as follows: based on the current reward distribution time, a random remaining time value generated based on the destination category is superimposed. The random remaining time value is dynamically generated by a cascaded state regression model based on the destination category, which is used to associate and bind the virtual companion's return time with the actual reward distribution time, avoiding the use of a static preset time.

[0032] In this embodiment, the preset trigger threshold is set to 4 times, meaning that the reward is triggered when a user makes a cumulative 4 visits within the reward window. When the system detects that the user's visit frequency within the reward window reaches 4 times, it further determines whether the current time is within the reward window's time interval. If the current time is within the reward window (for example, the user makes their 4th visit at 15:00, and the reward window is from 14:00 to 15:30), the system immediately sends a GiftDispatchEvent resource distribution instruction through the message queue to distribute the corresponding reward to the user.

[0033] Simultaneously with the generation of resource issuance instructions, the system dynamically calculates the automatic return time of the virtual companion based on the current actual reward distribution time. The automatic return time is calculated by overlaying a random remaining time value generated based on the destination category onto the current reward distribution time. For example, if the actual reward is distributed at 15:00, then the automatic return time t3 = 15:00 + Random(0, r), where r is a remaining time parameter determined based on the destination category (e.g., for domestic tourist attractions, r takes a random value between 8 and 16 hours). This calculation method is implemented using a cascaded state regression model, dynamically associating and binding the virtual companion's return time with the actual reward distribution time, avoiding the rigidity issues caused by using static preset times.

[0034] Step S40: When the preset execution time of the resource issuance instruction falls into a low-activity period at night, the instruction execution time is automatically shifted to the user's active period through a time-domain compensation algorithm, and the instruction is issued by the asynchronous scheduling engine.

[0035] Specifically, after the resource issuance instruction is generated, a time-domain conflict check is performed on the preset execution time of the instruction. The time-domain conflict check includes determining whether the preset execution time falls within a preset low-activity period at night, wherein the low-activity period at night is from 02:00 to 06:00. If it is determined that the preset execution time falls within the low-activity period at night, a sleep time-domain compensation algorithm is triggered to automatically shift the instruction execution time. The shifting process involves adding a fixed time offset to the preset execution time to generate the actual execution time. For example, if the fixed time offset is 5 hours, and the time t1 corresponding to the secondary compensation point z calculated by the system is 03:00 the next day, and it falls within the low-activity period at night after verification, then the actual execution time t2 is calculated by the shifting algorithm as t2 = t1 + 5 hours, that is, it is adjusted to be executed at 08:00 on the same day. The actual execution time after the shift is used as the new scheduling time. The instructions are pushed to the task queue through the asynchronous scheduling engine using the time wheel algorithm. The asynchronous scheduling engine uses the HashedWheelTimer algorithm of the time wheel to realize the delayed task management of millions of users, ensuring that instructions are accurately issued during the user's active period, while reducing the system's operating load during late night hours.

[0036] Furthermore, when a user triggers a travel instruction for the virtual companion, the Java state machine switches the virtual companion's state from "at home" to "travel". While the virtual companion is in the travel state, the generated quiet period, reward window, and secondary compensation point are submitted to the asynchronous scheduling engine as delayed task parameters. When the user's behavior triggers a resource distribution instruction or the system performs a time-domain compensation shift, the asynchronous scheduling engine pushes the corresponding resource distribution task to a message queue based on the calculated actual execution time. The message queue is used to decouple task scheduling from task execution. After the resource distribution task is completed, the state machine switches the virtual companion's state from "travel" back to "at home" based on the dynamically calculated automatic return time, thus completing a full asynchronous interaction trigger loop.

[0037] To verify the technical effect of the present invention, the "domestic scenic spots" travel scenario in the embodiment is used as an example for illustration: Scenario 1: A user triggers their virtual companion "Xiao Li" to travel to domestic tourist attractions at 10:00 AM. The system randomly generates a silent period of x = 4 hours and a reward window of y = 5.5 hours (i.e., 2:00 PM to 3:30 PM). The user's first visit at 2:30 PM increments the counter to 1; when the user makes their fourth visit at 3:00 PM, the system detects that the current time T ∈ [2:00 PM, 3:30 PM] and immediately triggers the reward distribution. The system also calculates the automatic return time as 3:00 PM + a random remaining time, achieving dynamic association.

[0038] Scenario 2: The system calculates the secondary compensation point t1 as 03:00 the next day. After verification, it falls into the low-activity period of the night. The execution time is adjusted to 08:00 through the translation algorithm, which effectively avoids the user's sleep period and avoids unnecessary load on the system at night.

[0039] Experimental data shows that after adopting this invention, the system's peak database I / O at the top of the hour is reduced by about 67%, the user reward acquisition rate is increased by about 43%, and the system load at night is reduced by about 82%, significantly improving system stability and user experience.

[0040] The technical effects that this invention can bring are as follows: 1. System load balancing: By introducing random disturbance terms through non-linear time parameters, the system avoids the simultaneous triggering of state transitions or task scheduling by a large number of users at fixed times, eliminating the risk of instantaneous peak database I / O and connection backlog, effectively preventing service avalanche, and ensuring the stability of the system in high-concurrency scenarios.

[0041] 2. Precise resource allocation: Based on the sliding window counting mechanism, the frequency of user access within the reward window is monitored in real time. The reward distribution is dynamically linked to the user's real-time activity behavior, so that highly active users receive timely incentives and inactive users receive compensation opportunities, thereby improving the targeting of resource allocation and user stickiness.

[0042] 3. Humanized User Experience: By using a sleep time-domain compensation algorithm, instructions from late night (02:00-06:00) are automatically shifted to the user's active time period for execution, avoiding nighttime harassment and reward expiration issues, making interactive events more in line with the user's work and rest patterns, and improving user satisfaction and retention rate.

[0043] 4. Intelligent Status Management: The cascaded state regression model dynamically links the virtual companion's "automatic homecoming time" with the actual reward distribution time, abandoning static preset values ​​and making the virtual companion's travel logic more in line with real interaction scenarios, thus enhancing the realism and fun of the virtual character.

[0044] 5. Improved scheduling performance: The introduction of a time wheel algorithm enables delayed task management for millions of users. Combined with Redis distributed counting and message queue decoupling, the task throughput and response speed of the asynchronous scheduling engine are significantly improved, while reducing system resource consumption.

[0045] Furthermore, such as Figure 2 As shown, based on the above-mentioned asynchronous interaction triggering method for virtual companions based on multidimensional spatiotemporal constraints, the present invention also provides a corresponding asynchronous interaction triggering system for virtual companions based on multidimensional spatiotemporal constraints, wherein the asynchronous interaction triggering system for virtual companions based on multidimensional spatiotemporal constraints includes: The parameter generation module 51 is used to respond to the user's triggering of the virtual companion's travel instruction and dynamically generate nonlinear time parameters with random perturbation terms according to the preset destination category. The nonlinear time parameters include a quiet period, a reward window, and a secondary compensation point. The behavior monitoring module 52 is used to monitor the user's access behavior in real time within the reward window based on the sliding window counting mechanism, and to count the user's access frequency within the reward window. The trigger calculation module 53 is used to generate a resource distribution instruction and dynamically calculate the automatic home time of the virtual companion when the access frequency is detected to reach a preset trigger threshold, in combination with whether the current time is within the reward window. The time-domain compensation module 54 is used to automatically shift the execution time of the resource issuance instruction to the user's active period through a time-domain compensation algorithm when the preset execution time of the instruction falls into the low-activity period at night, and then execute the instruction issuance by the asynchronous scheduling engine.

[0046] Furthermore, such as Figure 3As shown, based on the above-mentioned asynchronous interaction triggering method and system for virtual companions based on multidimensional spatiotemporal constraints, the present invention also provides a terminal, which includes a processor 10, a memory 20 and a display 30. Figure 3 Only some of the terminal components are shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0047] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory. In other embodiments, the memory 20 may be an external storage device of the terminal, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc. Further, the memory 20 may include both internal and external storage devices. The memory 20 is used to store application software and various types of data installed on the terminal, such as the program code installed on the terminal. The memory 20 can also be used to temporarily store data that has been output or will be output. In one embodiment, the memory 20 stores a virtual companion asynchronous interaction trigger program 40 based on multidimensional spatiotemporal constraints. This virtual companion asynchronous interaction trigger program 40 based on multidimensional spatiotemporal constraints can be executed by the processor 10, thereby implementing the virtual companion asynchronous interaction triggering method based on multidimensional spatiotemporal constraints in this application.

[0048] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor, or other data processing chip, used to run program code stored in the memory 20 or process data, such as executing the virtual companion asynchronous interaction triggering method based on multidimensional spatiotemporal constraints.

[0049] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. The display 30 is used to display information on the terminal and to display a visual user interface. The terminal's processor 10, memory 20, and display 30 communicate with each other via a system bus.

[0050] In one embodiment, when the processor 10 executes the virtual companion asynchronous interaction trigger program 40 based on multidimensional spatiotemporal constraints in the memory 20, the following steps are performed: In response to a user triggering a travel instruction from a virtual companion, a nonlinear time parameter with random perturbation terms is dynamically generated based on a preset destination category. The nonlinear time parameter includes a quiet period, a reward window, and a secondary compensation point. Within the reward window, the user's access behavior is monitored in real time based on a sliding window counting mechanism, and the frequency of the user's access within the reward window is counted. When the access frequency is detected to reach a preset trigger threshold, a resource distribution instruction is generated based on whether the current time is within the reward window, and the automatic home time of the virtual companion is dynamically calculated. When the preset execution time of the resource issuance instruction falls into a low-activity period at night, the execution time of the instruction is automatically shifted to the user's active period through a time-domain compensation algorithm, and then executed by the asynchronous scheduling engine.

[0051] The quiet period refers to the time during which no rewards are issued after the trip; the reward window refers to the time interval from the end of the quiet period to the end of the reward issuance period; and the secondary compensation point refers to the time point at which rewards are issued again after the reward window ends.

[0052] Specifically, the step of responding to a user's triggering of a virtual companion's travel instruction by dynamically generating nonlinear time parameters with random perturbation terms based on a preset destination category includes: When a user triggers a travel instruction from a virtual companion, the travel destination type of the virtual companion is determined according to a preset destination category, wherein the destination category includes one of the following: unnamed places, domestic attractions, and international attractions. Based on the destination category, the corresponding quiet period x, reward window y, and secondary compensation point z are dynamically generated using a nonlinear parameter engine. When generating the quiet period x, the reward window y, and the secondary compensation point z, a random perturbation term is introduced to make each time parameter exhibit a non-linear distribution within a preset range. The random disturbance term is used to ensure that the time parameters corresponding to different travel events have differentiated characteristics, so as to avoid system load concentration caused by fixed time point triggering.

[0053] Specifically, within the reward window, the system monitors user access behavior in real time based on a sliding window counting mechanism and counts the frequency of user access within the reward window, including: After the reward window is opened, the Java interceptor collects every access behavior of the user to the virtual companion in real time, wherein the access behavior includes the user's operation of entering the virtual companion interaction interface; A sliding window counting mechanism is implemented using Redis. The reward window is used as the time span to count the cumulative number of visits by users within the reward window. The sliding window counting mechanism maintains the user-level access counter through Redis's atomic auto-increment command and sets an expiration time aligned with the reward window. The system monitors the changes in the access counter value in real time and updates the current statistical value each time a user accesses the system. The statistical value is used to determine the user's activity level within the reward window and serves as the trigger for subsequent resource issuance instructions.

[0054] Specifically, when the access frequency is detected to reach a preset trigger threshold, a resource distribution instruction is generated based on whether the current time is within the reward window, and the automatic return time of the virtual companion is dynamically calculated. When the frequency of a user's access within the reward window reaches a preset trigger threshold, it is determined whether the current time is within the time interval of the reward window. If the current time is within the reward window, a resource distribution instruction is immediately sent through the message queue to distribute the corresponding reward to the user. At the same time as the resource issuance instruction is generated, the automatic return time of the virtual companion is dynamically calculated based on the current actual reward distribution time; The automatic return time is calculated as follows: based on the current reward distribution time, a random remaining time value generated based on the destination category is superimposed. The random remaining time value is dynamically generated by the cascaded state regression model according to the destination category, which is used to realize the association and binding between the virtual companion's return time and the actual reward distribution time.

[0055] Specifically, when the preset execution time of the resource issuance instruction falls during a low-activity period at night, the execution time of the instruction is automatically shifted to a user-active period using a time-domain compensation algorithm, and then executed by the asynchronous scheduling engine. This includes: After the resource issuance instruction is generated, a time-domain conflict check is performed on the preset execution time of the instruction. The time-domain conflict check includes determining whether the preset execution time falls within a preset low-activity period at night, wherein the low-activity period at night is from 02:00 to 06:00. If it is determined that the preset execution time falls within the low-activity period at night, the sleep time domain compensation algorithm is triggered to automatically shift the instruction execution time. The shifting process involves adding a fixed time offset to the preset execution time to generate the actual execution time. The actual execution time after the shift is taken as the new scheduling time, and the instructions are pushed to the task queue by the time wheel algorithm through the asynchronous scheduling engine.

[0056] The asynchronous interaction triggering method for virtual companions based on multidimensional spatiotemporal constraints further includes: When a user triggers a travel instruction from the virtual companion, the virtual companion's state is switched from the home state to the travel state via a Java state machine; While the virtual companion is in a travel state, the generated quiet period, reward window, and secondary compensation point are submitted to the asynchronous scheduling engine as delayed task parameters. When user behavior triggers a resource distribution instruction or the system performs a time-domain compensation shift, the asynchronous scheduling engine pushes the corresponding resource distribution task to the message queue based on the calculated actual execution time. The message queue is used to decouple task scheduling from task execution. After the resource distribution task is completed, the state machine switches the virtual companion's status from travel status back to home status based on the dynamically calculated automatic return time.

[0057] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a virtual companion asynchronous interaction triggering program based on multidimensional spatiotemporal constraints, and the virtual companion asynchronous interaction triggering program based on multidimensional spatiotemporal constraints, when executed by a processor, implements the steps of the virtual companion asynchronous interaction triggering method based on multidimensional spatiotemporal constraints as described above.

[0058] In summary, this invention provides a method, system, terminal, and computer-readable storage medium for triggering asynchronous interaction of virtual companions based on multidimensional spatiotemporal constraints. The method includes: responding to a user triggering a travel instruction from a virtual companion, dynamically generating a nonlinear time parameter with a random perturbation term based on a preset destination category, wherein the nonlinear time parameter includes a quiet period, a reward window, and a secondary compensation point; within the reward window, monitoring the user's access behavior in real time based on a sliding window counting mechanism, and counting the user's access frequency within the reward window; when the detected access frequency reaches a preset trigger threshold, generating a resource delivery instruction based on whether the current time is within the reward window, and dynamically calculating the virtual companion's automatic return time; when the preset execution time of the resource delivery instruction falls into a low-activity period at night, automatically shifting the instruction execution time to the user's active period through a time-domain compensation algorithm, and executing the delivery by an asynchronous scheduling engine. This invention introduces a multi-dimensional spatiotemporal constraint mechanism to transform the triggering of virtual companion interaction events from a traditional fixed time point or fixed probability model to a dynamic scheduling mode based on destination category, real-time user behavior, and user's daily routine. This achieves closed-loop control of nonlinear time parameter generation, sliding window behavior counting, dynamic homecoming time calculation, and automatic shifting during late-night periods, thereby effectively balancing system load, avoiding instantaneous peak pressure on the database, and improving the targeting of resource allocation and the continuity of user experience.

[0059] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal that includes that element.

[0060] Of course, those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.). The program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The computer-readable storage medium can be a memory, magnetic disk, optical disk, etc.

[0061] It should be understood that the application of the present invention is not limited to the examples above. Those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.

Claims

1. A method for triggering asynchronous interaction of virtual companions based on multidimensional spatiotemporal constraints, characterized in that, The asynchronous interaction triggering method for virtual companions based on multidimensional spatiotemporal constraints includes: In response to a user triggering a travel instruction from a virtual companion, a nonlinear time parameter with random perturbation terms is dynamically generated based on a preset destination category. The nonlinear time parameter includes a quiet period, a reward window, and a secondary compensation point. Within the reward window, the user's access behavior is monitored in real time based on a sliding window counting mechanism, and the frequency of the user's access within the reward window is counted. When the access frequency is detected to reach a preset trigger threshold, a resource distribution instruction is generated based on whether the current time is within the reward window, and the automatic home time of the virtual companion is dynamically calculated. When the preset execution time of the resource issuance instruction falls into a low-activity period at night, the execution time of the instruction is automatically shifted to the user's active period through a time-domain compensation algorithm, and then executed by the asynchronous scheduling engine.

2. The asynchronous interaction triggering method for virtual companions based on multidimensional spatiotemporal constraints according to claim 1, characterized in that, The silent period refers to the time period during which rewards are not issued after the trip; the reward window refers to the time interval from the end of the silent period to the end of the reward issuance period; the secondary compensation point refers to the time point at which rewards are issued again after the reward window ends.

3. The asynchronous interaction triggering method for virtual companions based on multidimensional spatiotemporal constraints according to claim 2, characterized in that, The method of responding to a user-triggered travel instruction from a virtual companion by dynamically generating nonlinear time parameters with random perturbations based on a preset destination category specifically includes: When a user triggers a travel instruction from a virtual companion, the travel destination type of the virtual companion is determined according to a preset destination category, wherein the destination category includes one of the following: unnamed places, domestic attractions, and international attractions. Based on the destination category, the corresponding quiet period x, reward window y, and secondary compensation point z are dynamically generated using a nonlinear parameter engine. When generating the quiet period x, the reward window y, and the secondary compensation point z, a random perturbation term is introduced to make each time parameter exhibit a non-linear distribution within a preset range. The random disturbance term is used to ensure that the time parameters corresponding to different travel events have differentiated characteristics, so as to avoid system load concentration caused by fixed time point triggering.

4. The asynchronous interaction triggering method for virtual companions based on multidimensional spatiotemporal constraints according to claim 1, characterized in that, Within the reward window, the system monitors user access behavior in real time based on a sliding window counting mechanism and counts the frequency of user access within the reward window, specifically including: After the reward window is opened, the Java interceptor collects every access behavior of the user to the virtual companion in real time, wherein the access behavior includes the user's operation of entering the virtual companion interaction interface; A sliding window counting mechanism is implemented using Redis. The reward window is used as the time span to count the cumulative number of visits by users within the reward window. The sliding window counting mechanism maintains the user-level access counter through Redis's atomic auto-increment command and sets an expiration time aligned with the reward window. The system monitors the changes in the access counter value in real time and updates the current statistical value each time a user accesses the system. The statistical value is used to determine the user's activity level within the reward window and serves as the trigger for subsequent resource issuance instructions.

5. The asynchronous interaction triggering method for virtual companions based on multidimensional spatiotemporal constraints according to claim 1, characterized in that, When the access frequency is detected to reach a preset trigger threshold, a resource distribution instruction is generated based on whether the current time is within the reward window, and the automatic return time of the virtual companion is dynamically calculated, specifically including: When the frequency of a user's access within the reward window reaches a preset trigger threshold, it is determined whether the current time is within the time interval of the reward window. If the current time is within the reward window, a resource distribution instruction is immediately sent through the message queue to distribute the corresponding reward to the user. At the same time as the resource issuance instruction is generated, the automatic return time of the virtual companion is dynamically calculated based on the current actual reward distribution time; The automatic return time is calculated as follows: based on the current reward distribution time, a random remaining time value generated based on the destination category is superimposed. The random remaining time value is dynamically generated by the cascaded state regression model according to the destination category, which is used to realize the association and binding between the virtual companion's return time and the actual reward distribution time.

6. The asynchronous interaction triggering method for virtual companions based on multidimensional spatiotemporal constraints according to claim 1, characterized in that, When the preset execution time of the resource issuance instruction falls during a low-activity period at night, the execution time of the instruction is automatically shifted to a user-active period using a time-domain compensation algorithm, and then executed by the asynchronous scheduling engine. Specifically, this includes: After the resource issuance instruction is generated, a time-domain conflict check is performed on the preset execution time of the instruction. The time-domain conflict check includes determining whether the preset execution time falls within a preset low-activity period at night, wherein the low-activity period at night is from 02:00 to 06:

00. If it is determined that the preset execution time falls within the low-activity period at night, the sleep time domain compensation algorithm is triggered to automatically shift the instruction execution time. The shifting process involves adding a fixed time offset to the preset execution time to generate the actual execution time. The actual execution time after the shift is taken as the new scheduling time, and the instructions are pushed to the task queue by the time wheel algorithm through the asynchronous scheduling engine.

7. The asynchronous interaction triggering method for virtual companions based on multidimensional spatiotemporal constraints according to claim 1, characterized in that, The asynchronous interaction triggering method for virtual companions based on multidimensional spatiotemporal constraints also includes: When a user triggers a travel instruction from the virtual companion, the virtual companion's state is switched from the home state to the travel state via a Java state machine; While the virtual companion is in a travel state, the generated quiet period, reward window, and secondary compensation point are submitted to the asynchronous scheduling engine as delayed task parameters. When user behavior triggers a resource distribution instruction or the system performs a time-domain compensation shift, the asynchronous scheduling engine pushes the corresponding resource distribution task to the message queue based on the calculated actual execution time. The message queue is used to decouple task scheduling from task execution. After the resource distribution task is completed, the state machine switches the virtual companion's status from travel status back to home status based on the dynamically calculated automatic return time.

8. A virtual companion asynchronous interaction triggering system based on multidimensional spatiotemporal constraints, characterized in that, The virtual companion asynchronous interaction triggering system based on multidimensional spatiotemporal constraints includes: The parameter generation module is used to respond to the user's triggering of the virtual companion's travel command and dynamically generate nonlinear time parameters with random perturbation terms according to the preset destination category. The nonlinear time parameters include a quiet period, a reward window, and a secondary compensation point. The behavior monitoring module is used to monitor the user's access behavior in real time within the reward window based on a sliding window counting mechanism, and to count the frequency of the user's access within the reward window. The trigger calculation module is used to generate a resource distribution instruction and dynamically calculate the automatic home time of the virtual companion when the access frequency is detected to reach a preset trigger threshold, combined with whether the current time is within the reward window. The time-domain compensation module is used to automatically shift the execution time of the resource issuance instruction to the user's active period through a time-domain compensation algorithm when the preset execution time of the instruction falls into the low-activity period at night, and then execute the instruction issuance by the asynchronous scheduling engine.

9. A terminal, characterized in that, The terminal includes: a memory, a processor, and a virtual companion asynchronous interaction triggering program based on multidimensional spatiotemporal constraints stored in the memory and executable on the processor. When the virtual companion asynchronous interaction triggering program based on multidimensional spatiotemporal constraints is executed by the processor, it implements the steps of the virtual companion asynchronous interaction triggering method based on multidimensional spatiotemporal constraints as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a virtual companion asynchronous interaction triggering program based on multidimensional spatiotemporal constraints, which, when executed by a processor, implements the steps of the virtual companion asynchronous interaction triggering method based on any one of claims 1-7.