A state management method, a state management system and a computer readable storage medium

By predefining the running state, obtaining various contextual information, and dynamically switching states based on rules, the problems of resource waste and insufficient adaptability in existing technologies are solved, achieving more efficient resource utilization and personalized state management, and improving the user experience.

CN122309159APending Publication Date: 2026-06-30亓泽辰

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
亓泽辰
Filing Date
2026-03-31
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing technologies suffer from resource waste, rigid operation, and insufficient adaptability. They also lack the ability to comprehensively perceive and dynamically adjust multi-dimensional information, resulting in a disconnect between system behavior and user needs, and low resource utilization efficiency.

Method used

By predefining multiple running states and acquiring various contextual information, the target state is dynamically determined and state switching is executed based on the transition rules. This includes a state definition module, a context awareness module, a state transition engine, and a behavior strategy library, enabling multi-dimensional state management.

Benefits of technology

Optimize resource utilization efficiency, reduce unnecessary operational interference, improve system adaptability and user experience, and achieve more accurate state transitions and personalized adaptation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122309159A_ABST
    Figure CN122309159A_ABST
Patent Text Reader

Abstract

In various software systems, hardware devices, or applications, it is often necessary to adjust their behavior patterns based on the operating environment, user behavior, or internal state. However, existing technologies suffer from drawbacks such as resource waste, inappropriate response timing, monotonous behavior patterns, and a lack of personalized adaptation. While some simple energy-saving mechanisms exist (such as timed hibernation and fixed-frequency polling), a dynamic state management scheme based on multi-dimensional context has not yet been developed. This application provides a state management method, a state management system, and a computer-readable storage medium, aiming to provide a method capable of sensing context and dynamically switching operating states to improve resource utilization, responsiveness, and personalized experience. This method is applicable to various software systems or hardware devices requiring state management, enabling the target object to dynamically switch operating states based on multi-dimensional information and exhibit differentiated behavior patterns in different states.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer software and intelligent control systems, and more specifically, to a state management method, a state management system, and a computer-readable storage medium. Background Technology

[0002] During the operation of software systems, hardware devices, and applications, the adjustment of the target object's behavior pattern has a crucial impact on resource utilization efficiency and user experience. Current technical solutions generally rely on fixed thresholds or simple triggering mechanisms, such as timed sleep functions based on a single time parameter or background polling strategies with a fixed frequency. Such methods have significant limitations: when the target object is in a state of prolonged user inactivity or low system load, it still maintains high activity, leading to continuous consumption of computing resources such as the central processing unit, memory, and power. This resource waste is particularly prominent in resource-constrained scenarios such as mobile terminals or IoT devices. At the same time, the system lacks the comprehensive perception capability of changes in the operating environment and cannot identify multi-dimensional factors such as user rest patterns, ambient light intensity, or network status. It often initiates unnecessary proactive behaviors during user rest periods or device idle periods, such as popping up non-urgent notifications at night or performing high-energy-consuming operations when the battery is low, causing user interference and exacerbating resource consumption. In addition, the behavior pattern design of existing technologies is too rigid and fails to achieve differentiated adjustments based on dynamic information such as time, interaction frequency, internal state parameters, and external environment. For example, it cannot automatically reduce interface brightness at night or reduce frequency in time when the device is detected to be overheating. A deeper problem lies in the significant differences in user habits and device deployment environments. Existing solutions lack the ability to learn from historical interaction data, making it difficult to adapt to personalized needs. This leads to a disconnect between system behavior and actual scenarios, manifesting as sluggish responses, low energy efficiency, and insufficient user satisfaction. Although some products have introduced basic energy-saving mechanisms, they only optimize a single dimension and have not yet formed a multi-dimensional dynamic state management framework that integrates time information, external interaction information, environmental information, and internal state information. Consequently, they cannot meet the dual needs of resource optimization and natural interaction in complex scenarios.

[0003] To address the aforementioned issues, existing technologies urgently need improvement. Summary of the Invention

[0004] The purpose of this application is to provide a state management method, a state management system, and a computer-readable storage medium, which has the advantages of effectively optimizing resource utilization efficiency, reducing unnecessary operational interference, and improving system adaptability and user experience by predefining multiple operating states and dynamically switching states based on various context information.

[0005] This application provides a state management method, the technical solution of which is as follows: Includes the following steps: Multiple runtime states of a predefined target object; Obtain at least two different contextual information; Based on preset conversion rules, the target state is dynamically determined using at least two different contextual information. When the target state is different from the current state, a state switch is performed.

[0006] Furthermore, this application also proposes that the operating state includes at least two different operating modes, with different frequencies of proactive behavior and response methods of the target object in different modes.

[0007] Furthermore, this application also proposes that different operating modes include, but are not limited to, at least two of the following: active mode, energy-saving mode, and scene adaptation mode; wherein, in active mode, the target object responds to external input in real time and has a high frequency of active behavior; in energy-saving mode, the target object does not initiate behavior and has a low frequency of background processing; and in scene adaptation mode, the target object executes preset behavior for a specific scene.

[0008] Furthermore, this application proposes that the context information be selected from at least two different types, including but not limited to time information, external interaction information, environmental information, and internal state information.

[0009] Furthermore, this application also proposes that the conversion rules include, but are not limited to, at least one of time-triggered rules, external interaction-triggered rules, environment-triggered rules, internal demand-triggered rules, or relationship parameter adjustment rules.

[0010] Furthermore, this application also proposes that the internal demand triggering rule includes: when the internal state parameters of the target object meet predetermined conditions, it triggers entry into a specific state.

[0011] Furthermore, this application also proposes to include: after a state transition, adjusting the behavior strategy of the target object to a behavior strategy corresponding to the target state.

[0012] Furthermore, this application also proposes to include storing state transition events in a storage module for the target object to learn patterns.

[0013] Furthermore, this application also proposes, including: The state definition module is used to predefine multiple running states of a target object; A context-aware module is used to acquire at least two different types of context information; The state transition engine is used to dynamically determine the target state and perform the transition according to preset rules.

[0014] Furthermore, this application also proposes to include a behavior strategy library for storing behavior strategies corresponding to different operating states, and adjusting the behavior strategy of the target object after a state switch.

[0015] Furthermore, this application also proposes to include a state persistence module for recording the current state and transition history.

[0016] Furthermore, this application also proposes to include a configuration interface for receiving user-defined conversion rules.

[0017] Furthermore, this application also proposes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method.

[0018] As can be seen from the above, the state management method, state management system, and computer-readable storage medium provided in this application, through steps including predefining multiple operating states, acquiring at least two different context information, dynamically determining the target state based on transition rules, and performing state switching, can intelligently adjust the state according to multiple context information, thereby solving the problems of resource waste, rigid operation, and insufficient adaptability in the prior art. It has the advantages of effectively optimizing resource utilization efficiency, reducing unnecessary operational interference, and improving system adaptability and user experience by predefining multiple operating states and dynamically switching states based on multiple context information. Attached Figure Description

[0019] Several embodiments of this application are described below with reference to the accompanying drawings. It should be noted that the specific structures, modules, steps, parameters, and connections shown in the drawings are preferred embodiments of this application and not limitations on the scope of protection of this application. Those skilled in the art can make various modifications, substitutions, or combinations to the specific details shown in the drawings based on the teachings of this application, and these modified embodiments should still be considered to fall within the scope of protection of this application.

[0020] Figure 1 This application provides an overall architecture diagram of a status management system, which is an exemplary architecture of the status management system of this application. Each module can be adjusted according to the actual application scenario, and does not limit the scope of protection.

[0021] Figure 2 This diagram illustrates a state transition rule provided for this application. The rule shown is merely an example; the actual rule can be configured according to the application scenario and does not constitute a limitation on the claims.

[0022] Figure 3 This application provides a typical state behavior sequence diagram. The diagram shows an example of the system's interaction with the outside world in each state. The specific behavior can be designed according to the application scenario. Detailed Implementation

[0023] 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 a part of the embodiments of this application, and not all of them. 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 the claimed 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. Other technologies that may be mentioned in the embodiments can be implemented using existing technology or other patent applications filed by the applicant on the same day, and will not be repeated here. It should be particularly noted that the specific module divisions, process steps, data flow directions, status names, time values, etc., shown in the accompanying drawings are merely illustrative examples and should not constitute a limitation on the scope of protection of the claims of this application. The scope of protection of the claims is determined solely by their wording and should be interpreted in accordance with the overall content of the specification.

[0024] 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, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0025] In traditional state management systems, the lack of a multi-dimensional context-aware mechanism leads to high activity levels during periods of low user interaction or low load, resulting in redundant consumption of computing resources. State switching decisions rely on single-dimensional information, failing to accurately match changes in the operating environment and user behavior patterns, leading to inappropriate response timing. Fixed behavioral strategies cannot be dynamically adjusted based on time, interaction history, internal states, and environmental factors, resulting in a monotonous behavior pattern. Furthermore, the lack of modeling of user habit differences results in a lack of personalized adaptability. Specifically, redundant resource consumption reduces system energy efficiency and device battery life; inappropriate response timing impairs user interaction experience; monotonous behavior patterns limit the system's applicability in diverse scenarios; and the lack of personalization leads to inefficient resource allocation.

[0026] For example, in smart assistant applications, when a user enters their nighttime rest period and the device's battery level is below a threshold, the time context and internal state context are not effectively recognized, and the system continues to perform high-frequency background refreshes and proactive notification pushes; the interaction context shows that the recent interaction time exceeds a preset threshold, but the system does not reduce the frequency of behavior; the ambient light intensity is below a threshold, and the interface brightness is not automatically dimmed. As a result, the system maintains an active state in low-power demand scenarios, causing unnecessary power consumption; it triggers disruptive behavior during the user's rest period; and it fails to learn the user's sleep habits based on historical interaction data, leading to a disconnect between behavioral strategies and actual needs. Furthermore, this problem results in decreased device battery life, reduced user satisfaction, and deterioration of overall system efficiency.

