Pet device voice control method and system based on intelligent switching

By monitoring network status parameters and using a state machine mechanism, intelligent switching of voice control modes for pet devices is achieved, solving the problems of decreased intelligent experience and resource waste caused by network interruptions, and improving the stability and convenience of mode switching for pet devices.

CN120808775BActive Publication Date: 2026-06-23SHENZHEN UASCENT TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN UASCENT TECH CO LTD
Filing Date
2025-07-15
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

The existing voice control mode of pet devices fails when the network is interrupted, resulting in a decline in the intelligent experience. Furthermore, the offline mode lacks recognition accuracy and interactive capabilities, and the lack of an intelligent switching mechanism leads to cumbersome operation and waste of resources.

Method used

Network status parameters are generated by monitoring network connection status, and the device operating status is dynamically evaluated using a state machine mechanism. This enables intelligent switching between online and offline modes, preserves core processes and user interaction context, loads target voice processing components for seamless switching, and ensures state consistency through local instruction queue management and cloud synchronization.

Benefits of technology

It enables intelligent adaptive switching of voice control modes for pet devices in scenarios with network fluctuations, improving the stability and convenience of mode switching, and ensuring the continuity of user interaction and efficient use of resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120808775B_ABST
    Figure CN120808775B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a pet device voice control method and system based on intelligent switching, the network connection state of the pet device is monitored to obtain a network state parameter. The current running state of the pet device is obtained based on the state machine mechanism adopted by the pet device. According to the preset adjustment condition associated with the current running state and the network state parameter, it is determined whether the pet device has a voice control mode adjustment requirement. When the pet device has a voice control mode adjustment requirement, the pet device is adjusted to a target voice control mode according to the network state parameter and the preset adjustment condition. If a voice control instruction input by a user is received, a voice processing component corresponding to the target voice control mode is called to analyze the voice control instruction to obtain a control instruction of the pet device, the control instruction is executed and an instruction execution result is output, thereby improving the stability and convenience of the voice control mode switching of the pet device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of pet device technology, and more specifically, to a voice control method and system for pet devices based on intelligent switching. Background Technology

[0002] Voice control functions for smart pet feeders typically fall into two categories: online and offline. Online voice control relies on cloud-based speech recognition and natural language processing technologies, enabling advanced interactive functions such as high-precision speech recognition, complex command parsing, and cloud-based skill extensions. However, it requires a stable Wi-Fi connection; if the network is interrupted or the signal is abnormal, the voice control function will be completely disabled, and users will only be able to control it manually or via a mobile app, significantly reducing the intelligent experience. Offline voice control uses locally deployed speech recognition models and command sets to achieve basic control functions. It features high reliability and does not require a network connection, but its recognition accuracy, command richness, and intelligent interaction capabilities are significantly weaker than the online mode due to limitations in device computing power and storage space, making it difficult to meet users' diverse voice control needs.

[0003] Due to the limitations of the aforementioned voice control modes, the following problems exist: voice control completely fails during network interruptions, potentially causing inconvenience or even potential risks in emergency scenarios (such as immediately stopping feeding or checking device status); relying solely on offline mode fails to provide advanced cloud-enabled interactive functions, limiting the product's intelligence level and failing to meet user needs; if two modes are supported simultaneously but lack an intelligent switching mechanism, users must manually switch modes or restart the device, which is cumbersome and prone to functional abnormalities due to forgetting to switch modes, resulting in poor convenience. Furthermore, delays, status loss, or functional interruptions during mode switching disrupt the continuity of the user experience, and running online and offline systems simultaneously may waste embedded device resources (such as memory usage, processor load, and increased power consumption), especially impacting device performance in resource-constrained scenarios.

[0004] Therefore, improving the stability and convenience of switching voice control modes for pet devices is an urgent problem to be solved. Summary of the Invention

[0005] In view of this, the purpose of this application is to provide a voice control method and system for pet devices based on intelligent switching, so as to improve the stability and convenience of switching voice control modes for pet devices.

[0006] In a first aspect, this application provides a voice control method for a pet device based on intelligent switching, comprising:

[0007] Monitor the network connection status of the pet device to obtain network status parameters, which include network signal stability indicators, network connectivity status indicators, and Internet access capability indicators.

[0008] The current operating state of the pet device is obtained based on the state machine mechanism used by the pet device. The current operating state includes online state, offline state, and switching state.

[0009] Based on the preset adjustment conditions associated with the current operating status and the network status parameters, determine whether the pet device has a voice control mode adjustment requirement;

[0010] When the pet device has a voice control mode adjustment requirement, the pet device is adjusted to the target voice control mode according to the network status parameters and the preset adjustment conditions. The target voice control mode includes online voice control mode and offline voice control mode.

[0011] If a voice control command is received from the user, the voice processing component corresponding to the target voice control mode is invoked to parse the voice control command and obtain the control command for the pet device.

[0012] Execute the control command and output the command execution result.

[0013] Optionally, the network connection status of the pet monitoring device, to obtain network status parameters, includes:

[0014] Periodically detect the network signal reception strength of the pet device and generate a signal strength sequence;

[0015] A continuous stability analysis is performed on the signal strength sequence to calculate the signal strength fluctuation amplitude between adjacent detection periods, and the network signal stability index is generated based on the signal strength fluctuation amplitude.

[0016] Connectivity test data is sent to a preset network node, and a network connectivity status index is generated based on the round-trip transmission status of the connectivity test data. The network connectivity status index is used to indicate whether the network connection is normal.

[0017] Access a preset Internet address and generate the Internet access capability index based on the access response result. The Internet access capability index is used to indicate whether the pet device can access cloud services normally.

[0018] Monitor network status change events of the pet device, update the network signal stability index, the network connectivity status index, and the internet access capability index based on the network status change events, and generate updated network status parameters.

[0019] Optionally, determining whether the pet device requires a voice control mode adjustment based on preset adjustment conditions associated with the current operating state and the network status parameters includes:

[0020] Based on the current operating state, a corresponding set of target adjustment conditions is selected from the preset adjustment conditions. The set of target adjustment conditions includes multiple condition items that match the current operating state. Each condition item is associated with a judgment criterion for at least one indicator in the network state parameters. The judgment criterion includes a description of the normal range of the indicator and a description of the abnormal range of the indicator.

[0021] The network signal stability index, the network connectivity status index, and the Internet access capability index are extracted from the network status parameters to obtain a set of network indicators to be evaluated. Each index in the set of network indicators to be evaluated has a one-to-one correspondence with the condition item in the set of target adjustment conditions.

[0022] Each indicator in the set of network indicators to be evaluated is matched with the corresponding condition item in the set of target adjustment conditions to generate a matching result for each indicator. The matching result includes indicators that meet the conditions and indicators that do not meet the conditions. Specifically, when the actual value of the indicator is within the normal range of the condition item, a matching result for the indicator that meets the conditions is generated; when the actual value of the indicator is within the abnormal range of the condition item, a matching result for the indicator that does not meet the conditions is generated.

[0023] Based on the condition combination rules corresponding to the current operating state, the matching results of multiple indicators are logically combined to generate a combined judgment result. The condition combination rules include the combination of logical AND and logical OR of the indicator matching results under different operating states.

[0024] When the combined judgment result meets the preset triggering condition, it is determined that the pet device has a need to adjust the voice control mode;

[0025] When the combined judgment result does not meet the preset triggering condition, it is determined that the pet device does not have the need to adjust the voice control mode.

[0026] Optionally, adjusting the pet device to the target voice control mode based on the network status parameters and the preset adjustment conditions includes:

[0027] When the current voice control mode of the pet device is the offline voice control mode, if the network signal stability index indicates that the network signal stability meets the preset stability conditions, the network connectivity status index indicates that the network connectivity is normal, and the Internet access capability index indicates that the Internet can be accessed, then the pet device will be adjusted to the online voice control mode.

[0028] Load the first voice processing component corresponding to the online voice control mode. The first voice processing component includes an online voice recognition model and an online voice command set.

[0029] Unload the second voice processing component corresponding to the offline voice control mode. The second voice processing component includes an offline voice recognition model and an offline voice command set.

[0030] Optionally, adjusting the pet device to the target voice control mode based on the network status parameters and the preset adjustment conditions includes:

[0031] When the current voice control mode of the pet device is the online voice control mode, if the network signal stability index indicates that the network signal stability does not meet the preset stability conditions, or the network connectivity status index indicates that the network connectivity is abnormal, or the Internet access capability index indicates that the Internet cannot be accessed, then the pet device will be adjusted to the offline voice control mode.

[0032] Load the second voice processing component corresponding to the offline voice control mode. The second voice processing component includes an offline voice recognition model and an offline voice command set.

[0033] Unload the first voice processing component corresponding to the online voice control mode. The first voice processing component includes an online voice recognition model and an online voice command set.

[0034] Optionally, the step of calling the voice processing component corresponding to the target voice control mode to parse the voice control command and obtain the control command for the pet device includes:

[0035] The voice control commands received through the voice acquisition unit are converted into digital audio signals, and the digital audio signals are preprocessed to generate a preprocessed audio feature sequence.

[0036] The audio feature sequence is input into the speech recognition model of the speech processing component, and after processing, a text instruction sequence is generated, which contains consecutive lexical units.

[0037] Extract the core control intent words and associated parameter words from the text instruction sequence to obtain the instruction unit to be matched;

[0038] Load the voice instruction set of the voice processing component and the standard instruction template set corresponding to the target voice control mode. The standard instruction template set includes preset standard control intent words and parameter format descriptions.

[0039] Calculate the similarity between the instruction unit to be matched and each standard instruction template in the standard instruction template set, and determine the standard instruction template with the highest similarity as the target standard instruction template;

[0040] The standard control intent words of the target standard instruction template are used as instruction type identifiers, and structured control instructions are generated by combining the parameter format description of the target standard instruction template.

[0041] Optionally, when the pet device has a voice control mode adjustment requirement, adjusting the pet device to the target voice control mode according to the network status parameters and the preset adjustment conditions includes:

[0042] After determining that the pet device needs to adjust its voice control mode, pause the currently executing non-critical task processes and retain the core processes related to voice control, including the voice acquisition process, the command parsing process, and the command execution process.

[0043] Collect the device parameters of the pet device, which include current working mode parameters, user-defined setting parameters, and the record of the most recently executed control command.

[0044] Extract user interaction context data within a preset time period. The user interaction context data includes the user's voice control command history, the pet device's response feedback record, and the user's interaction time sequence with the device.

[0045] The device parameters and the user interaction context data are stored in a local state cache file. The state cache file is stored in a key-value pair structure, wherein the key in the key-value pair is the parameter name, and the value in the key-value pair is the parameter value.

[0046] Load the voice processing component corresponding to the target voice control mode, wherein interruption of the core process is prohibited during the loading process;

[0047] Once the voice processing component corresponding to the target voice control mode is loaded, the device parameters and the user interaction context data are read from the state cache file, and the initial working mode parameters of the target voice control mode are replaced with the device parameters. The user interaction context data is then input into the instruction parsing process of the target voice control mode.

[0048] Resume the suspended non-critical task process.

[0049] Optionally, executing the control command and outputting the command execution result includes:

[0050] When the pet device is in the offline voice control mode, an independent instruction cache area is allocated in the local storage unit of the pet device, and a local instruction queue is established to store the parsed control instructions. The local instruction queue manages the control instructions in a first-in-first-out order.

[0051] Add the control command to the tail of the local command queue;

[0052] The target control command is retrieved from the head of the local command queue in a first-in-first-out order, and the target control command is executed by calling the hardware driver interface of the pet device.

[0053] During the execution of the target control instruction, the execution status code returned by the hardware driver interface is monitored in real time. When the execution status code indicates that the target control instruction has been completed, the instruction execution result containing the instruction type identifier field and the execution status code is generated.

[0054] The system provides feedback to the user on the execution result of the instruction through at least one of the following methods: preset light flashing pattern, on-screen text display, or local voice prompt.

[0055] Optionally, the method further includes:

[0056] If the pet device triggers a switch from the offline voice control mode to the online voice control mode, a background synchronization operation is initiated to encrypt and package the executed control commands and corresponding command execution results in the local command queue to generate a synchronization data packet.

[0057] The synchronization data packet is sent to a preset cloud server, which then parses the synchronization data packet and updates the device status parameters stored on the cloud server.

[0058] The system receives a status correction instruction returned by the cloud server and adjusts the local status parameters of the pet device according to the status correction instruction, so that the local status parameters are consistent with the device status parameters stored on the cloud server. The status correction instruction includes information on the differences between the device status parameters and the local status parameters.

[0059] Secondly, this application provides a pet device voice control system based on intelligent switching. The pet device voice control system based on intelligent switching includes a machine-readable storage medium and a processor. The machine-readable storage medium stores machine-executable instructions. When the processor executes the machine-executable instructions, the pet device voice control system based on intelligent switching implements the aforementioned pet device voice control method based on intelligent switching.

[0060] The voice control method and system for pet devices based on intelligent switching provided in this application generate network status parameters by monitoring the network signal stability, connectivity status, and internet access capability of the pet device. Combined with a state machine mechanism, the current operating status of the device is obtained. Based on the indicator judgment standards and logical combination rules corresponding to different states in preset adjustment conditions, the system dynamically assesses whether a voice control mode switch is needed. When a switch is required, the system retains the core process, caches device parameters and user interaction context to a local state file, loads the voice processing component corresponding to the target mode, and restores non-critical tasks to achieve seamless switching. When parsing voice commands, the preprocessed audio feature sequence is input into the voice recognition model of the target mode to generate text commands. Structured control commands are extracted by matching standard command templates. During the execution phase, a local command queue is used for first-in-first-out management in offline mode. The hardware execution status is monitored in real time and the results are fed back. Simultaneously, the offline execution data is uploaded to the cloud through a background synchronization mechanism to correct the local state. This method combines multi-dimensional network status monitoring with a state machine to accurately determine the switching timing and avoid accidental operations. Furthermore, it ensures no command loss and continuous user interaction during the switching process through core process retention and state caching. Modular component loading and command parsing optimization adapt to control requirements in different network environments. Local queues and real-time feedback improve response efficiency in offline scenarios, and cloud synchronization ensures state consistency. This enables intelligent adaptive switching of voice control modes for pet devices in scenarios with network fluctuations, improving the stability and convenience of voice control mode switching. Attached Figure Description

[0061] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0062] Figure 1 A flowchart illustrating a voice control method for pet devices based on intelligent switching, provided as an embodiment of this application;

[0063] Figure 2 This is a schematic diagram of a voice control system for pet devices based on intelligent switching, provided as an embodiment of this application.

[0064] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

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

[0066] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or end that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or ends.

[0067] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0068] Figure 1 This is a flowchart illustrating a voice control method for pet devices based on intelligent switching, provided as an embodiment of this application. It should be understood that in other embodiments, the order of some steps in the voice control method for pet devices based on intelligent switching in this embodiment can be shared according to actual needs, or some steps can be omitted or maintained. Figure 1 As shown, the method may include the following steps:

[0069] Step S110: Monitor the network connection status of the pet device and obtain network status parameters.

[0070] The network status parameters include network signal stability indicators, network connectivity status indicators, and Internet access capability indicators.

[0071] This step involves a comprehensive monitoring of the network connection status of the pet device to obtain network status parameters that accurately reflect the network condition. The specific steps are as follows:

[0072] Step S111: Periodically detect the network signal reception strength of the pet device and generate a signal strength sequence.

[0073] To accurately monitor changes in the network signal strength of pet devices, measurements need to be taken at fixed time intervals. Assuming the time interval is T (e.g., 1 second, 5 seconds, 30 seconds, 1 minute, 5 minutes, etc.), the network signal strength of the pet device is measured every T. For example, the RSSI (Signal Strength Indicator) value received by the pet device's network module (e.g., Wi-Fi module) can be periodically checked to determine the strength of the network signal (e.g., Wi-Fi signal). A low signal strength may indicate an unstable network connection or an impending disconnection.

[0074] In practice, the obtained signal strength values ​​can also be recorded. Multiple measurements of signal strength values ​​can be combined to form a signal strength sequence. For example, suppose the signal strength sequence is S = {S1, S2, S3, ..., S...} n}, where S i This represents the received network signal strength obtained in the i-th detection. n represents the total number of detections, which increases over time.