[0027] If the above problems are not addressed, the system will continuously maintain a high resource consumption state during unnecessary periods, exacerbating the waste of computing resources; inaccurate state switching decisions will frequently trigger user interference events, reducing system reliability; fixed behavior patterns cannot adapt to dynamic environmental changes, limiting the system's deployment capabilities in complex scenarios; and the lack of personalized adaptation mechanisms will lead to inefficient resource allocation, failing to meet diverse user needs. Consequently, system reliability, maintainability, and user experience will be significantly reduced, potentially causing functional anomalies, especially in resource-constrained devices and mission-critical systems.

[0028] To address this, this application provides a state management method, comprising the following steps: Multiple runtime states are predefined in the target object; At least two different types of context information are obtained; The target state is dynamically determined based on preset transition rules and at least two different contextual information. A state transition is performed when the target state differs from the current state.

[0029] For ease of understanding, the following explains some key terms in this embodiment: A target object refers to an entity that requires state management. Its scope is broad, including a software system, a hardware device, an application, a digital entity, a virtual character, a robot, an IoT device, or a factory control system, among others. Through state management mechanisms, target objects can adjust their behavior patterns based on external or internal conditions.

[0030] An operational state refers to a set of behavioral characteristics exhibited by a target object in a specific context. These states can be predefined, such as active states, low-power states, or special scenario states. Under different operational states, the frequency of the target object's proactive behavior, response methods, and resource consumption can all differ, thereby achieving differentiated behavioral performance.

[0031] Contextual information refers to multi-dimensional data related to the target object's operating environment or its own state. This information can be collected or acquired in real time, and includes, for example, time information (such as current time and date), external interaction information (such as user input frequency), environmental information (such as light intensity and temperature), and internal state information (such as device battery level and system load). Contextual information is the basis for dynamically determining the target's state.

[0032] Transition rules refer to a set of pre-defined logic or conditions used to guide a target object to switch from one running state to another. These rules can be triggered based on different contextual information, such as time-triggered rules, external interaction-triggered rules, environment-triggered rules, or internal requirement-triggered rules. Transition rules ensure the rationality and automation of state transitions.

[0033] The target state refers to the dynamically determined running state that the target object is about to enter, based on the current context information and transition rules. It represents the ideal behavioral pattern that the system should adopt in a specific situation.

[0034] The current state refers to the actual running state of the target object at a certain moment. It is the benchmark for comparison with the target state. A state transition operation is only required when the target state is different from the current state.

[0035] State transition refers to the process by which a target object changes from its current state to a target state. This process is usually accompanied by adjustments to the target object's behavioral strategies to adapt to the behavioral patterns corresponding to the new operating state.

[0036] This embodiment provides a state management method, the main feature of which is to achieve intelligent state adjustment of the target object through a series of steps.

[0037] First, predefine multiple operational states for the target object. This step aims to provide a basis for diverse behavioral patterns for the target object. For example, two basic states can be manually configured, such as "working state" and "idle state." In the "working state," the target object is set to perform its primary functions; in the "idle state," the target object is set to reduce activity. Alternatively, multiple states can be defined, such as "mode A," "mode B," and "mode C," but the detailed behavioral differences between these states may require manual adjustment later. By predefining these states, the target object is given the possibility of switching behavioral modes in different contexts.

[0038] Secondly, acquire at least two different types of contextual information. This step aims to enable the target object to perceive multi-dimensional changes in its operating environment or its own state. For example, it can manually input current time information (such as "daytime" or "nighttime") and external interaction information (such as "user action" or "no user action"). Alternatively, it can acquire two independent pieces of information through simple sensors or interfaces, such as obtaining the current time period from a timer and whether there is user input from an input detector. This acquired contextual information will serve as the basis for subsequent state decisions.

[0039] Next, based on preset transition rules and at least two different contextual information points, the target state is dynamically determined. This step aims to ensure the rationality and adaptability of the state switching decision. For example, a simple mapping table can be established to directly map a combination of specific time information and external interaction information to a predefined target state. Specifically, if the time information indicates "night" and the external interaction information indicates "no user operation," then it is mapped to "sleep state." Alternatively, a series of fixed conditional statements can be used, such as "if the time is night and there is no user interaction, then the target state is energy saving." Through these preset rules, the system can deduce the ideal operating state that the target object should enter based on real-time context information.

[0040] Finally, when the target state differs from the current state, a state transition is performed. This step aims to optimize resource utilization by triggering state change operations only when necessary. For example, if the dynamically determined target state is "energy-saving mode," and the target object is currently in "active mode," the system will perform a transition from "active mode" to "energy-saving mode." Conversely, if the target state is the same as the current state, no operation is performed to avoid unnecessary system overhead. The execution of a state transition can simply involve changing a state identifier within the target object.

[0041] The following example will provide a more detailed explanation of the above technical solution: Suppose there exists a smart device, such as a smart speaker, which may face problems such as resource waste, inappropriate response timing, and limited behavioral patterns under traditional operating modes. To solve these problems, the state management method proposed in this embodiment can be applied to this smart speaker.

[0042] First, several operating states are predefined for this smart speaker. For example, "active mode" and "silent mode" can be predefined. In "active mode," the smart speaker is set to listen to voice commands in real time and can actively broadcast notifications; while in "silent mode," the smart speaker is set to only respond to specific wake words and pause unnecessary notification broadcasts. These predefined states provide a basis for the smart speaker to adjust its behavior in different situations.

[0043] Secondly, smart speakers continuously acquire at least two different types of contextual information. Specifically, they can acquire time information, such as whether it is currently "daytime" (e.g., 7:00 AM to 10:00 PM) or "nighttime" (e.g., 10:00 PM to 7:00 AM). Simultaneously, they can acquire external interaction information, such as whether a user has issued voice commands or performed other operations on the speaker in the past thirty minutes. By acquiring both types of contextual information simultaneously, smart speakers can gain a more comprehensive understanding of their environment and user activities.

[0044] Next, based on preset transition rules and at least two different contextual information points, the target state is dynamically determined. For example, one transition rule could be set: if the current time indicates "nighttime" and the external interaction information indicates "no user interaction," then the smart speaker's target state is determined to be "silent mode." Another rule could be: if the current time indicates "daytime" or the external interaction information indicates "user interaction," then the target state is determined to be "active mode." These rules enable the smart speaker to intelligently determine its ideal operating state based on real-time, multi-dimensional information.

[0045] Finally, when the target state differs from the current state, a state switch is executed. For example, if it is 11:00 PM and the smart speaker has not detected user interaction for a long time, the target state is determined to be "silent mode" according to the transition rules. If the smart speaker is currently in "active mode," the system will switch from "active mode" to "silent mode." This reduces the smart speaker's listening sensitivity and stops actively broadcasting notifications, thus reducing resource consumption and avoiding disturbing users at night. Conversely, when the user issues a "good morning" command to the smart speaker at 8:00 AM the next morning, the external interaction information changes to "user interaction," and the target state is determined to be "active mode." If the smart speaker is currently in "silent mode," the system will switch the state, restoring its ability to listen in real-time and actively broadcast notifications. Through this series of steps, the smart speaker can dynamically adjust its behavior based on user habits and environmental changes, achieving optimized resource utilization and more accurate responses.

[0046] Based on the example of the smart speaker described above, the state management method proposed in this embodiment demonstrates significant technical contributions.

[0047] Compared to the single operating mode typically used by traditional smart devices, this method provides smart speakers with multiple behavioral modes, such as "active mode" and "silent mode," through the step of "predefining multiple operating states of the target object." This allows smart speakers to move beyond a fixed working state and exhibit differentiated behaviors based on actual needs.

[0048] In terms of context awareness, traditional solutions may rely solely on a single time trigger or simple user input detection. However, this method, by "acquiring at least two different types of contextual information," such as simultaneously acquiring time information and external interaction information, enables smart speakers to perceive their environment and user activities more comprehensively and accurately. For example, time information alone may not be sufficient to accurately determine whether a user is asleep, but by combining it with no-interaction information, it can more reliably infer that the user may require a silent environment.

[0049] Traditional devices often employ fixed and inflexible rules for state decision-making. This method, however, achieves adaptive behavior in smart speakers by "dynamically determining the target state based on at least two different contextual information according to preset transition rules." For example, when there is no user interaction at night, the system can intelligently determine the target state as "silent mode," rather than maintaining high activity as traditional devices do. This dynamic decision-making mechanism significantly improves the system's intelligence level.

[0050] Ultimately, by executing a state switch when the target state differs from the current state, this method ensures the timeliness and effectiveness of state transitions. For example, a smart speaker automatically switches to "silent mode" at night, effectively solving the resource waste problem caused by traditional devices continuously operating at high power consumption at night, avoiding unnecessary notification interference, and improving the user experience. When the user interacts again during the day, the system can quickly switch back to "active mode," ensuring timely service response. Thus, this method overcomes the problems of resource waste, inappropriate response timing, monotonous behavior patterns, and lack of personalized adaptation in existing technologies, providing a more intelligent, efficient, and user-friendly state management solution.

[0051] In some of the solutions mentioned above in this application, a runtime state is proposed to manage the behavior of the target object. However, in this process, the definition of the runtime state may lack specific pattern distinctions, which makes it impossible to effectively adjust the behavior frequency and response mode of the target object in different situations, thereby failing to fully optimize resource utilization and improve user experience.