[0075] Step S112: Perform continuous stability analysis on the signal strength sequence, calculate the signal strength fluctuation amplitude of adjacent detection periods, and generate the network signal stability index based on the signal strength fluctuation amplitude.

[0076] After obtaining the signal strength sequence, continuous stability analysis is performed on it. For example, the stability of the network signal can be evaluated by calculating the signal strength fluctuation amplitude between adjacent detection periods.

[0077] For two adjacent values ​​S in the signal strength sequence S i and S i+1 The method for calculating the fluctuation range between them is to take the absolute value of the difference. That is, the fluctuation range ΔS. i =|S i -S i+1 This yields a series of fluctuation amplitude values, denoted as ΔS={ΔS1,ΔS2,ΔS3,…,ΔS…}. n-1}

[0078] Next, a network signal stability index is generated based on these fluctuation amplitude values. This can be calculated in various ways, such as by calculating the average, variance, and standard deviation of the fluctuation amplitude values. Taking the average as an example, let the network signal stability index be St, then St = (ΔS1 + ΔS2 + ... + ΔS...). n-1 The average value reflects the overall fluctuation level. The smaller the average fluctuation amplitude, the more stable the network signal; conversely, the larger the average fluctuation amplitude, the poorer the network signal stability. Taking variance as an example, for a fluctuation amplitude value sequence ΔS, let its variance be Vt. First, calculate the average fluctuation amplitude value St, and then calculate the variance using the formula Vt=[(ΔS1-St) / (n-1)]. 2 +(ΔS2-St) 2 +…+(ΔS n-1 -St) 2 The variance is calculated using ] / (n-1). A larger variance indicates a greater dispersion in the fluctuation amplitude and a worse network signal stability; a smaller variance indicates a better network signal stability.

[0079] Step S113: Send connectivity test data to a preset network node, and generate the network connectivity status index based on the round-trip transmission status of the connectivity test data. The network connectivity status index is used to indicate whether the network connection is normal.

[0080] In this step, connectivity test data needs to be sent to pre-defined network nodes. These pre-defined network nodes are selected and representative, such as a network server located near the pet device or other reliable network endpoints. For example, Ping packets can be periodically sent to a Wi-Fi router or a pre-defined internet server to check network connectivity. The Ping test determines whether the device can successfully connect to the Wi-Fi network and assesses network latency.

[0081] When sending connectivity test data, the transmission time t1 can be recorded. When test data is received from a preset network node, the reception time t2 can be recorded. The network connectivity can be preliminarily judged by calculating the round-trip time (RTT) = t2 - t1. Simultaneously, the completeness and accuracy of the returned test data can be checked.

[0082] If the round-trip time (RTT) is within the preset normal time range, and the returned test data is not lost or corrupted, the network connection is normal. In this case, the network connectivity status indicator Cc can be set to a value indicating normality, such as "1". If the RTT is too long, exceeding the preset threshold, or if the returned test data has problems, such as incomplete data or verification errors, the network connection is abnormal. In this case, the network connectivity status indicator Cc can be set to a value indicating abnormality, such as "0".

[0083] Step S114: Access a preset Internet address and generate the Internet access capability index based on the access response result. The Internet access capability index is used to indicate whether the pet device can access cloud services normally.

[0084] In this step, you can try accessing a preset internet address. This internet address can be a specific address related to cloud services (such as the cloud server address corresponding to the pet device), which is specially set up to test the pet device's ability to access cloud services.

[0085] During the access process, the time t3 when the access request is sent can be recorded. If a valid response is received within the preset time, such as the expected webpage content or data information, and the format and content of the response meet the requirements, it indicates that the pet device can access the cloud service normally. At this time, the Internet access capability indicator Ic can be set to a value indicating that access is possible, such as "1".

[0086] If no response is received within the preset time, or if the received response does not meet the requirements (such as returning an error code or the page failing to open), it indicates that the pet device cannot access the cloud service normally. In this case, the Internet access capability indicator Ic can be set to a value indicating inaccessibility, such as "0".

[0087] Step S115: Listen for network status change events of the pet device, update the network signal stability index, the network connectivity status index, and the Internet access capability index according to the network status change events, and generate updated network status parameters.

[0088] While the pet device is running, it can continuously monitor network status change events. These events may include sudden and significant changes in network signal strength, network connection interruptions and reconnections, and inability to access the preset internet address.

[0089] When a network status change event is detected, it is necessary to recalculate network signal stability metrics, network connectivity metrics, and internet access capability metrics. For example, if a sudden change in network signal strength is detected, the fluctuation amplitude and stability metrics of the signal strength sequence need to be recalculated; if the network connection is interrupted and then reconnected, connectivity test data needs to be sent to the preset network nodes again to update the network connectivity metrics; if the preset internet address cannot be accessed, an access test needs to be performed again to update the internet access capability metrics.