[0052] In this regard, this application further proposes that the operating state includes at least two different operating modes, with different frequencies of proactive behavior and response methods for the target object in different modes. Specifically, the "operating mode" refers to a set of behavioral characteristics of the target object in a specific context, which can encompass a comprehensive performance in terms of power consumption, performance, interaction style, behavioral strategy, and response method. For example, it can be defined as a high-power mode and a low-power mode, or a high-performance mode and a balanced mode, to adapt to different operating requirements. The "proactive behavior frequency" refers to the density at which the target object proactively initiates tasks, sends notifications, updates data, or performs other preset behaviors. For example, in one mode, the target object may check external input or perform data synchronization once per second; while in another mode, it may only perform this once per minute or longer. The "response method" refers to the target object's reaction speed, processing depth, or feedback form to external input or internal events. For example, in one mode, the target object can process in real time and provide detailed feedback immediately; while in another mode, it may delay processing, provide only summary feedback, or respond only under specific conditions.

[0053] This solution refines the predefined operating states of the target object into at least two different operating modes, and sets different active behavior frequencies and response methods for each mode, enabling more granular behavior control in state management. When the system dynamically determines the target state based on context information and transition rules and executes state switching, it is actually switching to an operating mode with specific behavioral characteristics. This patterned state definition allows the target object's subsequent behavior (such as the frequency of proactive interactions and the speed of response to user commands) to automatically adapt to the current mode's settings after entering a certain state. For example, when the system determines that it needs to enter an energy-saving state, it switches to the preset energy-saving mode. In this mode, the target object's proactive behavior frequency automatically decreases, and the response method is adjusted to a more resource-efficient approach. This mechanism ensures that state switching is not merely a change in name, but a substantial adjustment in behavior, thus effectively solving the problem of single behavioral patterns and ineffective adjustment in traditional state management.

[0054] The following is a concrete example. Taking a smart home device as an example, this device needs to adjust its operating status according to the family members' schedules and environmental changes. As a specific implementation method, this smart home device can preset two operating modes: an "active mode" and a "sleep mode." In "active mode," the device's proactive behavior is more frequent; for example, it actively detects indoor environmental parameters (such as temperature, humidity, and light intensity) every few seconds and responds to user voice commands in real time, providing immediate feedback. When a family member enters sleep mode, and the system determines that it needs to switch to "sleep mode" based on time and environmental information (such as the bedroom lights turning off), the device's proactive behavior frequency will significantly decrease. For example, it may only detect environmental parameters once per hour, and its response to voice commands will become softer or delayed to avoid emitting excessive noise or light that might disturb the user's rest.

[0055] Through the above technical solution, this application effectively solves the problem of the lack of specific mode distinctions in the definition of operating states in traditional state management. By introducing at least two different operating modes and clearly defining the frequency of proactive behavior and response methods of the target object under different modes, the target object can achieve fine-grained adjustment of its behavior mode according to the dynamically determined target state. This not only avoids the waste of resources caused by maintaining high activity when unnecessary (e.g., reducing the frequency of proactive behavior and response speed in energy-saving mode to effectively extend device battery life and reduce energy consumption), but also ensures that the target object can work in a high-frequency and fast-response manner when high-efficiency response is required, thereby significantly improving resource utilization efficiency and the accuracy and comfort of user experience. This patterned state management enables the target object to more intelligently adapt to various complex and ever-changing application scenarios.

[0056] In some of the solutions mentioned above in this application, a running mode is proposed to dynamically adjust the behavior frequency and response mode of the target object according to the context. However, in the implementation process, the specific types and characteristics of the running mode are not clearly defined, which may result in inflexible state switching and inability to effectively adapt to diverse scenario requirements, such as insufficient resource optimization or inaccurate response timing.

[0057] In response, this application further proposes different operating modes, including but not limited to at least two of the following: active mode, energy-saving mode, and scene adaptation mode; wherein, in active mode, the target object responds to external input in real time and has a high frequency of active behavior; in energy-saving mode, the target object does not initiate behavior and has a low background processing frequency; in scene adaptation mode, the target object performs preset behavior for a specific scene.

[0058] In this context, "active mode" refers to a highly active and responsive operating state for the target object. In this mode, the target object continuously listens for and processes external inputs in real time, such as user actions, sensor data, network requests, or other system events, ensuring immediate feedback. Furthermore, the high frequency of proactive behavior means that the target object can frequently initiate its own actions, such as proactively pushing information, performing periodic tasks, collecting data, or initiating interactions with other entities. This mode can be implemented using techniques such as event-driven mechanisms, high-frequency polling, or interrupt-response mechanisms.

[0059] Energy-saving mode refers to a low-power, low-activity operating state for the target device. In this mode, the target device significantly reduces the frequency of its active behaviors, such as pausing unnecessary background tasks, reducing data synchronization frequency, reducing network communication, or entering a sleep state. Low background processing frequency can be achieved by reducing the processor clock speed, shutting down some hardware modules, reducing sensor sampling intervals, or extending the system wake-up cycle, in order to minimize resource consumption and extend device battery life.

[0060] Scene-adaptive mode refers to a set of pre-set or dynamically adjusted behavioral strategies executed by a target object based on its specific environment or user context. This mode allows the target object to exhibit customized behavior for specific scenarios (such as users sleeping, in meetings, driving, exercising, or working). Pre-set behaviors may include adjusting interface brightness, muting notifications, playing specific content, activating specific functions, changing interaction styles, or adjusting performance parameters. Its implementation can be based on pre-configured rule sets, scene recognition and matching using machine learning models, or user-defined preference settings.

[0061] This application's solution predefines multiple operating states of the target object and specifically represents these states as at least two different operating modes, such as active mode, energy-saving mode, and scene-adaptive mode. The context-aware module continuously acquires at least two different types of contextual information, such as time information, external interaction information, environmental information, and internal state information. The state transition engine dynamically determines the most suitable target state for the current context based on these contextual information and preset transition rules. When the determined target state differs from the current state, the system performs a state switch. Crucially, by specifying that in active mode the target object responds to external input in real time and has a high frequency of active behavior, in energy-saving mode the target object does not initiate behavior and has a low background processing frequency, and in scene-adaptive mode the target object performs preset behaviors for specific scenarios, the state transition engine can accurately select the behavior mode that best meets the current requirements based on multi-dimensional contextual information when switching states. For example, when context information indicates that the user is actively using the device, the system switches to active mode to ensure high responsiveness and high frequency of actions; when context information indicates that the device is idle or has low battery, the system switches to energy-saving mode to reduce resource consumption; when context information indicates that a specific scenario has been entered (such as nighttime), the system switches to scenario-adaptive mode to execute preset specific behaviors. This specific and differentiated mode definition makes state management no longer a simple on / off switch, but an intelligent switch between various refined behavior modes based on multi-dimensional context information. This effectively solves the problems of single operating mode, inflexible state switching, insufficient resource optimization, or inaccurate response timing in traditional solutions.

[0062] As a specific implementation method, a smart speaker can be used as an example. When the smart speaker detects that the user frequently interacts with the speaker during the day, such as asking about the weather, playing music, or controlling smart home devices, the system will switch its operating mode to active mode. In this mode, the smart speaker will listen for wake words in real time, respond to user commands immediately, and may proactively recommend news or music. When the user has not interacted with the speaker for a long time at night, and contextual information (such as time information, external interaction information) indicates that the user may have entered a sleep state, the system will switch its operating mode to energy-saving mode. In this mode, the smart speaker will reduce the background processing frequency and only retain the low-power wake word listening function to reduce power consumption. In addition, if the user sets a "sleep mode" in the smart speaker or the system determines that it is late at night based on the time information, the smart speaker's operating mode can switch to scene adaptation mode. In this mode, the speaker will perform preset sleep assistance behaviors, such as automatically lowering the volume, turning off the screen display, playing sleep-aiding music, and playing a gentle alarm clock at a preset wake-up time to adapt to the user's sleep habits.

[0063] Through the aforementioned technical solutions, this application optimizes the active mode, energy-saving mode, and scenario-adaptive mode, along with their respective behavioral characteristics, enabling the state management system to perform more refined and intelligent state switching based on multi-dimensional contextual information. The active mode ensures that the target object can respond in real-time and maintain a high frequency of active behavior in scenarios with high interaction demands, significantly improving user experience and system response efficiency. The energy-saving mode allows the target object to effectively reduce background processing frequency and unnecessary active behavior in idle or low-load situations, thereby greatly optimizing resource consumption, extending device battery life, and reducing operating costs. The scenario-adaptive mode allows the target object to execute preset customized behaviors for specific usage scenarios, greatly enhancing the system's personalized adaptability and intelligence level, avoiding untimely interference, and improving user satisfaction. Overall, this specific definition of operating modes effectively solves the problems of single operating modes, inflexible state switching, insufficient resource optimization, and inaccurate response timing in traditional solutions, achieving a comprehensive improvement in resource utilization, naturalness of response, and personalized experience.

[0064] In some of the solutions described above in this application, contextual information is proposed to dynamically determine the target state. However, during implementation, the acquired contextual information may not be comprehensive or diverse enough to fully reflect multidimensional environmental changes, affecting the accuracy and personalized adaptation of state transitions. Therefore, this application further proposes that the contextual information be selected from at least two different types, including but not limited to time information, external interaction information, environmental information, and internal state information.