[0090] The updated network signal stability index, network connectivity status index, and internet access capability index are combined to generate the updated network status parameter Np = {St', Cc', Ic'}, where St' is the updated network signal stability index, Cc' is the updated network connectivity status index, and Ic' is the updated internet access capability index.

[0091] Step S120: Obtain the current operating state of the pet device based on the state machine mechanism adopted by the pet device.

[0092] The current operating status includes online status, offline status, and switching status.

[0093] The pet device uses a state machine mechanism to manage its operating state. A state machine is a mechanism that can perform state transitions based on different input conditions and the current state.

[0094] In this step, the current operating state of the pet device can be obtained by querying its state machine. The state machine internally determines and transitions the state based on factors such as the pet device's network connection status and system operation.

[0095] If the pet device successfully connects to the network and can access cloud services normally, the state machine sets the pet device's state to online; if the pet device disconnects from the network and cannot access cloud services, the state machine sets its state to offline; when the pet device is switching from online to offline or from offline to online, the state machine sets its state to switching.

[0096] Optionally, the operating status can also be displayed visually, such as outputting status prompts on the pet device's display screen (e.g., displaying online status, offline status, switching to offline status, switching to online status, switching status, etc.), or outputting status prompts by voice, or outputting status prompts through different indicator lights and different colors on the pet device, or outputting status prompts to the application interface of the user's mobile phone, computer, smart wearable device, etc.

[0097] Step S130: Based on the preset adjustment conditions associated with the current operating state and the network status parameters, determine whether the pet device has a voice control mode adjustment requirement.

[0098] This step requires considering the current operating status of the pet device, preset adjustment conditions, and network status parameters to determine whether the voice control mode needs to be adjusted. The specific process is as follows:

[0099] Step S131: Select a corresponding target adjustment condition set from the preset adjustment conditions according to the current operating state. The target adjustment condition set contains multiple condition items that match the current operating state. Each condition item is associated with a judgment criterion for at least one indicator in the network state parameters. The judgment criterion includes a description of the normal range of the indicator and a description of the abnormal range of the indicator.

[0100] For different current operating states, corresponding adjustment condition sets are preset. After obtaining the current operating state of the pet device, the target adjustment condition set corresponding to the preset adjustment condition set is selected.

[0101] For example, when a pet device is online, the corresponding set of target adjustment conditions may include multiple conditions for network signal stability, network connectivity, and internet access capabilities. For network signal stability, the criteria might define a normal range as an average fluctuation amplitude less than a certain threshold A, and an abnormal range as an average fluctuation amplitude greater than or equal to threshold A. For network connectivity, a normal range is a value of "1," indicating a normal network connection, and an abnormal range is a value of "0," indicating an abnormal network connection. For internet access capabilities, a normal range is a value of "1," indicating normal access to cloud services, and an abnormal range is a value of "0," indicating inability to access cloud services.

[0102] Step S132: Extract the network signal stability index, the network connectivity status index, and the Internet access capability index from the network status parameters to obtain a set of network indicators to be evaluated. Each index in the set of network indicators to be evaluated has a one-to-one correspondence with the condition item in the set of target adjustment conditions.

[0103] The network signal stability index St, network connectivity index Cc, and Internet access capability index Ic are extracted from the previously obtained network state parameters to form the set of network indicators to be evaluated, Ni = {St, Cc, Ic}.

[0104] Each indicator in this set of network indicators to be evaluated corresponds one-to-one with a condition item in the set of target adjustment conditions. For example, the network signal stability indicator St corresponds to the condition item about network signal stability in the set of target adjustment conditions, the network connectivity status indicator Cc corresponds to the condition item about network connectivity, and the Internet access capability indicator Ic corresponds to the condition item about Internet access capability.

[0105] Step S133: Match each indicator in the set of network indicators to be evaluated with the corresponding condition item in the set of target adjustment conditions to generate a matching result for each indicator. The matching result includes indicators that meet the conditions and indicators that do not meet the conditions.

[0106] Specifically, when the actual value of the indicator is within the normal range described by the condition item, a matching result for the indicator that meets the condition item is generated; when the actual value of the indicator is within the abnormal range described by the condition item, a matching result for the indicator that does not meet the condition item is generated.

[0107] For each indicator in the set of network indicators Ni to be evaluated, its actual value is compared with the corresponding condition item in the set of target adjustment conditions.

[0108] Taking the network signal stability index St as an example, if the value of St is less than the threshold A of the normal range of the average fluctuation amplitude specified in the target adjustment condition set, then a matching result for the network signal stability index that meets the condition is generated; if the value of St is greater than or equal to the threshold A, then a matching result for the network signal stability index that does not meet the condition is generated.

[0109] For the network connectivity status index Cc, if the value of Cc is "1", it meets the description of the normal range of network connectivity in the target adjustment condition set, and a matching result for the network connectivity status index that meets the condition is generated; if the value of Cc is "0", a matching result for the non-compliance condition is generated.

[0110] For the Internet access capability index Ic, if the value of Ic is "1", it meets the description of the normal range of Internet access capability in the target adjustment condition set, and a matching result for the Internet access capability index that meets the condition is generated; if the value of Ic is "0", a matching result for the non-compliance condition is generated.

[0111] Step S134: Based on the condition combination rules corresponding to the current running state, perform logical combination processing on the matching results of multiple indicators to generate a combination judgment result. The condition combination rules include the combination of logical AND and logical OR of the indicator matching results under different running states.

[0112] Different current operating states correspond to different rules for combining conditions. These rules specify how to logically combine the matching results of various indicators.

[0113] For example, when the pet device is online, the condition combination rule may stipulate that the combination judgment result is satisfied only when all the matching results of all indicators meet the conditions; that is, the network signal stability indicator meets the conditions, the network connectivity status indicator meets the conditions, and the Internet access capability indicator meets the conditions. They are combined by logical AND, and the combination judgment result is true only when all three conditions are met.

[0114] When the pet device is offline, the condition combination rules may stipulate that as long as the matching result of any one of the network signal stability index, network connectivity status index, and Internet access capability index meets the condition, the combination judgment result is considered to meet the condition, and the combination is performed in a logical OR manner.

[0115] Step S135: When the combined judgment result meets the preset trigger condition, it is determined that the pet device has a voice control mode adjustment requirement; when the combined judgment result does not meet the preset trigger condition, it is determined that the pet device does not have a voice control mode adjustment requirement.

[0116] The preset trigger conditions are pre-set based on the actual application scenario and design requirements. If the combined judgment result obtained after logical combination processing meets the preset trigger conditions, such as the combined judgment result being true, then it can be determined that the pet device has a voice control mode adjustment requirement; if the combined judgment result does not meet the preset trigger conditions, such as the combined judgment result being false, then it can be determined that the pet device does not have a voice control mode adjustment requirement.

[0117] Step S140: When the pet device has a voice control mode adjustment requirement, the pet device is adjusted to the target voice control mode according to the network status parameters and the preset adjustment conditions. The target voice control mode includes online voice control mode and offline voice control mode.

[0118] Once it's determined that the pet device needs voice control mode adjustment, it's necessary to adjust the device to the appropriate target voice control mode based on network status parameters and preset adjustment conditions. This can be divided into the following two scenarios:

[0119] Scenario 1: When the pet device is currently in offline voice control mode

[0120] First, when the current voice control mode of the pet device is the offline voice control mode, if the network signal stability index indicates that the network signal stability meets the preset stability conditions, the network connectivity status index indicates that the network connectivity is normal, and the internet access capability index indicates that the internet can be accessed, then the pet device will be switched to the online voice control mode.

[0121] When the pet device is in offline voice control mode, network status parameters can be used for judgment. If the network signal stability index St is less than the preset average fluctuation threshold A, it means that the network signal stability meets the preset stability conditions; the network connectivity status index Cc is "1", indicating that the network connection is normal; and the internet access capability index Ic is "1", indicating that the internet can be accessed. When all three conditions are met, the pet device's voice control mode is switched from offline voice control mode to online voice control mode.

[0122] Next, the first voice processing component corresponding to the online voice control mode is loaded. The first voice processing component includes an online voice recognition model and an online voice command set.

[0123] After determining that the pet device needs to be switched to online voice control mode, the first voice processing component corresponding to the online voice control mode needs to be loaded. The first voice processing component includes an online voice recognition model and an online voice command set.

[0124] Online speech recognition models are trained on extensive data and can accurately convert speech signals into text information. They leverage the powerful computing resources of the cloud for speech recognition processing, achieving high accuracy. Online voice command sets contain various command templates and control intent descriptions related to online voice control modes. For example, online speech recognition models and online voice command sets can use more complex models and richer command sets to provide more powerful speech recognition and semantic understanding capabilities. Online voice command sets can cover a wider range of functions, such as timed feeding, customized feeding amounts, remote monitoring and control, and cloud-based skill extensions.

[0125] When loading the first voice processing component, the pet device can download the online voice recognition model and online voice command set from the cloud server and load them into the system memory for subsequent voice control processing.

[0126] Finally, the second voice processing component corresponding to the offline voice control mode is uninstalled. The second voice processing component includes an offline voice recognition model and an offline voice command set.

[0127] After loading the first voice processing component corresponding to the online voice control mode, the second voice processing component corresponding to the offline voice control mode can be uninstalled to save system resources. The second voice processing component includes an offline speech recognition model and an offline voice command set.

[0128] Offline speech recognition models run locally, and due to limited computing resources, their recognition accuracy is relatively low. Offline voice command sets are instruction templates and control intent descriptions specifically designed for offline voice control modes. Unloading the second voice processing component releases related resources occupied in system memory, improving system efficiency.

[0129] Optionally, the offline speech recognition model and instruction set can be simplified. For example, the model size and resource consumption of the offline speech recognition model can be reduced (e.g., by removing unimportant weights or neurons from the model through model pruning to reduce the number of parameters; or by obtaining a more streamlined offline speech recognition model through knowledge distillation, etc.), ensuring smooth operation even on resource-constrained devices. Another example is that the offline instruction set can contain only the most frequently used basic instructions, such as "feed," "stop," and "check status," and use data structures such as hash tables or index trees to build an instruction index table, enabling fast keyword lookup and instruction mapping. Since hash tables and index trees have an average time complexity of O(1) or O(logn) for lookup, instruction mapping latency can be significantly reduced.

[0130] Optionally, the second voice processing component corresponding to the offline voice control mode can be uninstalled first, and then the first voice processing component corresponding to the online voice control mode can be loaded.

[0131] Scenario 2: When the pet device is currently in online voice control mode

[0132] First, when the current voice control mode of the pet device is the online voice control mode, if the network signal stability index indicates that the network signal stability does not meet the preset stability conditions, or the network connectivity status index indicates that the network connectivity is abnormal, or the Internet access capability index indicates that the Internet cannot be accessed, then the pet device will be adjusted to the offline voice control mode.

[0133] When the pet device is in online voice control mode, it continuously monitors network status parameters. If the network signal stability index St is greater than or equal to the preset average fluctuation threshold A, it indicates that the network signal stability does not meet the preset stability conditions; or the network connectivity status index Cc is "0", indicating abnormal network connectivity; or the internet access capability index Ic is "0", indicating that internet access is unavailable. If any one of these conditions is met, the pet device's voice control mode will be switched from online voice control mode to offline voice control mode.

[0134] Next, the second voice processing component corresponding to the offline voice control mode is loaded. The second voice processing component includes an offline voice recognition model and an offline voice command set.

[0135] Once you've decided to switch the pet device to offline voice control mode, you need to load the second voice processing component corresponding to that mode. As mentioned earlier, the second voice processing component includes an offline voice recognition model and an offline voice command set.

[0136] When loading the second voice processing component, the pet device reads the offline voice recognition model and offline voice command set from local storage and loads them into system memory to support offline voice control functionality.

[0137] Finally, the first voice processing component corresponding to the online voice control mode is uninstalled. The first voice processing component includes an online voice recognition model and an online voice command set.

[0138] After loading the second voice processing component for offline voice control mode, the first voice processing component for online voice control mode needs to be uninstalled to save system resources. Uninstalling the first voice processing component releases resources related to the online speech recognition model and online voice command set occupied in system memory, ensuring stable operation of the system in offline voice control mode.

[0139] Optionally, during the adjustment to the target voice control mode, shared resources (such as shared instruction sets) and modules (such as audio preprocessing modules, feature extraction modules, etc.) between the original voice control mode and the target voice control mode can be reused to further reduce resource consumption and improve resource utilization.

[0140] In one possible implementation, the method may further include the following steps:

[0141] Step S141: After determining that the pet device has a voice control mode adjustment requirement, pause the currently executing non-critical task process and retain the core processes related to voice control, including the voice acquisition process, the command parsing process, and the command execution process.

[0142] When it's determined that a pet device needs a voice control mode adjustment, process management within the system is necessary to ensure a smooth adjustment process. Currently running non-critical tasks should be paused. These non-critical tasks may include background data synchronization tasks, system update checks, etc., and their temporary suspension will not affect the pet device's voice control functionality. Simultaneously, core processes related to voice control should be preserved, such as the voice acquisition process, command parsing process, and command execution process. The voice acquisition process is responsible for collecting the user's voice control commands in real time; the command parsing process analyzes and converts the collected voice commands; and the command execution process controls the pet device to perform corresponding operations based on the parsed commands. When pausing non-critical tasks, a pause signal can be sent to these processes through the system's process management mechanism, putting them into a paused state until the voice control mode adjustment is complete before resuming operation. For core processes, it's crucial to ensure their continuous and stable operation throughout the entire mode adjustment process to guarantee an unaffected user voice control experience.

[0143] Step S142: Collect the device parameters of the pet device, which include the current working mode parameters, user-defined setting parameters, and the record of the most recently executed control command.

[0144] When adjusting the voice control mode, it's necessary to collect the pet device's parameters. The current operating mode parameters reflect the device's state before the mode adjustment, such as whether it was in feeding, play, or rest mode. User-defined settings parameters include personalized settings made by the user according to their needs, such as feeding intervals and playtime durations. The most recently executed control command record records the specific control command executed by the pet device most recently, which helps restore the device to a suitable operating state after mode adjustment. These device parameters can be collected by accessing the pet device's system storage area. The current operating mode parameters can be read from the system's status register; user-defined settings parameters are usually stored in the device's configuration file and can be obtained through file read operations; the most recently executed control command record can be extracted from the command execution log.

[0145] Step S143: Extract user interaction context data within a preset time period. The user interaction context data includes the user's voice control command history, the pet device's response feedback record, and the user's interaction time sequence with the device.

[0146] The preset time period is set to obtain recent user interaction information related to the current voice control mode adjustment. The user-input voice control command history records all voice commands issued by the user to the pet device within the preset time period. This helps the new voice control mode better understand the user's intentions and habits based on historical voice control commands and their contextual semantic relationship with newly issued commands. The pet device's response feedback record shows the device's response to user voice commands, such as whether the command was successfully executed and the result. The user-device interaction time series records the specific time of each interaction; analyzing this time series reveals user usage patterns and habits. Extracting this user interaction context data can be achieved by querying the pet device's interaction log database. In the database, relevant records within the preset time period are filtered by time range and organized into a corresponding data structure for subsequent storage and use.

[0147] Step S144: Store the device parameters and the user interaction context data in a local state cache file, wherein the state cache file is stored in a key-value pair structure.

[0148] In this key-value pair, the key is the parameter name, and the value is the parameter value.

[0149] The collected device parameters and extracted user interaction context data are stored in a local state cache file. A key-value pair structure facilitates data storage and retrieval. For device parameters, such as the current operating mode parameter, the key "current_mode" can be used, with the corresponding value being the specific operating mode name. User-defined settings parameters can be represented by different keys depending on the setting, such as "feeding_interval" representing the feeding interval, with the corresponding value being the user-set interval. For user interaction context data, the history of user-input voice control commands can be represented by the key "voice_command_history," with the corresponding value being a list containing all historical commands. The pet device's response feedback history can be represented by the key "response_feedback_history," with the corresponding value also being a list containing all response feedback information. The user-device interaction time sequence can be represented by the key "interaction_time_sequence," with the corresponding value being a list of timestamps arranged chronologically. By storing this data in the state cache file as key-value pairs, data can be easily retrieved and used during subsequent mode adjustments.

[0150] Step S145: Load the voice processing component corresponding to the target voice control mode, wherein interruption of the core process is prohibited during the loading process.

[0151] After data collection and storage are complete, the voice processing components corresponding to the target voice control mode are loaded. If the target voice control mode is an online voice control mode, the loaded voice processing components include an online speech recognition model and an online voice command set; if it is an offline voice control mode, the offline speech recognition model and offline voice command set are loaded. During the loading process, interruption of the core processes related to voice control is prohibited.

[0152] For example, sufficient system resources can be allocated to core processes through the system's resource allocation mechanism to ensure their continuous and stable operation during the loading of the voice processing component. Simultaneously, an asynchronous loading method can be used to load the voice processing component, allowing the loading operation to run in the background without affecting the normal operation of the core processes. During the loading process, the loading progress can be monitored in real time, and appropriate notification signals can be issued upon completion.

[0153] Step S146: After the voice processing component corresponding to the target voice control mode is loaded, read the device parameters and the user interaction context data from the state cache file, replace the initial working mode parameters of the target voice control mode with the device parameters, and input the user interaction context data into the instruction parsing process of the target voice control mode.

[0154] Once the voice processing component corresponding to the target voice control mode is loaded, the previously stored device parameters and user interaction context data are read from the local state cache file. The initial working mode parameters of the target voice control mode are replaced with the current working mode parameters from the read device parameters. This allows the pet device to restore its previous working state in the new voice control mode, avoiding any impact on the consistency of the pet device's operation due to mode switching.

[0155] Simultaneously, user interaction context data can be input into the command parsing process of the target voice control mode. Based on this historical data, the command parsing process can better understand the user's voice control commands. For example, pet devices can more accurately parse the semantics of voice control commands issued after switching to the target voice control mode based on the contextual relationship between the voice control commands issued by the user before switching to the target voice control mode and the voice control commands issued after switching to the target voice control mode. This reduces the decrease in accuracy and efficiency of voice control command parsing caused by mode switching.

[0156] When reading the state cache file, the corresponding data can be obtained according to the key-value pair structure through file read operations, and then converted into the appropriate data type and format for subsequent use.

[0157] Step S147: Resume the suspended non-critical task process.

[0158] After the voice processing components corresponding to the target voice control mode have been loaded and the device parameters and user interaction context data have been correctly applied to the new mode, the previously paused non-critical task processes should be resumed. For example, the system's process management mechanism can send a resumption signal to these paused processes, allowing them to return to normal operation. When resuming these processes, it is necessary to ensure that they are compatible with the new voice control mode and will not interfere with the voice control function. Simultaneously, resources can be allocated reasonably to these resumed non-critical task processes based on system resource usage to ensure the stable operation of the entire pet device system.

[0159] Step S150: If a voice control command input by the user is received, the voice processing component corresponding to the target voice control mode is invoked to parse the voice control command and obtain the control command for the pet device.

[0160] When the pet device receives a voice control command from the user, it needs to call the voice processing component corresponding to the target voice control mode to parse the command and obtain the specific instructions to control the pet device. The specific process is as follows:

[0161] Step S151: Convert the voice control command received through the voice acquisition unit into a digital audio signal, and preprocess the digital audio signal to generate a preprocessed audio feature sequence.

[0162] The voice acquisition unit, for example, can be a microphone built into a pet device, responsible for capturing the user's voice control commands. The acquired voice signal is an analog signal and needs to be converted into a digital audio signal. This can be done using an analog-to-digital converter (ADC). The converted digital audio signal may contain some noise and interference, so further preprocessing is required. Preprocessing steps include filtering, noise reduction, and normalization. Filtering removes high-frequency noise and low-frequency interference, making the signal cleaner. Noise reduction can employ advanced noise reduction algorithms, such as adaptive filtering algorithms, to further reduce the noise level in the signal. Normalization adjusts the amplitude of the audio signal to a suitable range for subsequent processing. After preprocessing, features are extracted from the digital audio signal to generate a preprocessed audio feature sequence. Common audio feature extraction methods, such as Mel-frequency cepstral coefficients (MFCC) extraction, can be used to convert the audio signal into a series of feature vectors, forming the audio feature sequence.

[0163] Step S152: Input the audio feature sequence into the speech recognition model of the speech processing component, and generate a text instruction sequence after processing. The text instruction sequence contains continuous lexical units.

[0164] The preprocessed audio feature sequence is input into the speech recognition model of the speech processing component corresponding to the target voice control mode. For online voice control mode, an online speech recognition model is used; for offline voice control mode, an offline speech recognition model is used. The speech recognition model is an artificial intelligence model trained on a large amount of data that can convert the input audio feature sequence into a text command sequence. By learning from a large amount of speech data and corresponding text labels, this model can identify the speech content contained in the audio signal and convert it into corresponding text. The generated text command sequence consists of a series of consecutive lexical units arranged according to the semantic order of the speech commands.

[0165] Step S153: Extract the core control intent words and associated parameter words from the text instruction sequence to obtain the instruction unit to be matched.

[0166] After obtaining the text command sequence, it is necessary to extract the core control intent words and related parameter words. The core control intent words express the main purpose of the user's voice command, such as "feed," "play," or "turn on the lights." Related parameter words are the specific parameters associated with the core control intent words, such as "how much food" or "how long." These can be extracted using natural language processing techniques, such as part-of-speech tagging and named entity recognition. First, the text command sequence is part-of-speech tagged to determine the part of speech of each word. Then, the core control intent words and related parameter words are identified based on the part of speech and semantic rules. The extracted core control intent words and related parameter words are combined to form the command unit to be matched. For example, if the text command sequence is "feed the pet at 8 pm," the core control intent word is "feed," and the related parameter words are "8 pm" and "pet," then the command unit to be matched is "feed (8 pm, pet)."

[0167] Step S154: Load the standard instruction template set corresponding to the target voice control mode in the voice instruction set of the voice processing component. The standard instruction template set contains preset standard control intent words and parameter format descriptions.

[0168] Load the standard command template set from the voice command set of the voice processing component corresponding to the target voice control mode. For online voice control mode, load the standard command template set from the online voice command set; for offline voice control mode, load the standard command template set from the offline voice command set. The standard command template set contains preset standard control intent words and parameter format descriptions. The standard control intent words correspond to the core control intent words in the command unit to be matched. For example, the standard command template set may contain standard control intent words such as "feed" and "play". The parameter format description specifies the format and type of the associated parameters corresponding to each standard control intent word. For example, the parameter format description for the standard control intent word "feed" might be "time, object," indicating that the associated parameters should be time and the pet object.

[0169] Step S155: Calculate the similarity between the instruction unit to be matched and each standard instruction template in the standard instruction template set, and determine the standard instruction template with the highest similarity as the target standard instruction template.

[0170] The similarity between the instruction unit to be matched and each standard instruction template in the standard instruction template set is calculated. Several similarity calculation methods can be used, such as the edit distance algorithm and the cosine similarity algorithm. The edit distance algorithm measures the similarity between two strings by calculating the minimum number of editing operations required, including insertion, deletion, and replacement of characters. The cosine similarity algorithm measures the similarity between two vectors by calculating the cosine of the angle between them; here, the instruction unit to be matched and the standard instruction template can be converted into vector representations. For each standard instruction template, its similarity score with the instruction unit to be matched is calculated, and these scores are compared. The standard instruction template with the highest similarity is determined as the target standard instruction template. For example, if the instruction unit to be matched is "feed (8 PM, pet)", and the standard instruction template set includes standard instruction templates such as "feed (time, object)" and "play (duration, object)", by calculating the similarity score, "feed (time, object)" is found to have the highest similarity and is determined as the target standard instruction template.

[0171] Step S156: Use the standard control intent words of the target standard instruction template as instruction type identifiers, and combine them with the parameter format description of the target standard instruction template to generate structured control instructions.

[0172] The standard control intent words of the target standard command template are used as command type identifiers, such as "feed". Combining the parameter format description of the target standard command template with the associated parameter words in the command unit to be matched, a structured control command is generated. Taking the target standard command template "feed (time, object)" as an example, the associated parameter words in the command unit to be matched are "8 PM" and "pet", and the generated structured control command could be "feed (time: 8 PM, object: pet)". Such structured control commands can clearly express the user's voice control intent, facilitating the accurate execution of corresponding operations by the pet device's command execution process.

[0173] Step S160: Execute the control command and output the command execution result.

[0174] After receiving the structured control instructions, it is necessary to execute the instructions and output the execution results. The specific process is as follows:

[0175] Step S161: When the pet device is in the offline voice control mode, an independent instruction cache area is allocated in the local storage unit of the pet device, and a local instruction queue is established for storing the parsed control instructions. The local instruction queue manages the control instructions in a first-in-first-out order.

[0176] When the pet device is in offline voice control mode, a separate command cache area is allocated in the local storage unit to better manage the parsed control commands. This command cache area is dedicated to storing control commands, avoiding confusion with other data. A local command queue is established in the command cache area, managing control commands in a first-in, first-out (FIFO) order. The FIFO principle ensures that control commands are executed sequentially according to the user's input, preventing command execution chaos. The local command queue can be implemented using a queue data structure, with one end for inserting new control commands and the other end for retrieving commands to be executed.

[0177] Step S162: Add the control command to the tail of the local command queue.

[0178] The parsed structured control instructions are added to the tail of the local instruction queue. This ensures that new control instructions wait for execution in the queue in a first-in, first-out (FIFO) order. When adding control instructions, format checks and validations can be performed to ensure their legality and completeness. If an instruction does not meet the requirements, error handling may be necessary, such as providing the user with error messages.

[0179] Step S163: Retrieve the target control command from the head of the local command queue according to the first-in-first-out order of the local command queue, and call the hardware driver interface of the pet device to execute the target control command.

[0180] Following the first-in, first-out (FIFO) order of the local instruction queue, the target control instruction is retrieved from the head of the queue. The instruction at the head of the queue is the first instruction to enter the queue, meaning it's the first instruction to be executed. After retrieving the target control instruction, the pet device's hardware driver interface is invoked to execute it. The hardware driver interface acts as a bridge between the pet device and the hardware, responsible for converting control instructions into signals that the hardware can understand and execute. For example, if the target control instruction is "feed (time: 8 PM, object: pet)," the hardware driver interface can control the pet device's feeding mechanism to feed the specified pet at 8 PM based on the instruction's content.

[0181] Step S164: During the execution of the target control instruction, the execution status code returned by the hardware driver interface is monitored in real time. When the execution status code indicates that the target control instruction has been completed, the instruction execution result containing the instruction type identifier field and the execution status code is generated.

[0182] During the execution of target control instructions, the execution status codes returned by the hardware driver interface are monitored in real time. The execution status codes reflect the current state of instruction execution, such as executing, successful execution, or failed execution. When the execution status code indicates that the target control instruction has been completed, an instruction execution result is generated. The instruction execution result includes an instruction type identifier field and an execution status code. The instruction type identifier field identifies the type of instruction, such as "feed" or "play," while the execution status code specifies the execution status, such as "success" or "failure." For example, if the target control instruction "feed (time: 8 PM, object: pet)" is executed successfully, the generated instruction execution result might be "Instruction type: feed, execution status: successful."

[0183] Step S165: Feedback the result of the instruction execution to the user through at least one of the following methods: preset light flashing mode, screen text display, or local voice prompt.

[0184] The generated command execution results are fed back to the user in a preset manner. This can be achieved through at least one of the following methods: a flashing light pattern, on-screen text display, or local voice prompts. The flashing light pattern uses indicator lights on the pet device to indicate the command execution result according to a specific flashing pattern; for example, rapid flashing indicates success, and slow flashing indicates failure. On-screen text display shows the command execution result on the pet device's screen, such as "Feeding command executed successfully." Local voice prompts play voice information through the pet device's built-in speaker, announcing the command execution result to the user, such as "Your feeding command has been successfully executed." Providing feedback to the user in multiple ways ensures that the user can understand the command execution status in a timely and accurate manner.

[0185] In one possible implementation, this application may also include the following method steps:

[0186] Step S210: If the pet device triggers a switch from the offline voice control mode to the online voice control mode, a background synchronization operation is initiated to encrypt and package the executed control commands and corresponding command execution results in the local command queue to generate a synchronization data packet.

[0187] When a pet device switches from offline voice control mode to online voice control mode, data synchronization is required. First, a background synchronization process is initiated, encrypting and packaging the executed control commands and their corresponding execution results in the local command queue. This encryption can employ symmetric or asymmetric encryption algorithms. If a symmetric encryption algorithm is used, such as the Advanced Encryption Standard (AES), it ensures data security and privacy. The executed control commands and their execution results are then organized into data blocks according to a specific format, and these data blocks are encrypted using an encryption key. The encrypted data blocks are then packaged to generate a synchronization data packet. During the packaging process, necessary metadata, such as packet identifiers and timestamps, can be added for parsing and processing on the cloud server.

[0188] Step S220: Send the synchronization data packet to a preset cloud server, whereby the cloud server parses the synchronization data packet and updates the device status parameters stored on the cloud server.

[0189] The generated synchronization data packets are sent to a pre-defined cloud server. Secure network protocols, such as Transport Layer Security (TLS), can be used through the pet device's network interface to ensure the security and integrity of the synchronization data packets during transmission. Before sending the data packets, the pet device needs to establish a connection with the cloud server, which may involve authentication and handshake processes to ensure the legitimacy and reliability of both parties. Once the connection is successfully established, the pet device sends the synchronization data packets to the cloud server.

[0190] After receiving the synchronization data packet, the cloud server first decrypts it. Using the same encryption key as the pet device, the encrypted synchronization data packet is decrypted into the original executed control commands and their corresponding execution results. Next, the cloud server parses the decrypted data to identify the specific content of each control command and its corresponding execution result.

[0191] The cloud server stores the device status parameters of the pet equipment, which reflect various operating states and settings of the equipment. Based on the parsed executed control commands and their results, the cloud server updates the stored device status parameters. For example, if the executed control command is to adjust the feeding time of the pet equipment, the cloud server will update the stored feeding time parameter accordingly; if the command execution result shows that an operation failed, the cloud server will also record this failure information for subsequent processing.

[0192] Step S230: Receive the status correction instruction returned by the cloud server, and adjust the local status parameters of the pet device according to the status correction instruction, so that the local status parameters are consistent with the device status parameters stored by the cloud server. The status correction instruction includes the difference information between the device status parameters and the local status parameters.

[0193] After updating the device status parameters, the cloud server compares the local status parameters of the pet device with the device status parameters stored in the cloud to identify any discrepancies. Based on these discrepancies, the cloud server generates a status correction command and sends it back to the pet device.

[0194] After receiving a status correction command from the cloud server, the pet device parses the command and extracts the differences between the device status parameters and the local status parameters. Based on these differences, the pet device adjusts its local status parameters. For example, if the difference information shows that the feeding time parameters stored in the cloud differ from the local parameters, the pet device will update its local feeding time parameters to match those in the cloud. In this way, the local status parameters of the pet device are kept consistent with the device status parameters stored on the cloud server, achieving data synchronization and status consistency.

[0195] The method provided in this application generates network status parameters by monitoring the network signal stability, connectivity, and internet access capability of the pet device. It then uses a state machine mechanism to obtain the device's current operating status and dynamically assesses whether a voice control mode needs to be switched based on preset adjustment conditions, including indicator judgment standards and logical combination rules corresponding to different states. When a switch is required, it retains the core process, caches device parameters and user interaction context to a local state file, loads the voice processing component corresponding to the target mode, and restores non-critical tasks to achieve seamless switching. When parsing voice commands, it inputs the preprocessed audio feature sequence into the voice recognition model of the target mode to generate text commands and extracts structured control commands by matching standard command templates. During the execution phase, in offline mode, it uses a local command queue for first-in-first-out management, monitors the hardware execution status in real time and provides feedback, and simultaneously uploads offline execution data to the cloud to correct the local status through a background synchronization mechanism. This method combines multi-dimensional network status monitoring with a state machine to accurately determine the switching timing and avoid accidental operations. Furthermore, by preserving the core process and caching the state, it ensures that no commands are lost during the switching process and that user interaction remains continuous. Modular component loading and command parsing optimization adapt to control needs in different network environments. Local queues and real-time feedback improve response efficiency in offline scenarios, and cloud synchronization ensures state consistency. This enables intelligent adaptive switching of the voice control mode for pet devices in scenarios with fluctuating network conditions, ensuring reliable parsing and execution of control commands and improving the user experience under various network conditions.

[0196] Figure 2 This is a schematic diagram of a voice control system 100 for pet devices based on intelligent switching, provided as an embodiment of this application. Figure 2 As shown, the processor 120 can be used in the smart switching-based pet device voice control system 100 and to perform the functions in this invention.

[0197] The intelligent switching-based pet device voice control system 100 can be a general-purpose server or a special-purpose server; both can be used to implement the intelligent switching-based pet device voice control method of this invention. Although only one server is shown in this invention, for convenience, the functions described in this invention can be implemented in a distributed manner on multiple similar platforms to balance the load.

[0198] For example, the smart-switching-based pet device voice control system 100 may include a network port 110 connected to a network, one or more processors 120 for executing program instructions, a communication bus 130, and various forms of storage media 140, such as a disk, ROM, or RAM, or any combination thereof. Exemplarily, the smart-switching-based pet device voice control system 100 may also include program instructions stored in ROM, RAM, or other types of non-transitory storage media, or any combination thereof. The method of the present invention can be implemented according to these program instructions. The smart-switching-based pet device voice control system 100 also includes an input / output (I / O) interface 150 between the computer and other input / output devices.

[0199] For ease of explanation, only one processor is described in the intelligent switching-based pet device voice control system 100. However, it should be noted that the intelligent switching-based pet device voice control system 100 of the present invention may also include multiple processors, and therefore the steps performed by one processor described in the present invention may also be performed jointly or individually by multiple processors. For example, if the processor of the intelligent switching-based pet device voice control system 100 performs steps A and B, it should be understood that steps A and B may also be performed jointly by two different processors or individually by one processor. For example, the first processor performs step A, the second processor performs step B, or the first processor and the second processor jointly perform steps A and B.

[0200] This invention discloses a computer read storage medium that stores a computer program for electronic data interchange, wherein the computer program causes a computer to execute the steps in the smart switching-based voice control method for pet devices described in the foregoing embodiments.

[0201] This invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform the steps in the smart switching-based voice control method for pet devices described in the foregoing embodiments.

[0202] The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any inventive effort.

[0203] Through the detailed description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electronically erasable rewritable read-only memory (EEPROM), compact optical disc (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium that can be used to have or store data.

[0204] Finally, it should be noted that the above-disclosed embodiments are merely preferred embodiments of the present invention and are only used to illustrate the technical solutions of the present invention, not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A voice control method for pet devices based on intelligent switching, characterized in that, The method includes: Monitor the network connection status of the pet device to obtain network status parameters, which include network signal stability indicators, network connectivity status indicators, and Internet access capability indicators. The current operating state of the pet device is obtained based on the state machine mechanism used by the pet device. The current operating state includes online state, offline state, and switching state. Based on the preset adjustment conditions associated with the current operating status and the network status parameters, determine whether the pet device has a voice control mode adjustment requirement; When the pet device requires adjustment of its voice control mode, the pet device is adjusted to the target voice control mode according to the network status parameters and the preset adjustment conditions, including: After determining that the pet device needs to adjust its voice control mode, pause the currently executing non-critical task processes and retain the core processes related to voice control, including the voice acquisition process, the command parsing process, and the command execution process. Collect the device parameters of the pet device, which include current working mode parameters, user-defined setting parameters, and the record of the most recently executed control command. Extract user interaction context data within a preset time period. The user interaction context data includes the user's voice control command history, the pet device's response feedback record, and the user's interaction time sequence with the device. The device parameters and the user interaction context data are stored in a local state cache file. The state cache file is stored in a key-value pair structure, wherein the key in the key-value pair is the parameter name, and the value in the key-value pair is the parameter value. Load the voice processing component corresponding to the target voice control mode, wherein interruption of the core process is prohibited during the loading process; Once the voice processing component corresponding to the target voice control mode is loaded, the device parameters and the user interaction context data are read from the state cache file, and the initial working mode parameters of the target voice control mode are replaced with the device parameters. The user interaction context data is then input into the instruction parsing process of the target voice control mode. Resume the suspended non-critical task process; the target voice control mode includes online voice control mode and offline voice control mode. If a voice control command is received from the user, the voice processing component corresponding to the target voice control mode is invoked to parse the voice control command and obtain the control command for the pet device. Execute the control command and output the command execution result.

2. The voice control method for pet devices based on intelligent switching according to claim 1, characterized in that, The network connection status of the pet monitoring device is used to obtain network status parameters, including: Periodically detect the network signal reception strength of the pet device and generate a signal strength sequence; A continuous stability analysis is performed on the signal strength sequence to calculate the signal strength fluctuation amplitude between adjacent detection periods, and the network signal stability index is generated based on the signal strength fluctuation amplitude. Connectivity test data is sent to a preset network node, and a network connectivity status index is generated based on the round-trip transmission status of the connectivity test data. The network connectivity status index is used to indicate whether the network connection is normal. Access a preset Internet address and generate the Internet access capability index based on the access response result. The Internet access capability index is used to indicate whether the pet device can access cloud services normally. Monitor network status change events of the pet device, update the network signal stability index, the network connectivity status index, and the internet access capability index based on the network status change events, and generate updated network status parameters.

3. The voice control method for pet devices based on intelligent switching according to claim 1, characterized in that, The step of determining whether the pet device needs a voice control mode adjustment based on the preset adjustment conditions associated with the current operating state and the network status parameters includes: Based on the current operating state, a corresponding set of target adjustment conditions is selected from the preset adjustment conditions. The set of target adjustment conditions includes multiple condition items that match the current operating state. Each condition item is associated with a judgment criterion for at least one indicator in the network state parameters. The judgment criterion includes a description of the normal range of the indicator and a description of the abnormal range of the indicator. The network signal stability index, the network connectivity status index, and the Internet access capability index are extracted from the network status parameters to obtain a set of network indicators to be evaluated. Each index in the set of network indicators to be evaluated has a one-to-one correspondence with the condition item in the set of target adjustment conditions. Each indicator in the set of network indicators to be evaluated is matched with the corresponding condition item in the set of target adjustment conditions to generate a matching result for each indicator. The matching result includes indicators that meet the conditions and indicators that do not meet the conditions. Specifically, when the actual value of the indicator is within the normal range of the condition item, a matching result for the indicator that meets the conditions is generated; when the actual value of the indicator is within the abnormal range of the condition item, a matching result for the indicator that does not meet the conditions is generated. Based on the condition combination rules corresponding to the current operating state, the matching results of multiple indicators are logically combined to generate a combined judgment result. The condition combination rules include the combination of logical AND and logical OR of the indicator matching results under different operating states. When the combined judgment result meets the preset triggering condition, it is determined that the pet device has a need to adjust the voice control mode; When the combined judgment result does not meet the preset triggering condition, it is determined that the pet device does not have the need to adjust the voice control mode.

4. The voice control method for pet devices based on intelligent switching according to claim 1, characterized in that, The step of adjusting the pet device to the target voice control mode according to the network status parameters and the preset adjustment conditions includes: When the current voice control mode of the pet device is the offline voice control mode, if the network signal stability index indicates that the network signal stability meets the preset stability conditions, the network connectivity status index indicates that the network connectivity is normal, and the Internet access capability index indicates that the Internet can be accessed, then the pet device will be adjusted to the online voice control mode. Load the first voice processing component corresponding to the online voice control mode. The first voice processing component includes an online voice recognition model and an online voice command set. Unload the second voice processing component corresponding to the offline voice control mode. The second voice processing component includes an offline voice recognition model and an offline voice command set.

5. The voice control method for pet devices based on intelligent switching according to claim 1, characterized in that, The step of adjusting the pet device to the target voice control mode according to the network status parameters and the preset adjustment conditions includes: When the current voice control mode of the pet device is the online voice control mode, if the network signal stability index indicates that the network signal stability does not meet the preset stability conditions, or the network connectivity status index indicates that the network connectivity is abnormal, or the Internet access capability index indicates that the Internet cannot be accessed, then the pet device will be adjusted to the offline voice control mode. Load the second voice processing component corresponding to the offline voice control mode. The second voice processing component includes an offline voice recognition model and an offline voice command set. Unload the first voice processing component corresponding to the online voice control mode. The first voice processing component includes an online voice recognition model and an online voice command set.

6. The voice control method for pet devices based on intelligent switching according to claim 1, characterized in that, The step of calling the voice processing component corresponding to the target voice control mode to parse the voice control command and obtain the control command for the pet device includes: The voice control commands received through the voice acquisition unit are converted into digital audio signals, and the digital audio signals are preprocessed to generate a preprocessed audio feature sequence. The audio feature sequence is input into the speech recognition model of the speech processing component, and after processing, a text instruction sequence is generated, which contains consecutive lexical units. Extract the core control intent words and associated parameter words from the text instruction sequence to obtain the instruction unit to be matched; Load the voice instruction set of the voice processing component and the standard instruction template set corresponding to the target voice control mode. The standard instruction template set includes preset standard control intent words and parameter format descriptions. Calculate the similarity between the instruction unit to be matched and each standard instruction template in the standard instruction template set, and determine the standard instruction template with the highest similarity as the target standard instruction template; The standard control intent words of the target standard instruction template are used as instruction type identifiers, and structured control instructions are generated by combining the parameter format description of the target standard instruction template.

7. The voice control method for pet devices based on intelligent switching according to claim 1, characterized in that, The execution of the control command and the output of the command execution result include: When the pet device is in the offline voice control mode, an independent instruction cache area is allocated in the local storage unit of the pet device, and a local instruction queue is established to store the parsed control instructions. The local instruction queue manages the control instructions in a first-in-first-out order. Add the control command to the tail of the local command queue; The target control command is retrieved from the head of the local command queue in a first-in-first-out order, and the target control command is executed by calling the hardware driver interface of the pet device. During the execution of the target control instruction, the execution status code returned by the hardware driver interface is monitored in real time. When the execution status code indicates that the target control instruction has been completed, the instruction execution result containing the instruction type identifier field and the execution status code is generated. The system provides feedback to the user on the execution result of the instruction through at least one of the following methods: preset light flashing pattern, on-screen text display, or local voice prompt.

8. The voice control method for pet devices based on intelligent switching according to claim 1, characterized in that, The method further includes: If the pet device triggers a switch from the offline voice control mode to the online voice control mode, a background synchronization operation is initiated to encrypt and package the executed control commands and corresponding command execution results in the local command queue to generate a synchronization data packet. The synchronization data packet is sent to a preset cloud server, which then parses the synchronization data packet and updates the device status parameters stored on the cloud server. The system receives a status correction instruction returned by the cloud server and adjusts the local status parameters of the pet device according to the status correction instruction, so that the local status parameters are consistent with the device status parameters stored on the cloud server. The status correction instruction includes information on the differences between the device status parameters and the local status parameters.

9. A voice control system for pet devices based on intelligent switching, characterized in that, The device includes a processor and a computer-readable storage medium storing machine-executable instructions, which, when executed by a computer, implement the voice control method for pet devices based on intelligent switching as described in any one of claims 1-8.