[0065] Specifically, the time information refers to data reflecting the time dimension of the target object, such as the current date, day of the week, specific time period (e.g., morning, afternoon, night), or more detailed user-defined work and rest time periods (e.g., work hours, rest hours, sleep hours), and specific holiday information. This information can be obtained through system clock, calendar service, or user configuration. The external interaction information refers to data on interactions between the target object and external entities (e.g., users, other software systems, or external hardware devices). This can include the frequency of interactions (e.g., density of user clicks, voice commands), the time of the most recent interaction, and the characteristics of the interaction content (e.g., keywords entered by the user, type of command executed). This information is typically obtained by listening to user input, system calls, or communication interfaces. The environmental information refers to objective data about the physical or virtual environment in which the target object is located. Examples include geographic location information (obtained through GPS, Wi-Fi positioning, or base station positioning), weather conditions (e.g., temperature, humidity, light intensity, rainfall), and network status (e.g., Wi-Fi connection status, mobile data signal strength, network latency) or noise level. This information is typically obtained through sensors, network interfaces, or external service interfaces. The internal state information refers to the target object's own operational or physiological state data. For example, for hardware devices, this could be battery level, CPU load, memory usage, and storage space occupancy; for software systems, it could be response time, error rate, and background task queue length; for virtual characters, it could be emotion value, energy value, and need value. This information is typically obtained through system monitoring interfaces, internal variables, or sensor data. By selecting at least two different types of contextual information, the state management system ensures that it can perceive the complex environment and its own condition from multiple dimensions, avoiding the limitations that may arise from a single information source.

[0066] This application's solution significantly enriches the decision-making basis of the state transition engine by acquiring at least two different types of contextual information. Based on multiple predefined operating states of the target object, the system no longer relies solely on single-dimensional information but comprehensively considers data from multiple aspects, including time, external interactions, environment, and internal state. For example, when the system needs to dynamically determine the target state, it simultaneously analyzes current time information (e.g., whether it is late at night), external interaction information (e.g., user inactivity for an extended period), environmental information (e.g., device in a static state), and internal state information (e.g., low battery power). This multi-dimensional information fusion enables the system to more accurately judge the target object's current real-world situation and needs, thereby dynamically determining the most suitable target state according to preset transition rules. When the determined target state differs from the current state, the system executes a state switch. This mechanism ensures more accurate and intelligent state transition decisions, effectively solving the problems of inaccurate state transitions, inability to fully reflect multi-dimensional environmental changes, and insufficient personalized adaptability caused by incomplete or diverse contextual information in traditional solutions.

[0067] The following is a concrete example. Taking a mobile application on a smartphone as an example, this application needs to dynamically adjust its background behavior and notification strategies based on user habits and device status. As a specific implementation, the application can simultaneously obtain at least two different types of contextual information: First, time information, such as the current time being 11 PM to 7 AM (the user's typical sleep time). Second, external interaction information, such as detecting that the user has not interacted with the application in the past 30 minutes. Third, internal status information, such as the phone's battery level being below 20%. Finally, environmental information, such as the phone being stationary and the light sensor detecting low ambient light. Once this contextual information is obtained by the perception module, the state transition engine will make a judgment based on preset transition rules. For example, the rule might be set as: "If the current time is during sleep time AND the user has not interacted for a long time AND the battery level is low, then switch to 'Deep Power Saving Do Not Disturb Mode'." In this mode, the application will pause all unnecessary background refreshes and push notifications, and reduce CPU usage to extend battery life and avoid disturbing the user. When the user picks up their phone and opens the app again the next morning, the external interaction information (user interaction) and time information (non-sleep period) will change. The system will then dynamically determine the target state again and may switch back to "active mode" to restore normal functionality.

[0068] Through the above technical solutions, the system can acquire more comprehensive and richer contextual information, thereby more accurately perceiving the complex environment and its own condition within the target object. This makes the decision-making basis for state transitions more sufficient and reliable, significantly improving the accuracy and adaptability of dynamically determining the target state. Ultimately, it effectively solves the problem in traditional solutions where insufficient or diverse contextual information fails to fully reflect multidimensional environmental changes, affecting the accuracy of state transitions and personalized adaptation. This enables the target object to make more intelligent and personalized behavioral adjustments based on the actual situation.

[0069] In some of the solutions described above in this application, transition rules are proposed to dynamically determine the target state based on context information. However, in their implementation, these transition rules may lack specific type definitions, failing to efficiently cover multiple triggering scenarios, resulting in inaccurate or insufficiently adaptable state switching, affecting resource optimization and response timing. To address this, this application further proposes transition rules including, but not limited to, at least one of the following: time-triggered rules, external interaction-triggered rules, environment-triggered rules, internal demand-triggered rules, or relationship parameter adjustment rules.

[0070] Time-triggered rules refer to rules that trigger state transitions based on preset time conditions. For example, it's possible to set a specific time period each day (such as 10:00 PM to 6:00 AM the next day) to automatically switch a target object to energy-saving mode, or to switch it to active mode during weekdays. These rules can be implemented based on the system clock, calendar events, or user-defined schedules.

[0071] External interaction trigger rules refer to rules that trigger state transitions based on the interaction behavior between a target object and external entities (such as users, other systems, or devices). For example, when a user has not interacted with the target object for an extended period, it can trigger a low-power state; when user input (such as a click or voice command) is detected, it can trigger an active state. Implementation methods may include listening to user interface events, receiving external API calls, or analyzing communication data streams.

[0072] Environment-triggered rules refer to rules that trigger state transitions based on changes in the environment in which the target object is located. For example, when the ambient light dims, the target object can be triggered to reduce screen brightness or enter night mode; when the device is detected to be in a specific geographical location, it can be triggered to enter scene adaptation mode. The implementation of such rules can rely on sensor data (such as light sensors, temperature sensors), geographical location information (such as GPS, Wi-Fi positioning), or changes in network status.

[0073] Internal demand triggering rules refer to rules that trigger state transitions based on whether the internal state parameters of a target object meet predetermined conditions. For example, when the target object's battery level falls below a certain threshold, it can trigger the entry into power-saving mode; when the system load is too high, it can trigger the entry into performance optimization mode. Implementation methods may include monitoring system resource utilization (such as CPU and memory), battery level information reported by the battery management unit, or the status of the internal task queue.

[0074] Relationship parameter adjustment rules refer to rules that trigger state transitions based on relationship parameters between a target object and other entities or task priorities. For example, when a high-priority task needs to be processed, the target object can switch from a low-power state to an active state; when the interaction frequency with a specific user decreases, the target object's response strategy can be adjusted. The implementation of such rules can involve task scheduling priority determination, user behavior pattern analysis, or preset strategy configuration.

[0075] This application's solution introduces multiple types of transition rules, making the basis for state transitions richer and more refined. In the aforementioned state management method, by predefining multiple operating states of the target object and acquiring at least two different types of contextual information, combined with these specific transition rules, the target state can be more accurately determined dynamically based on the contextual information. For example, time-triggered rules ensure state adjustments are made within specific time periods, external interaction-triggered rules respond promptly to user behavior, environment-triggered rules enable the target object to adapt to external conditions, internal demand-triggered rules guarantee the stable operation of the system itself, and relational parameter adjustment rules further optimize task processing priorities. These rules can be used individually or in combination, forming a multi-dimensional, highly adaptable state transition mechanism that allows the target object to intelligently select the most suitable operating state based on complex and ever-changing realities. This mechanism not only improves the accuracy of state switching but also enhances the system's adaptability to different scenarios.

[0076] The following is a concrete example. Taking a smart home device as an example, this device has predefined operating states such as "active mode," "energy-saving mode," and "night mode." This device can obtain time information (such as current time and date), external interaction information (such as user voice commands and mobile app operations), and environmental information (such as indoor light intensity and whether anyone is moving).

[0077] As one specific implementation, the device can be configured with the following conversion rules: 1. Time Trigger Rule: Set to switch to "Night Mode" every night at 23:00, regardless of the current mode. At this time, the device retains only the minimum functions, such as mute and turn off the indicator lights.

[0078] 2. External interaction triggering rules: When the device is in "Night Mode", if it detects that the user issues a voice command "Turn on the living room light", the device will immediately switch to "Active Mode" to respond to the command. After the operation is completed, if there is no further interaction, it will automatically switch back to "Night Mode" after 5 minutes.

[0079] 3. Environmental Trigger Rules: When the device is in "Active Mode" and the indoor light intensity sensor detects that the light is below a preset threshold for 10 consecutive minutes (for example, when the user leaves the room), the device can switch to "Energy Saving Mode" to reduce the processor frequency and reduce unnecessary background tasks.

[0080] 4. Internal demand triggering rules: When the device detects that its own battery power is below 20%, regardless of the current mode, the device will be forced to switch to "energy saving mode" and restrict the use of some high-power-consuming functions.

[0081] 5. Relationship parameter adjustment rules: If the device is connected to a family member's mobile APP and a "Do Not Disturb" period is set in the APP, the device will prioritize "Night Mode" or "Energy Saving Mode" during the Do Not Disturb period, even if there is external interaction, unless it is an emergency security alarm.

[0082] By combining the above rules, the smart home device can flexibly and intelligently adjust its operating mode according to various factors such as time, user behavior, environmental changes, and its own status, thereby achieving more efficient resource management and a more user-friendly experience.

[0083] Through the above technical solution, the target object can switch states based on multi-dimensional context information and specific transition rules, effectively solving the problems of single transition rule types and insufficient scenario coverage in traditional solutions. This makes state switching more precise and adaptable, thereby significantly optimizing resource utilization, avoiding unnecessary resource waste, and ensuring that the target object can respond in the most appropriate way in different scenarios, improving overall operational efficiency and user experience.

[0084] In some of the solutions mentioned above in this application, internal demand triggering rules are proposed to trigger state switching based on the internal state parameters of the target object. However, in the implementation process, the specific implementation of the rules lacks clear definition, which may lead to unclear triggering conditions, inaccurate or untimely state switching, and affect the resource optimization efficiency and response accuracy of the system.

[0085] In this regard, this application further proposes an internal demand triggering rule, which includes: when the internal state parameters of the target object meet predetermined conditions, it triggers entry into a specific state.

[0086] An internal demand trigger rule is a type of transition rule, the core of which lies in initiating a state transition based on the inherent conditions or needs of the target object itself. This rule can be implemented based on threshold monitoring of internal parameters, for example, triggering when an internal indicator exceeds or falls below a specific value; it can also be driven by detecting specific internal events, such as when an internal task is completed or fails. The internal state parameters of the target object refer to quantifiable indicators reflecting the target object's operating status, resource consumption, or functional state. These parameters may include, but are not limited to, CPU utilization, memory usage, disk I / O rate, network latency, error rate, queue length, or number of processes for software systems; for hardware devices, they may be battery level, device temperature, remaining storage space, sensor data (such as accelerometer data used to determine activity status), or power consumption; for virtual characters, they may be their energy level, hunger level, emotional state, or task progress. The predetermined conditions are pre-set logical expressions or numerical ranges used to determine whether the internal state parameters meet the criteria for triggering a state transition. These conditions can be simple threshold judgments, such as "battery charge below 20%" or "CPU utilization above 80%"; or they can be more complex composite conditions, such as "temperature consistently above 60°C for more than 5 minutes" or "error rate exceeding 5% within 1 minute". When the predetermined conditions are met, a specific state is triggered, meaning the system will initiate a state transition process, switching the target object from its current state to a predefined new state. This can be achieved by sending a direct state change instruction to the state machine, sending an event signal to the state management engine, or updating a state variable monitored by the state controller.

[0087] This application addresses the problem of inaccurate state transitions caused by ambiguous rules in existing technologies by specifying the details of internal demand triggering rules. In the state management method, multiple operating states of the target object are predefined, and at least two different types of context information are acquired. Based on this, the target state is dynamically determined according to preset transition rules. When the target state differs from the current state, a state transition is executed. These transition rules may include internal demand triggering rules. This application further refines these internal demand triggering rules, making them no longer abstract concepts but concretely associated with the target object's internal state parameters and predetermined conditions. When the target object's internal state parameters, such as battery level, CPU usage, or device temperature, reach or exceed preset specific conditions, the system precisely triggers a state transition, causing it to enter a preset specific state. This mechanism ensures that state transitions no longer solely depend on external environment or time factors but intelligently respond to the target object's own internal needs and operating conditions. For example, when the device battery is too low, the system can automatically switch to power-saving mode; when the CPU is overloaded, it can switch to low-performance mode to avoid system crashes. This adaptive adjustment based on internal state enables the target object to manage its own resources more accurately, optimize operational efficiency, and respond to internal changes in a timely manner, thereby significantly improving the system's resource optimization efficiency and response accuracy.

[0088] The following example illustrates this. Consider a mobile application that needs to dynamically adjust its background behavior based on device status. The application can set its internal trigger rules to: when the device battery level drops below 15%, it will enter "low-power mode." In this mode, the application will pause unnecessary background data synchronization, batch process push notifications, and reduce the interface refresh rate. When the battery level recovers to above 20%, it can return to "normal mode."

[0089] Through the above technical solution, this application specifies the implementation details of the internal demand triggering rules, making the triggering conditions for state transitions concrete, quantifiable, and predictable. This ensures the accuracy and timeliness of state switching, avoiding resource waste and response delays caused by ambiguous rules. The target object can adaptively adjust according to its own internal health status and resource needs, thereby more effectively optimizing resource allocation, extending device battery life, improving system stability, and enhancing user experience.

[0090] In some of the solutions described above in this application, state switching is proposed to dynamically adjust the running state according to the context to optimize resource utilization and response timing. However, in this process, the behavior strategy of the target object may not be updated in time after the state switch, resulting in inconsistency between behavior and state, affecting resource optimization and response accuracy. To address this, this application further proposes that after the state switch, the behavior strategy of the target object be adjusted to the behavior strategy corresponding to the target state.

[0091] Here, "after state transition" refers to the moment when the target object transitions from one running state to another, or the point immediately following that moment. This can be achieved by the state transition engine immediately triggering the behavior strategy adjustment module after completing the state transition instruction, or through an event listener mechanism that initiates the strategy adjustment process immediately when a change in the target object's state attributes is detected. Alternatively, behavior strategy adjustment can be incorporated as part of the state transition process and executed as the final step in the state transition.

[0092] "Adjusting the behavior strategy of the target object" refers to configuring or modifying the target object's behavior pattern, response mechanism, resource consumption, etc., under a specific state. This can be achieved by loading a preset behavior configuration file or parameter set, for example, by calling a specific function or method associated with the target state from a behavior strategy library, or by updating the parameters of the target object's internal behavior control module.

[0093] "Behavioral strategies corresponding to the target state" refer to a set of predefined behavioral rules, parameters, or execution logic for a specific running state. For example, in a behavioral strategy library, a unique behavioral strategy can be stored for each predefined running state, or a mapping table can be used to associate the target state with the corresponding behavioral strategy. These behavioral strategies can be a structure or object containing multiple parameters, such as CPU utilization limit, network request frequency, UI refresh interval, etc.

[0094] This application's solution ensures that the target object's actual operating mode is completely consistent with the expected behavior mode of its current state by immediately adjusting its behavior strategy according to the new target state after the target object completes a state transition. Specifically, when the system dynamically determines the new target state based on context information and performs a state transition, this solution does not merely stop at changing the state identifier, but actively retrieves and applies a behavior strategy that matches the new target state. For example, if the target object switches from "active state" to "energy-saving mode," the system immediately adjusts its active behavior frequency, response mode, and background processing frequency, ensuring it truly enters a low-power operating state. This mechanism effectively avoids delays or mismatches between state transitions and behavior updates, enabling state management methods to more accurately optimize resources and adjust response timing. In this way, the target object can not only perceive environmental changes and dynamically adjust its own state, but also ensure that its behavior mode can reflect the requirements of the current state in a timely and accurate manner, thereby fully leveraging the advantages of context-aware state management.

[0095] The following example illustrates this. Taking a smart assistant application as an example, when the smart assistant has not detected user interaction for an extended period and the system determines that it should switch from "active state" to "energy-saving mode," the smart assistant will immediately adjust its behavior strategy after the state switch is completed. Specifically, it will adjust its proactive behavior frequency from high-frequency real-time response to not proactively initiating any behavior, while simultaneously adjusting its background processing frequency from high-frequency data processing to low-frequency periodic checks. For example, in "active state," the smart assistant might continuously listen for and process voice commands in real time, while after switching to "energy-saving mode," it might only perform wake word detection at specific time intervals or only respond to physical button triggers, thereby significantly reducing CPU and memory usage. Conversely, when the user interacts with the smart assistant again and the system switches its state back to "active state," the smart assistant will also immediately adjust its behavior strategy, restoring high-frequency real-time response and background processing to provide a smooth user experience.

[0096] Through the above technical solution, this application effectively solves the problem that the behavior strategy of the target object may not be updated in time after a state switch, leading to inconsistency between behavior and state. By ensuring that the behavior strategy of the target object is adjusted to the behavior strategy corresponding to the target state immediately after a state switch, this solution guarantees that the resource allocation and behavior pattern of the target object are always precisely matched with the current dynamic state. This not only truly optimizes resource utilization, such as effectively reducing power consumption in energy-saving mode, but also ensures that the system's response behavior in different contexts is timely and appropriate, thereby significantly improving the overall efficiency of the system and the user experience.

[0097] In some of the solutions mentioned above in this application, a state management method is proposed to dynamically switch states according to the context. However, in this process, there is a lack of recording of state transition events, which makes it impossible for the target object to learn historical patterns to optimize its behavior strategy.

[0098] In this regard, this application further proposes to include storing state transition events in a storage module so that the target object can learn the patterns.

[0099] In this context, a "state transition event" refers to a record of the target object's behavior as it transitions from one running state to another. This event typically includes, but is not limited to: a timestamp of the transition, the current state before the transition, the target state after the transition, contextual information triggering the transition (e.g., time information, external interaction information, environmental information, internal state information, etc.), and the transition rules used to execute the transition. A "storage module" refers to a hardware or software component used to persistently store data. Its implementation can vary; for example, it can be a non-volatile memory (such as flash memory, hard disk drive, solid-state drive), a database system (such as a relational database, NoSQL database), or a log file system. This module is responsible for receiving, recording, and managing state transition event data, ensuring that the data remains accessible after a system restart or power outage. Furthermore, "learning patterns" refers to the target object's ability to analyze historical state transition event data to identify patterns, trends, or causal relationships, thereby optimizing its state management strategies or behavioral patterns. This learning can help the target object better predict future state requirements, adjust the priority or parameters of transition rules, and even discover new and better state transition paths. The target object can learn patterns through various technical means. For example, machine learning algorithms (such as classification, clustering, reinforcement learning, etc.) can be used to identify the relationship between contextual information and state transitions; statistical analysis methods (such as frequency analysis, association rule mining) can be used to discover high-frequency transition patterns; or expert systems or rule reasoning engines can be used to automatically adjust or generate new transition rules based on historical data.

[0100] This application's solution introduces a mechanism for recording state transition events during the process of a target object dynamically determining its target state based on at least two different contextual information according to preset transition rules, and performing state switching when the target state differs from the current state. Specifically, whenever the target object completes a state transition, the system encapsulates the detailed information of this transition, including but not limited to the time of the transition, the state before the transition, the state after the transition, the contextual information that triggered the transition, and the transition rules used, as a state transition event and stores it in a preset storage module. In this way, the system can continuously accumulate historical state transition data of the target object under different contexts. This persistently stored event data provides the target object with a valuable experience base. The target object can periodically or under specific conditions access this historical data and use data analysis or machine learning techniques to identify the inherent patterns and regularities of state transitions. For example, it can analyze which contextual combinations frequently lead to specific state transitions, or which transition rules show higher effectiveness within a specific time period. Based on these learned patterns, the target object can optimize, adjust, or supplement its original state transition rules, thereby making its state management strategy more accurate and adaptive, and better able to adapt to the ever-changing environment and user needs. This mechanism transforms state management from a static rule execution into a self-evolving and optimizing capability, significantly improving the system's intelligence level and long-term operational efficiency.

[0101] As a specific implementation method, let's take a smart assistant application as an example. When the smart assistant switches from an "active state" to a "low-power state" based on the user's prolonged inactivity (external interaction information) and the current time (time information), the system records this state transition as an event. This event may include: a timestamp (e.g., 2023-10-27 23:05:12), the original state (active state), the target state (low-power state), the triggering context (user inactivity exceeding 30 minutes, current time being late at night), and the transition rule (e.g., "entering low-power state due to no interaction at night" rule). This event data is stored in a local log database. The smart assistant can periodically (e.g., weekly) run a background analysis task that utilizes this historical transition event data. For example, it can use statistical models to analyze the frequency and average inactivity duration of users entering the low-power state at different times, or use simple decision tree algorithms to learn under which specific context combinations users are more likely to enter or exit a certain state. Through this learning process, the intelligent assistant can discover, for example, that between 10 PM and 11 PM on weekdays, users typically enter sleep mode after 15 minutes of inactivity, rather than the default 30 minutes. Based on this pattern, the intelligent assistant can automatically adjust the parameters of its "enter low-power mode at night without interaction" rule, dynamically adjusting the inactivity time threshold from 30 minutes to 15 minutes, thus entering power-saving mode earlier and improving user experience and device battery life. Furthermore, it can also identify that on weekends, users may remain active even late at night, thus avoiding unnecessary power-saving switching.

[0102] Through the above technical solution, this application effectively solves the problem in traditional state management methods where the lack of recording of state transition events prevents target objects from learning historical patterns to optimize their behavioral strategies. Specifically, by storing state transition events in a storage module, a reliable historical data foundation is provided for subsequent analysis and learning, compensating for the lack of backtracking and auditing due to the absence of historical records. Based on this, a mechanism for target objects to learn patterns enables them to identify inherent patterns and trends based on this stored event data, and dynamically adjust and optimize their state transition rules and behavioral strategies accordingly. This not only significantly improves the system's adaptability to the environment and user habits, allowing it to continuously optimize its behavior based on actual operating conditions, but also enhances the system's intelligence level and long-term operating efficiency, ultimately providing users with a more personalized, accurate, and efficient service experience.

[0103] Traditional state management systems suffer from several drawbacks during operation, including resource waste, inappropriate response timing, monotonous behavior patterns, and a lack of personalized adaptation. Specifically, the system maintains high activity even when users are not interacting for extended periods or under low load, consuming unnecessary computing resources (such as CPU, memory, and power), which is detrimental to the long-term operation of resource-constrained devices. It lacks the ability to perceive the operating environment and user habits, leading to unnecessary proactive actions during user rest periods or when devices are idle, causing interference or resource waste. Furthermore, it cannot dynamically adjust its behavior patterns based on multi-dimensional factors such as time, environment, and internal status, for example, by reducing brightness at night or switching to energy-saving mode when power is low. Finally, it struggles to adapt to the diverse usage habits of different users, resulting in a rigid user experience and low system efficiency.

[0104] To address this issue, this application provides a state management system, including a state definition module, a context-aware module, and a state transition engine. The state definition module is configured to predefine multiple running states of a target object, providing a basis for diverse behavioral patterns. For example, the target object can be a software system, hardware device, application, or virtual character, and its running states can include an active state (responding to external input in real time and actively initiating behavior), a low-power state (not actively initiating behavior, only responding when woken up), and a special scenario state (a running mode specific to a particular scenario). By predefining multiple running states, the system solves the problem of a single behavioral pattern, enabling the target object to flexibly switch behavioral strategies in different contexts, rather than being limited to a fixed single mode.

[0105] The context-aware module is configured to acquire at least two different types of contextual information, providing multi-dimensional data support for state decisions. Contextual information includes time context (such as current time, day of the week, and date), interaction context (such as interaction frequency and recent interaction time), internal state context (such as system load and device battery level), and environmental context (such as geographical location and light intensity). Because the system can simultaneously collect multiple independent dimensions of contextual information, it solves the problem of lack of personalized adaptation. For example, relying solely on time information cannot accurately determine whether a user has fallen asleep, but by combining this with information about the absence of interaction, the system can more reliably infer user needs and achieve targeted state adjustments.

[0106] The state transition engine is configured to dynamically determine the target state and execute the switch based on preset rules, ensuring the intelligence and real-time nature of state decisions. Preset rules include time-triggered rules (entering a specific state within a preset time period), interaction-triggered rules (triggering switching based on interaction frequency), internal demand-triggered rules (automatically switching when internal state parameters meet conditions), and relationship / priority adjustment rules. Based on these rules, the state transition engine analyzes the multi-dimensional information output by the context-aware module and dynamically derives the ideal operating state that the target object should enter. When the target state differs from the current state, the system performs a state transition operation, thereby avoiding resource waste caused by blind or fixed switching. For example, during nighttime hours when no user interaction is detected, the system automatically switches to a low-power state to reduce resource consumption; when the user interacts again, it quickly resumes to an active state to ensure timely service response. Through this technical solution, the system achieves accurate state transition decisions, effectively solving the problems of resource waste and inappropriate response timing.

[0107] The core innovation of this embodiment lies in combining the multiple operating states predefined by the state definition module with the multi-dimensional context information acquired by the context awareness module, and then having the state transition engine make dynamic decisions based on preset rules. This enables the target object to intelligently adjust its behavior patterns according to the actual environment and usage. Specifically, the state definition module provides the foundation for diverse behavior patterns, the context awareness module ensures the comprehensiveness of environmental awareness, and the state transition engine establishes a logical connection between multi-dimensional information and state decisions. The collaborative work of these three components enables the system to dynamically adapt to complex scenarios. Compared to basic solutions, this application has significant advantages: in terms of resource utilization, the low-power state significantly reduces resource consumption during idle periods; in terms of response accuracy, multi-dimensional context analysis avoids misjudgments caused by single-dimensional judgments; and in terms of personalized adaptation, the system can learn user habits to achieve adaptive adjustments.

[0108] Through the above technical solutions, the state management system can optimize resource utilization efficiency and extend device battery life; improve the naturalness and accuracy of response behavior, executing appropriate operations at the right time; enhance adaptability to user habits and environmental changes, providing a personalized experience; and maintain the scalability of the solution, supporting users to define new states and rules. A specific example illustrates this: Assuming the target object is a smart speaker, the state definition module predefines "active mode" (real-time listening to voice commands and actively broadcasting notifications) and "silent mode" (only responding to wake words and pausing unnecessary notifications). The context awareness module simultaneously acquires the time context (e.g., 22:00 to 07:00 is the nighttime period) and the interaction context (e.g., no user operation in the past 30 minutes). The state transition engine determines the target state based on preset rules: if it is currently nighttime and there is no user interaction, the target state is determined to be "silent mode"; if user interaction is detected or daytime begins, the target state is determined to be "active mode". When the target state differs from the current state, the system performs a switching operation. For example, at 11:00 PM when there is no interaction, the smart speaker switches from active mode to silent mode, reducing its monitoring sensitivity and ceasing active broadcasting to avoid disturbing the user and save power. When the user issues a command at 8:00 AM the next day, it quickly switches back to active mode to restore full functionality. This implementation effectively solves the shortcomings of traditional smart devices in terms of resource consumption, response timing, and behavior patterns, verifying the practicality and effectiveness of the technical solution in this application.

[0109] In some of the solutions mentioned above in this application, a state management system is proposed to dynamically switch states. However, in this process, the behavior strategy of the target object may not be adjusted in time after the state switch, resulting in a mismatch between behavior and state, which affects resource optimization and user experience.

[0110] In this regard, this application further proposes that the state management system also includes a behavior strategy library, which stores behavior strategies corresponding to different operating states and adjusts the behavior strategy of the target object after the state switch.

[0111] A behavior policy library is a storage unit used to centrally manage and store the behavioral rules and parameters that a target object should follow in different running states. It can be implemented as: a structured database where each record is associated with a running state identifier and a set of behavioral parameters; or a collection of configuration files, each defining a behavior policy for a state and indexed by the state identifier; or an in-memory lookup table mapping state names to corresponding behavior functions or sets of behavior parameters. The behavior policy library binds each predefined running state to a specific set of behavioral policies by establishing explicit mapping relationships. For example, for "active mode," it can store policy parameters such as high-frequency external input responses, the frequency of proactive behavior initiation, and the priority of background processing; for "energy-saving mode," it can store policy parameters such as reducing the frequency of proactive behavior, reducing background processing tasks, and extending response latency. This storage method ensures that each state has its unique and executable behavior pattern. When the state transition engine in the state management system completes the switch of the target object's running state, the system immediately retrieves the behavior policy corresponding to the new state from the behavior policy library and applies it to the target object. This includes, but is not limited to, modifying the target object's operating parameters (such as CPU utilization and sensor sampling frequency), adjusting the frequency and method of its external interactions, or loading specific behavioral modules. This process ensures that the target object's behavior pattern can quickly and accurately remain consistent with the requirements of the new state after entering a new state.

[0112] This application's solution, by introducing a behavior strategy library and closely integrating it with the aforementioned state management system, solves the problem of untimely adjustment of behavior strategies after state switching. Specifically, the state definition module predefines multiple operating states of the target object. After the context awareness module obtains at least two different context information, the state transition engine dynamically determines the target state and executes the state switch based on these context information according to preset transition rules. Furthermore, this application's solution ensures the effectiveness of state switching. After the state transition engine completes the state switch, the system immediately queries the behavior strategy library, which pre-stores behavior strategies precisely corresponding to each operating state. Based on the currently switched target state, the system extracts the corresponding behavior strategy from the behavior strategy library and applies it to the target object. This means that a series of behavioral parameters of the target object, such as the frequency of active behavior, response mode, and background processing frequency, will be adjusted in real time according to the requirements of the new state. For example, if switching from "active mode" to "energy-saving mode," the behavior strategy library will provide a set of strategies to reduce power consumption and activity frequency, and the system will then adjust the target object's operating parameters to meet energy-saving requirements. This mechanism ensures that state changes are not merely updates to internal identifiers, but also immediate and comprehensive adaptations to the target object's external behavior. This guarantees that the target object can operate in a way that best suits its current state at any given time, avoiding resource waste or inappropriate responses caused by lagging behavioral strategies, and greatly improving the accuracy and efficiency of state management.

[0113] The following example illustrates this. Consider a smart assistant application, which might predefine operating states such as "Active Mode," "Energy Saving Mode," and "Sleep Care Mode." The behavior policy library stores a detailed set of behavior policies for each mode. For example, the "Active Mode" policy might include: real-time voice recognition, high-frequency proactive information push, and rapid response to user commands; the "Energy Saving Mode" policy might include: disabling voice recognition, responding only to specific wake words, and reducing background data synchronization frequency; while the "Sleep Care Mode" policy might include: playing soothing music, periodically reminding the user to rest, disabling proactive notifications, and reducing screen brightness. When the context awareness module detects that the user has not interacted for a long time and it is late, the state transition engine switches the smart assistant from "Active Mode" to "Sleep Care Mode." The system immediately loads the corresponding behavior policy from the behavior policy library for "Sleep Care Mode." The smart assistant then adjusts its behavior: stopping proactive information push, starting to play preset soothing music, and automatically dimming the screen brightness, thus perfectly matching its behavior to the current "Sleep Care Mode" and providing appropriate service to the user.

[0114] Through the above technical solution, this application ensures that the target object's behavior strategy can be adjusted promptly and accurately after a state switch. This solves the problem of mismatch between state and behavior in traditional solutions, enabling the target object to always operate in a way that best suits its current operating state. For example, when switching to energy-saving mode, power consumption can be reduced immediately to avoid unnecessary resource consumption; when switching to active mode, response speed and active behavior frequency can be rapidly improved to provide a better user experience. This timely and precise adjustment of behavior strategy greatly optimizes resource utilization efficiency, improves the system's response accuracy, and enhances the consistency and smoothness of the user experience.

[0115] In some of the solutions mentioned above in this application, a state management system is proposed to dynamically switch states based on context information. However, the lack of recording of the state transition history in this process makes it impossible for the target object to learn the pattern and to adaptively optimize state switching, thereby affecting resource utilization efficiency and response accuracy.

[0116] In this regard, this application further proposes that the state management system also includes a state persistence module for recording the current state and transition history.

[0117] The state persistence module is a key component of the system. Its core function is to ensure that the runtime state data of the target object can be stored reliably and long-term, even after system restarts or unexpected interruptions. This module can be a data management component integrated into the system software layer, such as using a file system, embedded database (e.g., SQLite), or key-value store (e.g., Redis) to store and retrieve data; or it can be a standalone hardware module, such as a dedicated chip containing non-volatile memory (e.g., EEPROM, NAND Flash), exchanging data with the main system through a specific communication protocol. This module provides a continuous historical data foundation for the system. Recording the current state means writing the latest runtime state identifier, the timestamp of entering that state, and related key parameters to persistent storage after each state transition of the target object. Recording the transition history is more detailed, including not only the current state but also complete information about each state transition event, such as the state before the transition, the state after the transition, the specific context information that triggered the transition (e.g., time, external interaction, environmental changes, or internal requirements), and the time point of the transition. This historical data can be stored in the form of structured logs, event streams, or database records.

[0118] This application's solution introduces a state persistence module that works closely with the state definition module, context-aware module, and state transition engine in the state management system. Specifically, when the state transition engine dynamically determines the target state and executes a state switch based on at least two different contextual information obtained from the context-aware module and according to preset transition rules, the state persistence module intervenes in real time, recording the result of this state switch (i.e., the new current state of the target object) and the detailed process that triggered this switch (i.e., the transition history). This recording mechanism enables the system not only to respond to external changes in real time but also to accumulate valuable operational data. By analyzing this persistent historical data, the system can identify the patterns, frequency, and correlations of state transitions with specific contextual information, thereby learning the behavioral patterns of the target object and the trends of environmental changes. These learned patterns can be fed back to the state transition engine to optimize its preset transition rules, making them more intelligent and adaptive, such as adjusting transition thresholds, priorities, or introducing new transition conditions, thereby improving resource utilization efficiency and response accuracy. In addition, recording the current state ensures that the system can quickly and accurately restore to the operating state before the interruption after an unexpected interruption or restart, avoiding resource waste or functional abnormalities caused by state loss.

[0119] The following example illustrates this concept using mobile application power management. In a mobile application, the state persistence module can be implemented as a local database (such as SQLite) or utilize the operating system's persistent storage mechanism (such as SharedPreferences in Android or UserDefaults in iOS). When the mobile application dynamically adjusts its background behavior based on user habits and device status—for example, switching from "active mode" to "power saving mode," or from "power saving mode" to "scene-appropriate mode" (such as "Do Not Disturb mode")—the state persistence module records each state transition event. These records can include: the timestamp of the transition, the state before the transition, the state after the transition, and the specific context information that triggered the transition (e.g., prolonged user inactivity, device battery level below a preset threshold, current time entering nighttime, etc.). By analyzing this persistent state transition history data, the mobile application can learn the user's state transition patterns under different battery levels, usage frequencies, and time periods. For example, the application might discover that users typically enter "Do Not Disturb mode" after 11 PM, or tend to enter "power saving mode" when the battery level is below 15%. These learned patterns can be used to dynamically adjust thresholds or rules in the state transition engine. For example, the trigger threshold for "low battery" can be adjusted from the default 20% to 15%, or "do not disturb" mode can be entered in advance during specific time periods, thereby managing power more accurately and optimizing the user experience.

[0120] Through the above technical solution, the state management system can record the current state and transition history of the target object, thus solving the problem of lacking historical records of state transitions. This allows the system to learn the patterns of state transitions by analyzing historical data, and then adaptively optimize state switching rules, significantly improving resource utilization efficiency and response accuracy. At the same time, the persistent recording of the current state ensures accurate recovery of the system after unexpected interruptions, enhancing the system's stability and reliability.

[0121] In some of the solutions mentioned above in this application, a state transition engine is proposed to dynamically determine the target state according to preset rules. However, in its implementation, the preset rules remain fixed and cannot be customized according to user needs.

[0122] In response, this application further proposes a state management system, which also includes a configuration interface for receiving user-defined transformation rules.

[0123] A configuration interface serves as a channel for interaction between the system and external entities, allowing these entities to configure certain parameters or behaviors within the system. This configuration interface can take various forms. For example, it can be a graphical user interface (GUI) where users define and modify rules through intuitive drag-and-drop, selection, or input; it can also be a command-line interface (CLI) where users submit rules via text commands; or it can be an application programming interface (API) allowing other software systems or programs to submit custom rules programmatically; or it can be a file import interface supporting users uploading files in specific formats (such as XML, JSON, or YAML) containing rule definitions. Receiving user-defined transformation rules means the system has the ability to parse, store, and apply rule logic from external input. Specifically, the system can parse user-input rule expressions, such as condition-action pairs, and store them in the rule engine for subsequent evaluation; alternatively, the system can provide preset rule templates, allowing users to customize rules simply by selecting a template and filling in the corresponding parameters; furthermore, the system can use learning algorithms to automatically learn and generate personalized transformation rules based on example behaviors or preference data provided by the user.

[0124] Building upon the aforementioned state management system, the system can receive and process user-defined transition rules by introducing a configuration interface. Specifically, the state definition module pre-defines multiple operating states of the target object, while the context awareness module continuously acquires and analyzes multi-dimensional context information. When this information is passed to the state transition engine, the engine no longer relies solely on preset fixed rules but incorporates user-defined transition rules received through the configuration interface into its decision-making logic. This means that users can flexibly define the conditions and target states for state transitions based on their specific needs, usage habits, or specific scenarios through the configuration interface. When dynamically determining the target state, the state transition engine comprehensively evaluates both preset rules and user-defined rules, and can even assign higher priority to user-defined rules, thereby ensuring that state transitions better align with the user's personalized expectations. When the determined target state differs from the current state, the state transition engine executes the corresponding state transition operation. This mechanism transforms the entire state management system from a static, preset behavior pattern to a dynamic, customizable behavior pattern, greatly enhancing the system's flexibility and user adaptability.

[0125] As a specific implementation method, the above-mentioned technical means can be implemented with reference to the following example. In a smart home status management system, users want to automatically adjust the operating mode of home appliances under specific conditions. For example, users can access the "rule settings" interface through a smartphone application, which serves as the configuration interface. In this interface, users can define a rule: "If the time is after 10 pm and the motion sensor in the living room has not detected any activity in the past 30 minutes, then switch the living room lights to 'night mode' (reduce brightness and warm up color temperature)." Users select the corresponding conditions (time, sensor status) and actions (lighting mode) through the application's graphical interface and then submit the rule. After the system receives this user-defined transition rule, the status transition engine stores and activates it. Subsequently, when the context awareness module detects that the current time has exceeded 10 pm and the living room motion sensor reports no activity within the specified time, the status transition engine will dynamically determine the target state as "night mode" according to this user-defined rule and execute the corresponding light switching operation.

[0126] Through the above technical solution, the system solves the problem of fixed preset rules that cannot be customized according to user needs. The introduction of the configuration interface provides users with an intuitive and flexible way to define and modify state transition rules, enabling the state management system to dynamically adjust according to user preferences, specific scenario requirements, or constantly changing usage habits. This not only significantly improves the system's flexibility and adaptability, avoiding the lack of personalization caused by rigid rules, but also better meets the differentiated needs of different users, thereby greatly optimizing the user experience.

[0127] In some of the solutions mentioned above in this application, a state management method is proposed to dynamically switch the running state based on multi-dimensional context information to optimize resource utilization, improve response accuracy, and personalize adaptation. However, in this process, an executable carrier is needed to implement and run the method on a computer system, ensuring that the method can be executed by the processor and applied to actual devices, and avoiding the method remaining only at the theoretical description level without being able to be deployed and executed in a hardware or software environment.

[0128] In response, this application proposes a computer-readable storage medium storing a computer program that implements a state management method when executed by a processor.

[0129] Computer-readable storage media refers to any type of medium capable of storing data and computer programs, and which can be read and accessed by a computer system. This medium can be physical, such as hard disk drives, solid-state drives, flash memory, optical discs (such as CD-ROMs, DVDs, and Blu-ray discs), or magnetic tape; or logical, such as cloud storage accessed via a network or server storage. Its core function is to provide a persistent storage medium for computer programs, ensuring that program code is retained after power failure and can be loaded into the processor for execution when needed. A computer program is a collection of instructions written in a specific programming language and, after compilation or interpretation, understood and executed by a processor to complete a specific task or function. The program can exist in various forms, such as source code, object code, executable files, or scripts. In this application, the computer program encodes the complete logic of a state management method, including steps such as predefining multiple running states of a target object, acquiring at least two different contextual information, dynamically determining the target state based on the at least two different contextual information according to preset conversion rules, and performing state switching when the target state differs from the current state. The execution of a program by a processor refers to the process by which the Central Processing Unit (CPU) or a dedicated processor (such as a microcontroller or graphics processing unit) in a computer system operates according to a pre-defined sequence of instructions in the computer program. The processor reads program instructions from the storage medium, decodes and executes them, thereby driving the computer system to complete the corresponding functions. This process transforms abstract program logic into actual computational behavior and is the foundation for implementing any software function. Implementing a state management method means that through the execution of a computer program, the various functions and steps defined in the state management method can run and take effect in a real computing environment. Specifically, when the processor executes the computer program, it dynamically executes the state management process, judging and adjusting the running state of the target object based on real-time acquired context information, thereby influencing the target object's behavioral strategy. This allows the originally abstract method theory to be transformed into an operable and applicable practical system function.

[0130] The computer-readable storage medium, computer program, and overall scheme for processor execution proposed in this application aim to provide a deployable and runnable physical foundation for the aforementioned state management method. Specifically, the computer-readable storage medium, as the carrier, provides stable and persistent storage space for the computer program of the state management method, ensuring the integrity and accessibility of the method's logic. The computer program encodes the predefined running states, context information acquisition mechanisms, logic for dynamically determining the target state based on transition rules, and execution steps for state switching in the state management method in the form of executable code. When the processor loads and executes the computer program, it will, according to the program instructions, perceive and process multi-dimensional context information in real time, perform logical judgments based on preset transition rules, thereby dynamically determining the running state of the target object and triggering state switching when necessary. In this way, the originally abstract state management method can be transformed into concrete running behavior on actual computing devices, enabling the target object to intelligently adjust its behavior patterns according to environmental changes and its own needs. This combination not only bridges the gap between methodological theory and practical application but also enables the advantages of state management methods, such as resource optimization, precise response, and personalized adaptation, to be truly realized in various intelligent devices and systems.

[0131] The following is a specific example. As a concrete implementation, in a smart assistant application, the computer-readable storage medium can specifically be a flash memory chip or an embedded multimedia card (eMMC) inside the smart assistant device. This flash memory chip stores a computer program that implements the smart assistant's state management function. When the smart assistant device starts, its built-in microprocessor or system-on-a-chip (SoC) reads and loads the computer program from the flash memory chip. The processor then executes the program, monitoring user interaction information (such as voice command frequency, touchscreen activity), time information (such as the current time period, the user-set sleep time), and internal device status information (such as battery level, CPU load) in real time. Based on the conversion rules encoded in the program, the processor dynamically determines whether the smart assistant should be in active mode, power-saving mode, or sleep care mode. For example, when it detects that the user has not interacted for a long time and it is nighttime, the program instructs the processor to switch the smart assistant to power-saving mode, reducing the frequency of active behavior and background processing. For example, in an IoT sensor node, the computer-readable storage medium can specifically be a read-only memory (ROM) inside the sensor node's main control chip or an external serial flash memory (SPI Flash). The computer program is pre-programmed or stored in these media. When the sensor node is powered on, its microcontroller reads and executes the program from the storage medium. The program drives the microcontroller to periodically acquire ambient light information, battery level information, and time information. Based on the transition rules defined in the program, the microcontroller can determine whether it is necessary to switch the node from a low-power state to an active state (e.g., increasing the sampling frequency and reporting data when the ambient light brightens and the battery is fully charged), or from an active state to a low-power state (e.g., decreasing the sampling frequency to extend battery life when the battery level is below a threshold).

[0132] By providing a computer-readable storage medium on which a computer program is stored and executed by a processor to implement a state management method, this application effectively solves the problem of the lack of an executable carrier for state management methods in practical applications. This solution allows abstract method logic to be transformed into concrete, deployable, and runnable software entities, thereby ensuring the practical application of state management methods in various computing devices and systems. This not only avoids the limitation of methods remaining only at the theoretical level, but more importantly, it provides a solid foundation for realizing the technical advantages of state management methods, such as resource optimization, precise response timing, and personalized adaptation. By solidifying the method into an executable program and running it efficiently by a processor, the target object can dynamically adjust its behavior pattern based on multi-dimensional context information, thereby significantly improving the system's energy efficiency, user experience, and adaptability, enabling state management methods to truly realize their technical value.

[0133] Other application scenarios The following simplified embodiments illustrate the application of the present invention in other fields. Specific implementations of these embodiments can be found in the examples described in the detailed embodiments above, and will not be repeated here.

[0134] Simplified Example 1: Industrial Robot Task Adaptation In industrial automation scenarios, robots can dynamically adjust their operating status based on contextual information such as production cycle time, equipment temperature, and maintenance schedule. For example, when the production line is under high load, the robot enters a high-priority state and runs at full speed; when the equipment temperature is too high, it automatically switches to a reduced-speed operation state to prevent overheating; and during maintenance windows, it enters standby mode. Through the state management of this invention, production efficiency can be optimized and equipment safety can be ensured.

[0135] Simplified Example 2: Mobile Application Power Management Mobile applications can dynamically adjust their background behavior based on user habits and device status. For example, when the application detects that the user has not used it for a long time and the device battery is low, the application automatically enters a low-power state and pauses background refresh; when the user reopens the application, it quickly switches back to an active state; and based on the user's schedule, it automatically enters a do-not-disturb state and disables unnecessary notifications. This embodiment improves user experience and battery life.

[0136] Simplified Example 3: Driving Mode Switching in Vehicle Systems In intelligent vehicles, the system can automatically switch driving modes (such as Eco, Sport, and Comfort) based on contextual information such as driving time, road conditions, and driver status. For example, when long-distance driving and driver fatigue are detected, the system can switch to enhanced driver assistance mode; when the vehicle enters a congested area, it can switch to energy-saving start-stop mode. The state management mechanism of this invention can improve driving safety and comfort.

[0137] 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.

[0138] This solution is applicable not only to local devices but can also be deployed on cloud servers. Those skilled in the art should understand that the technical solution of this invention is not limited to a specific deployment environment, and any implementation based on the technical concept of this application should be considered to fall within the protection scope of this invention.

Claims

1. A state management method, characterized in that, Includes the following steps: Multiple runtime states of a predefined target object; Obtain at least two different contextual information; The target state is dynamically determined based on the preset conversion rules and the at least two different contextual information. When the target state is different from the current state, a state switch is performed.

2. The method according to claim 1, characterized in that, The operating state includes at least two different operating modes, and the frequency and response method of the target object's active behavior are different in different modes.

3. The method according to claim 2, characterized in that, The different operating modes include, but are not limited to, at least two of the following: active mode, energy-saving mode, and scene adaptation mode; wherein, in active mode, the target object responds to external input in real time and has a high frequency of active behavior; in energy-saving mode, the target object does not initiate behavior and has a low frequency of background processing; in scene adaptation mode, the target object performs preset behavior for a specific scene.

4. The method according to claim 1, characterized in that, The context information is selected from at least two different types, including but not limited to time information, external interaction information, environmental information, and internal state information.

5. The method according to claim 1, characterized in that, The conversion rules include, but are not limited to, at least one of the following: time-triggered rules, external interaction-triggered rules, environment-triggered rules, internal demand-triggered rules, or relationship parameter adjustment rules.

6. The method according to claim 5, characterized in that, The internal demand triggering rules include: when the internal state parameters of the target object meet predetermined conditions, it is triggered to enter a specific state.

7. The method according to claim 1, characterized in that, Also includes: After the state transition, the behavior strategy of the target object is adjusted to the behavior strategy corresponding to the target state.

8. The method according to claim 1, characterized in that, It also includes storing state transition events in a storage module so that the target object can learn the patterns.

9. A status management system, characterized in that, include: The state definition module is used to predefine multiple running states of a target object; A context-aware module is used to acquire at least two different types of context information; The state transition engine is used to dynamically determine the target state and perform the transition according to preset rules.

10. The system according to claim 9, characterized in that, It also includes a behavior strategy library, which stores behavior strategies corresponding to different operating states and adjusts the behavior strategy of the target object after a state switch.

11. The system according to claim 9, characterized in that, It also includes a state persistence module, which records the current state and transition history.

12. The system according to claim 9, characterized in that, It also includes a configuration interface for receiving user-defined conversion rules.

13. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method of any one of claims 1 to 8.