AI conversation function adaptation method, AI gateway, mobile client and electronic device

CN123035451APending Publication Date: 2026-11-03SHANGHAI SHENQI ERA INTELLIGENT TERMINAL CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611271196.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-20
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

The AI ​​gateway cannot detect changes in the resource status of mobile clients in a timely manner, resulting in continuous high-bandwidth output, which causes mobile devices to consume power, lag, or even application crashes or communication failures.

Method used

The AI ​​gateway acquires and maintains resource and function information of the mobile client, dynamically updates resource and function status by receiving resource change messages, and adapts data push strategies to match the current resource status of the mobile client.

Benefits of technology

It improves the stability and user experience of AI sessions on mobile clients, avoids resource waste and application crashes, and ensures the reliability of communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123035451A_ABST
    Figure CN123035451A_ABST
Patent Text Reader

Abstract

The application discloses an AI conversation function adaptation method, an AI gateway, a mobile client and electronic equipment, relates to the technical field of communication, and through acquiring and maintaining first resource information and first function information of the mobile client accessing the AI gateway, the enabling state corresponding to the first function item in the first function information is adapted to the first resource information, and when a resource change message is received, second resource information is obtained by dynamically updating the first resource information based on the second parameter value of the target running state parameter in the resource change message, and the second function information is re-adapted to the second resource information, and the second function information is adapted to the enabling state corresponding to the second function item in the second resource information, so that the AI gateway can obtain the change of the resource information of the mobile client in time, and adaptively change the data pushing strategy based on the change of the function information adapted to the resource information, thereby improving the stability and user experience of the mobile client AI conversation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to AI conversation function adaptation methods, AI gateways, mobile clients, and electronic devices. Background Technology

[0002] Currently, the interaction process between the AI ​​Agent gateway and the mobile client to reach an agreement on the set of functions supported by both parties is a one-time static declaration, and the set of functions supported by both parties remains fixed after the connection is established. However, the resource status of the mobile client changes continuously during use, such as running out of power, switching to a mobile data network, or having the processor occupied by other applications. The AI ​​gateway is unaware of this and continues to push high-bandwidth streaming output and media files, causing the mobile device to consume more power and become more laggy, and in severe cases, causing application crashes or communication failures. Summary of the Invention

[0003] The main purpose of this application is to provide an AI conversation function adaptation method, an AI gateway, a mobile client, and an electronic device, so that the AI ​​gateway can promptly perceive changes in the resource information of the mobile client and adaptively change the data push strategy based on changes in functional information that are compatible with the resource information, thereby improving the stability of AI conversations on the mobile client and the user experience.

[0004] To achieve the above objectives, this application proposes an AI session function adaptation method applied to an AI gateway. The method includes: acquiring and maintaining first resource information and first function information of a mobile client accessing the AI ​​gateway, wherein the first resource information includes the mobile client's running status parameters and a first parameter value corresponding to the running status parameters; the first function information includes a first function item used by the mobile client in an AI session with the AI ​​gateway and an activation status corresponding to the first function item; the activation status corresponding to the first function item is adapted to the first resource information; receiving a resource change message reported by the mobile client, the resource change message including a target running status parameter and a second parameter value corresponding to the target running status parameter, the target running status parameter being a parameter whose current parameter value is different from the first parameter value in the running status parameters; updating the first parameter value of the target running status parameter in the first resource information to the second parameter value according to the resource change message, thereby obtaining second resource information; and determining second function information based on the second resource information, the second function information including a second function item and an activation status corresponding to the second function item, the activation status corresponding to the second function item being adapted to the second resource information.

[0005] Furthermore, to achieve the above objectives, this application also proposes an AI conversation function adaptation method applied to a mobile client. The method includes: reporting first resource information and first function information to an AI gateway accessed by the mobile client, wherein the first resource information includes the mobile client's operating status parameters and a first parameter value corresponding to the operating status parameters; the first function information includes the mobile client's AI conversation function adaptation method with the AI ​​gateway. The session includes a first functional item and its corresponding activation status; the activation status of the first functional item is adapted to the first resource information; the difference between the current parameter value of the running status parameter and the first parameter value is collected and monitored to see if it meets a preset requirement; the parameter whose difference between the current parameter value and the first parameter value meets the preset requirement is determined as the target running status parameter, and a resource change message is generated based on the target running status parameter and the corresponding second parameter value; the resource change message is sent to the AI ​​gateway, and the AI ​​gateway updates the first parameter value of the target running status parameter in the first resource information to the second parameter value according to the resource change message to obtain the second resource information, and determines the second functional information based on the second resource information, the second functional information including: a second functional item and its corresponding activation status, the activation status of the second functional item being adapted to the second resource information.

[0006] In addition, to achieve the above objectives, this application also proposes an AI gateway, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the AI ​​session function adaptation method applied to the AI ​​gateway as described above.

[0007] In addition, to achieve the above objectives, this application also proposes a mobile client, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the AI ​​conversation function adaptation method applied to the mobile client as described above.

[0008] In addition, to achieve the above objectives, this application also proposes an electronic device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the AI ​​session function adaptation method as described above for an AI gateway, and / or the steps of the AI ​​session function adaptation method as described above for a mobile client.

[0009] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the steps of the AI ​​session function adaptation method as described above for AI gateways, and / or the steps of the AI ​​session function adaptation method as described above for mobile clients.

[0010] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the AI ​​session function adaptation method as described above for an AI gateway, and / or the steps of the AI ​​session function adaptation method as described above for a mobile client.

[0011] One or more technical solutions proposed in this application have at least the following technical effects: By acquiring and maintaining the first resource information and first function information of the mobile client connected to the AI ​​gateway, the activation status of the first function item in the first function information is adapted to the first resource information. When a resource change message is received, the first resource information is dynamically updated based on the value of the second parameter of the target running status parameter in the resource change message to obtain the second resource information. The second function information is then re-adapted to the second resource information, and the second function information is adapted to the activation status of the second function item in the second resource information. This allows the AI ​​gateway to obtain changes in the resource information of the mobile client in a timely manner and adjust the function items used in the AI ​​session between the client and the AI ​​gateway. In other words, the AI ​​gateway can promptly perceive changes in the resource information of the mobile client and adaptively change the data push strategy based on the changes in the function information adapted to the resource information, thereby improving the stability of the AI ​​session of the mobile client and the user experience. Attached Figure Description

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

[0013] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0014] Figure 1 A flowchart illustrating the first embodiment of the AI ​​conversation function adaptation method of this application; Figure 2A flowchart illustrating the second embodiment of the AI ​​conversation function adaptation method of this application; Figure 3 A flowchart illustrating the third embodiment of the AI ​​conversation function adaptation method of this application; Figure 4 A flowchart illustrating the fourth embodiment of the AI ​​conversation function adaptation method of this application; Figure 5 A flowchart illustrating the fifth embodiment of the AI ​​conversation function adaptation method of this application; Figure 6 This is a schematic diagram of the software architecture of the AI ​​gateway in this application; Figure 7 This is a schematic diagram of the software architecture of the mobile client of this application; Figure 8 A schematic diagram of the interaction process for implementing the AI ​​conversation function adaptation method for the AI ​​gateway and mobile client in this application; Figure 9 This is a schematic diagram of the module structure of the AI ​​gateway in an embodiment of this application; Figure 10 This is a schematic diagram of the module structure of the mobile client according to an embodiment of this application; Figure 11 This is a schematic diagram of the module structure of an electronic device according to an embodiment of this application.

[0015] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0016] The embodiments of the technical solution of this application will now be described in detail with reference to the accompanying drawings. These embodiments are only used to more clearly illustrate the technical solution of this application and are therefore merely examples, and should not be used to limit the scope of protection of this application.

[0017] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0018] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.

[0019] 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 this application. 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.

[0020] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0021] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).

[0022] The AI ​​Agent Gateway (hereinafter referred to as the AI ​​Gateway) is an intermediary layer that connects mobile clients (through mobile applications) with the backend large language model service. It is responsible for managing sessions, routing messages, calling tools, and executing skills.

[0023] From a technology lifecycle perspective, AI gateways are currently in a phase of rapid development: large language model capabilities are continuously improving, and agent application scenarios are rapidly expanding from desktop to mobile devices, with mobile clients becoming one of the most important access points for AI agents. At the same time, mobile AI applications have extremely high real-time requirements (users expect streaming output and multimodal responses), but the resource constraints of mobile devices (limited battery power, unstable networks, limited computing power) and the contradiction between these requirements have not yet been systematically resolved, and relevant protocol standards are still in the early exploratory stages.

[0024] MCP and A2A protocols are currently the mainstream communication protocols in the AI ​​Agent field. During the handshake phase or connection establishment, the AI ​​gateway and mobile client exchange their respective lists of supported capabilities (such as which tools and media types are supported). Once the connection is established, the set of supported functions remains fixed throughout the entire AI session. In other words, after the negotiation, the AI ​​gateway is unaware of any changes in the mobile client's resource status. However, the mobile client's resource status continuously changes during use. When the user's mobile device battery drops from above 80% to below 10%, switches from Wi-Fi to mobile data, or multiple applications are running simultaneously, causing processor overload, the AI ​​gateway remains unaware and continues to push data according to the agreed-upon set of functions. The mobile client is forced to receive and render data beyond its current processing capabilities, causing the mobile device to consume more power and become more sluggish, potentially leading to application crashes or communication failures.

[0025] To address this, this application proposes an AI session function adaptation method applied to an AI gateway. The method includes: acquiring and maintaining first resource information and first function information of a mobile client accessing the AI ​​gateway, wherein the first resource information includes the mobile client's running status parameters and a first parameter value corresponding to the running status parameters; the first function information includes a first function item used by the mobile client in an AI session with the AI ​​gateway and an activation status corresponding to the first function item; the activation status corresponding to the first function item is adapted to the first resource information; receiving a resource change message reported by the mobile client, the resource change message including a target running status parameter and a second parameter value corresponding to the target running status parameter, the target running status parameter being a parameter whose current parameter value is different from the first parameter value in the running status parameters; updating the first parameter value of the target running status parameter in the first resource information to the second parameter value according to the resource change message, thereby obtaining second resource information; and determining second function information based on the second resource information, the second function information including a second function item and an activation status corresponding to the second function item, the activation status corresponding to the second function item being adapted to the second resource information.

[0026] By acquiring and maintaining the first resource information and first function information of the mobile client connected to the AI ​​gateway, the activation status of the first function item in the first function information is adapted to the first resource information. When a resource change message is received, the first resource information is dynamically updated based on the value of the second parameter of the target running status parameter in the resource change message to obtain the second resource information. The second function information is then re-adapted to the second resource information, and the second function information is adapted to the activation status of the second function item in the second resource information. This allows the AI ​​gateway to obtain changes in the resource information of the mobile client in a timely manner and adjust the function items used in the AI ​​session between the client and the AI ​​gateway. In other words, the AI ​​gateway can promptly perceive changes in the resource information of the mobile client and adaptively change the data push strategy based on the changes in the function information adapted to the resource information, thereby improving the stability of the AI ​​session of the mobile client and the user experience.

[0027] Based on the above, this application provides an AI conversation function adaptation method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the AI ​​conversation function adaptation method of this application.

[0028] In this embodiment, the AI ​​conversation function adaptation method includes steps S10 to S13: Step S10: Obtain and maintain the first resource information and first function information of the mobile client connected to the AI ​​gateway.

[0029] The first resource information includes the running status parameters of the mobile client and the first parameter value corresponding to the running status parameters; the first function information includes the first function item used by the mobile client in the AI ​​session with the AI ​​gateway and the activation status corresponding to the first function item; the activation status corresponding to the first function item is adapted to the first resource information.

[0030] In this embodiment, after the mobile client accesses the AI ​​gateway, the AI ​​gateway maintains first resource information and first function information for each accessing mobile client in its local memory.

[0031] The first resource information characterizes the operating status of the mobile client when it connects to the AI ​​gateway. This first resource information includes various operating status parameters of the mobile client, and the corresponding first parameter values ​​for each operating status parameter. These first parameter values ​​are the latest parameter values ​​when the mobile client connects to the AI ​​gateway. The operating status parameters include one or more of the following: current battery percentage, network connection type (e.g., WiFi, mobile data network), CPU load rate, and available memory percentage.

[0032] The first functional information represents the functional information used by the mobile client during its AI session with the AI ​​gateway. The first functional information includes the first functional item used by the mobile client during its AI session with the AI ​​gateway, and the corresponding activation status of that first functional item.

[0033] The first functional item includes one or more of the following: streaming inference output, media file transfer, and tool call results. Streaming inference output refers to the model outputting results in a streaming manner while generating answers, displaying results progressively without waiting for all content to be generated; media file transfer refers to the system's ability to transfer or process media files (such as images, audio, and video); tool call results refer to the model's ability to receive and process the results returned after executing external tool calls (such as search, calculation, and API requests). The enabled status of streaming inference output can include: enabled, throttled, or disabled; the enabled status of media file transfer can include: enabled or disabled; the enabled status of tool call results can include: enabled or disabled.

[0034] The activation status of the first function item is matched with the first resource information, which means that the activation status of the function item matches and is adapted to the current resource status of the mobile client.

[0035] It is feasible that the first resource information includes only one running status parameter, and the first functional item includes at least one function. For example, the first resource information only includes the current battery percentage. When the current battery percentage is greater than 50%, the battery power is sufficient and can run at full capacity. Therefore, if the first functional item includes at least one of streaming inference output, media file transfer, and tool call results, then at least one function of the first functional item is enabled.

[0036] For example, the first resource information only includes the network connection type. When the network connection type is a mobile data network, in order to save traffic costs, it is necessary to restrict some large file transfer functions. Therefore, if the first function item includes at least one of streaming inference output, media file transfer, and tool call result, the enabled state corresponding to streaming inference output is enabled (throttling, low refresh rate), the enabled state corresponding to media file transfer is disabled, and the enabled state of tool call result is enabled (plain text digest).

[0037] It is possible that the first resource information may include two or more operating status parameters, and the first functional item may include at least one function.

[0038] For example, the first resource information includes the current battery percentage, network connection type, CPU load rate, and memory availability. When the current battery percentage is 80%, the network connection type is Wi-Fi, the CPU load rate is 25%, and the memory availability is 55%, all resources are sufficient to run at full capacity. Therefore, if the first function item includes at least one of streaming inference output, media file transfer, and tool call results, then at least one function of the first function item is enabled.

[0039] For example, the first resource information includes the current battery percentage, network connection type, and CPU load rate. If the current battery percentage is 12%, the network connection type is Wi-Fi, and the CPU load rate is 20%, the battery is insufficient, and it is necessary to limit the functions that consume a lot of power. Therefore, if the first function item includes at least one of streaming inference output, media file transfer, and tool call result, the enabled state of streaming inference output is disabled (results are returned only once), the enabled state of media file transfer is disabled, and the enabled state of tool call result is enabled (plain text digest).

[0040] Step S11: Receive a resource change message reported by the mobile client. The resource change message includes the target running status parameter and the value of the second parameter corresponding to the target running status parameter.

[0041] As the mobile client is used, its resource status changes continuously. The mobile client will report resource change messages to the AI ​​gateway. The resource change messages include the target running status parameters and the value of the second parameter corresponding to the target running status parameters.

[0042] The target operating status parameter is one or more of the operating status parameters included in the first resource information. Specifically, the target operating status parameter may be a parameter whose difference between the current parameter value and the first parameter value meets a preset requirement.

[0043] If the runtime status parameters are numerical, such as current battery percentage, CPU load rate, or memory availability, then in one example, the above-mentioned preset requirement is that the values ​​of the two parameters are different. That is, if the current value of any runtime status parameter differs from the value of the first parameter, then that runtime status parameter is determined as the target runtime status parameter. In this way, even if the resource status changes slightly, the mobile client will report it to the AI ​​gateway in a timely manner.

[0044] In another example, the aforementioned preset requirement is that the difference between the values ​​of the two parameters is greater than a preset threshold, which is not zero. That is, if the difference between the current value of any running status parameter and the value of the first parameter satisfies the preset threshold, then that running status parameter is determined as the target running status parameter. By setting a preset threshold to filter out minor fluctuations, the mobile client will only report to the AI ​​gateway when a substantial, business-significant change occurs in the resource status. This significantly reduces the number of invalid reports, lowers communication overhead, and reduces the gateway's computational load.

[0045] For example, if the current battery percentage changes from above a first battery threshold (e.g., 15%) to below the first battery threshold, or from below a second battery threshold to above the second battery threshold (e.g., 30%), the mobile client can determine the current battery percentage as the target operating status parameter. Similarly, if the CPU load rate changes from below the processor high load threshold (e.g., 85%) to exceeding the processor high load threshold for two consecutive samples, or from above the processor load recovery threshold (e.g., 60%) to falling below the processor load recovery threshold for two consecutive samples, the mobile client can determine the CPU load rate as the target operating status parameter. Likewise, if the available memory percentage changes from above a preset memory alarm threshold (e.g., 50%) to below the preset memory alarm threshold, the mobile client can determine the available memory percentage as the target operating status parameter.

[0046] These examples are for illustrative purposes only. In actual applications, the settings can be adjusted as needed, and will not be elaborated further in this embodiment.

[0047] If the parameter value of the running status parameter is a character type, such as network connection type (e.g., WiFi, mobile data network), then the above-mentioned preset requirement is that the parameter values ​​of the two parameters are different. That is, if the current parameter value of any running status parameter is different from the value of the first parameter, then that running status parameter is determined as the target running status parameter. For example, when the enumerated value of the network connection type changes, such as from WiFi to mobile data network, or from having network access to having no network access, the mobile client can determine the network connection type as the target running status parameter.

[0048] Step S12: Based on the resource change message, update the first parameter value of the target running status parameter in the first resource information to the second parameter value to obtain the second resource information.

[0049] After receiving a resource change message, the AI ​​gateway determines the target operating status parameter and the corresponding second parameter value, and changes the first parameter value in the stored first resource information corresponding to the target operating status parameter to the second parameter value, thereby obtaining the second resource information.

[0050] For example, the first resource information includes: current battery percentage of 80%, network connection type of Wi-Fi, CPU load rate of 25%, and memory availability of 55%. The resource change message reported by the mobile client includes: target running status parameter (current battery percentage), with the corresponding second parameter valued at 20%. Therefore, the second resource information obtained after updating the first resource information includes: current battery percentage of 20%, network connection type of Wi-Fi, CPU load rate of 25%, and memory availability of 55%.

[0051] For example, the first resource information includes: the current battery percentage is 80%, the network connection type is Wi-Fi, and the CPU load rate is 25%. The resource change message reported by the mobile client includes: target operating status parameters (current battery percentage and network connection type), a second parameter corresponding to the current battery percentage of 20%, and a second parameter corresponding to the network connection type of mobile data network. Therefore, the second resource information obtained after updating the first resource information includes: the current battery percentage is 20%, the network connection type is mobile data network, and the CPU load rate is 25%.

[0052] Step S13: Determine the second functional information based on the second resource information.

[0053] The second functional information includes: the second functional item, the activation status corresponding to the second functional item, and the activation status corresponding to the second functional item is adapted to the second resource information.

[0054] Based on the resource change message, the first parameter value of the target running status parameter in the first resource information is updated to the second parameter value to obtain the second resource information, and then the second resource information that matches the second resource information is determined.

[0055] For example, the first resource information includes: current battery percentage of 80%, network connection type of Wi-Fi, CPU load rate of 25%, and memory availability of 55%. The first functional information corresponding to this first resource information includes: streaming inference output (enabled), media file transfer (enabled), and tool call results (enabled). Based on the resource change message reported by the mobile client (current battery percentage, corresponding to a second parameter value of 20%), the second resource information obtained after updating the first resource information includes: current battery percentage of 20%, network connection type of Wi-Fi, CPU load rate of 25%, and memory availability of 55%. Due to the low battery level, functions with high power consumption need to be restricted. Therefore, the second functional information corresponding to this second resource information includes: streaming inference output (disabled, only returns results once), media file transfer (disabled), and tool call results (enabled, plain text summary).

[0056] For example, the first resource information includes: current battery percentage of 80%, network connection type of Wi-Fi, and CPU load rate of 25%. The corresponding first functional information includes: streaming inference output (enabled), media file transfer (enabled), and tool call results (enabled). Based on the resource change message reported by the mobile client (current battery percentage, corresponding to a second parameter value of 20%; network connection type, corresponding to a second parameter value of mobile data network), the second resource information obtained after updating the first resource information includes: current battery percentage of 20%, network connection type of mobile data network, and CPU load rate of 25%. Due to the low battery level, it is necessary to restrict power-consuming functions, and to save data usage costs, it is necessary to restrict some large file transfer functions. Therefore, the corresponding second functional information includes: streaming inference output (disabled, only returns results once), media file transfer (disabled), and tool call results (disabled).

[0057] In this embodiment, by acquiring and maintaining the first resource information and first function information of the mobile client accessing the AI ​​gateway, the activation status of the first function item in the first function information is adapted to the first resource information. When a resource change message is received, the first resource information is dynamically updated based on the second parameter value of the target running state parameter in the resource change message to obtain the second resource information, and the second function information is re-adapted for the second resource information. The second function information is adapted to the activation status of the second function item in the second resource information, so that the AI ​​gateway can obtain the changes in the resource information of the mobile client in a timely manner and adjust the function items used in the AI ​​session between the mobile client and the AI ​​gateway in a timely manner. In other words, the AI ​​gateway can promptly perceive the changes in the resource information of the mobile client and adaptively change the data push strategy based on the changes in the function information adapted to the resource information, thereby improving the stability of the AI ​​session of the mobile client and the user experience.

[0058] It is worth noting that in this embodiment, the AI ​​gateway simultaneously serves a large number of heterogeneous mobile clients, each with different resource statuses. The AI ​​gateway independently maintains resource and functional information for each mobile client to achieve refined services.

[0059] In one implementation, reference is made to Figure 2 After step S13, steps S14 to S19 are also included.

[0060] Step S14: Compare the second function information with the first function information to determine the target function item that needs to be updated in the enabled state.

[0061] Step S15: Based on the target function item, the activation status of the corresponding target function item, and the first preset duration, construct a function item change message and send it to the mobile client.

[0062] After the AI ​​gateway determines the second functional information that matches the second resource information, it also compares the second functional information with the first functional information to determine the target functional items that need to be updated in the enabled state. For example, if the first functional information includes: streaming inference output (enabled), media file transfer (enabled), and tool call result (enabled), and the second functional information includes: streaming inference output (disabled, only returns results once), media file transfer (disabled), and tool call result (enabled, plain text summary), then the target functional items that need to be updated in the enabled state include: streaming inference output, media file transfer, and tool call result.

[0063] Next, determine the activation status of the corresponding target function item. The activation status of the target function item mentioned here refers to the activation status of the target function item in the second function information. For example, the activation status of streaming inference output is disabled, and the result is returned only once; the activation status of media file transmission is disabled; the activation status of tool call result is enabled, and it is a plain text summary.

[0064] Based on the target function item, its enabled status, and a first preset duration, a function item change message is constructed and sent to the mobile client. The mobile client controls the channel status of its corresponding function item based on the function item change message. For example, the function item change message might include: streaming inference output is disabled (results returned only once); media file transfer is disabled; and tool call results are enabled (plain text summary). In this case, the mobile client will change the streaming inference output function of the AI ​​session from enabled to disabled (results returned only once); the media file transfer function from enabled to disabled; and the tool call results function from enabled to enabled (plain text summary).

[0065] Correspondingly, the AI ​​conversation interface on the mobile client has changed as follows: Originally, the AI ​​response content was generated and displayed simultaneously, and users could start reading without waiting for the complete response; however, after the streaming inference output is disabled, it is no longer generated and displayed simultaneously, but instead waits for the large language model to generate the complete response before presenting the entire text in the conversation bubble at once.

[0066] The AI ​​replies originally included multimedia content such as images, voice messages, and video clips; however, after media file transfer was disabled, all images, voice messages, and video content in the AI ​​replies were no longer actually transmitted or rendered, and the locations where media content was originally displayed were now only described in text.

[0067] Previously, when AI responded to calls to external tools (such as checking the weather, searching maps, or booking hotels), the returned structured data was presented on the interface in rich media formats such as cards, charts, lists, and maps. However, after the tool call results were changed to enabled and plain text summaries were enabled, the tool call results were no longer presented in the form of rich media cards, but were converted into one or more sentences of natural language text summaries.

[0068] Step S16: Determine whether a function change confirmation message has been received from the mobile client within a first preset time period. If yes, proceed to step S17; if no, proceed to step S19.

[0069] Step S17: Update the first function information to the second function information.

[0070] Step S18: Adjust the message push strategy for AI conversations with mobile clients based on the second function information.

[0071] After the mobile client controls the status of the channel of its corresponding function item based on the function item change message, it will return a function item change confirmation message, which includes the current enabled status of the function item that has changed in the mobile client.

[0072] If the AI ​​gateway receives a function change confirmation message from the mobile client within a first preset time period, it can determine that the status of the current function item on the mobile client has been updated. At this time, step S17 is executed, and the AI ​​gateway updates the first function information to the second function information to ensure that the function information stored in the AI ​​gateway is the latest function information.

[0073] The AI ​​gateway can also adjust the message push strategy for AI conversations with mobile clients based on the second function information. This message push strategy includes message push permissions based on the enabling status of the second function item in the corresponding second function message. Essentially, the message push strategy is a set of routing and transmission rules, with the core logic being: only push data types corresponding to the currently enabled functions on the client, skipping or converting data corresponding to disabled functions.

[0074] For example, if the streaming inference output function is disabled and only returns the result once, the AI ​​gateway's streaming response method will change from word-by-word meta-push to a single push after the server has buffered the entire message. This means that hundreds of push operations are compressed into a single push, and the client does not need to render each word; it receives a complete text, significantly reducing network transmissions and client rendering power consumption.

[0075] If media file transfer is disabled, the AI ​​gateway will skip the media file encoding and push process. Regardless of whether the large language model response originally contained images, audio, or video, the AI ​​gateway will no longer perform compression, transcoding, or fragmented transmission operations, but will only send a lightweight placeholder instruction to the mobile client. The mobile client will then display a gray placeholder area and text description, thus completely avoiding the bandwidth consumption and memory pressure caused by large file transfers.

[0076] If the tool call result function is enabled and only a plain text summary is displayed, the AI ​​gateway will still execute the tool call logic normally, such as querying the weather API or searching for map POIs. However, after obtaining the structured results, it will convert them into a concise natural language description before pushing them to the client. For example, weather JSON data will be converted into text like "Current temperature 25°C, sunny," and the client will only display it as a plain text message, without rendering rich media cards, charts, or interactive buttons. If the tool call result is completely disabled, the AI ​​gateway will not even execute the tool call itself, but will directly return placeholder text.

[0077] In this embodiment, after determining that the status of the current function item of the mobile client has been updated, the AI ​​gateway updates the first function information to the second function information to ensure that the function information stored in the AI ​​gateway is the latest function information; it can also adjust the message push strategy for AI conversation with the mobile client according to the second function information, so as to realize the synchronous update of the message push strategy of the AI ​​gateway and the function status of the mobile client, ensuring that the AI ​​gateway will not push data types that it cannot process under its current resource status to the mobile client, and avoid the AI ​​gateway pushing data that exceeds its processing capacity to the mobile client.

[0078] Step S19: Execute the first preset security policy. The first preset security policy includes: using the message push policy corresponding to the enabled state of the first function item in the first function information, or adopting a preset security push policy.

[0079] If the AI ​​gateway does not receive a confirmation message from the mobile client regarding the function change within a first preset time period, it can be determined that the current function status of the mobile client has not been updated. In this case, to ensure service reliability, a fallback strategy (first preset security strategy) is provided. The first preset security strategy includes at least two options: one is to continue using the message push strategy corresponding to the enabled status of the first function item in the first function information. That is, the AI ​​gateway does not change the currently used message push strategy and continues to push messages according to the function status before the function change. For example, if the function status before the change was "streaming inference output enabled, media file transfer enabled," even if the change message requires both to be disabled but the mobile client does not confirm, the AI ​​gateway will still continue to push messages according to the original strategy (both enabled).

[0080] Another approach is to employ a preset security push strategy. This means that after a timeout, the AI ​​gateway proactively lowers the message push strategy to a preset minimum safety level. This minimum safety level is typically "only retaining the ability to send and receive plain text messages," meaning the gateway only pushes plain text messages to the client, disabling resource-intensive functions such as streaming inference output, media file transfer, and tool call results. While this message push strategy reduces the service experience, it ensures that the mobile client does not receive data beyond its current processing capacity.

[0081] It is feasible. If the AI ​​gateway does not receive a function change confirmation message from the mobile client within the first preset time period, it can resend the function change message. If it still does not receive a function change confirmation message from the mobile client within the first preset time period on the second attempt, the fallback strategy (first preset security strategy) will be executed.

[0082] In this embodiment, if the AI ​​gateway does not receive a function change confirmation message from the mobile client within a first preset time period, it can be determined that the current function status of the mobile client has not been updated. At this time, to ensure service reliability, a fallback strategy (first preset security strategy) is provided. The first preset security strategy includes at least two options: one is to use the message push strategy corresponding to the enabled status of the first function item in the first function information. This ensures that the AI ​​gateway maintains deterministic behavior even when faced with no response or delayed response from the mobile client, avoiding anomalies caused by uncertain gateway status.

[0083] In one implementation, reference is made to Figure 3 The above step S13 includes the following steps S131 and S132: Step S131: Match the second resource information with a preset rule set. The preset rule set includes rule conditions that characterize the correspondence between different combinations of parameter values ​​for the running status parameters and different activation states of the function items.

[0084] Step S132: Determine the enabled status of the function item in the matching rule conditions as the second function information.

[0085] A preset rule set refers to a set of rules and conditions that are predefined and stored on the AI ​​gateway. This rule set is used to establish a mapping relationship between "different combinations of values ​​for running status parameters" and "different enabled states of function items".

[0086] The preset rule set includes multiple rules, each of which includes at least a trigger condition and a corresponding functional action. The trigger condition indicates a preset requirement that one or more running status parameters must meet; the functional action indicates the enabled state that each functional item should be set to when the trigger condition is met.

[0087] This is feasible. Multiple rules in the preset rule set are arranged in descending order of priority. When matching the second resource information with the preset rule set, the multiple rules in the preset rule set are traversed sequentially. For each rule, its trigger condition is checked. Once the trigger condition of a rule is met, the matching process terminates, and the function activation status defined in the function action of that rule is used as the matching result (second function information). If no rule is matched, the default rule is used as a fallback.

[0088] In one example, the preset rule set includes multiple rules, and the trigger condition of each rule indicates only the preset requirement that a running status parameter must meet. The multiple rules are sorted in order of priority.

[0089] Rule 1: When the current battery percentage is below the low battery threshold (e.g., 15%), streaming inference output is disabled (results are returned only once), media file transfer is disabled, and tool call results are enabled (plain text summaries).

[0090] Rule 2: When the CPU load rate is higher than the high load threshold (e.g., 85%), streaming inference output is enabled (low refresh rate throttling), media file transfer is disabled, and tool call results are enabled (plain text summary).

[0091] Rule 3: When the current battery percentage is higher than the high battery threshold (30%), streaming inference output, media file transfer, and tool call results are enabled.

[0092] Rule 4: When the CPU load rate is below the low load threshold (e.g., 60%), streaming inference output, media file transfer, and tool call results are enabled.

[0093] The priority order of the four rules is: Rule 1 > Rule 2 > Rule 3 > Rule 4.

[0094] If the second resource information includes the current battery percentage of 10% and CPU load rate of 25%, rule 1 will be prioritized. The functional actions in rule 1, namely disabling streaming inference output (returning results only once), disabling media file transfer, and enabling tool call results (plain text summary), will be identified as the second functional information that matches the second resource information.

[0095] If the second resource information includes the current battery percentage of 40% and CPU load rate of 87%, rule 2 will be prioritized. The functional actions in rule 2, namely: enabling streaming inference output (low refresh rate throttling), disabling media file transfer, and enabling tool call results (plain text summary), will be identified as the second functional information that matches the second resource information.

[0096] In another example, the preset rule set includes the following multiple rules, each of which is triggered by only two or more preset requirements that must be met by the running status parameters, and there is no priority order requirement for the multiple rules.

[0097] Rule 1: When the current battery percentage is below the low battery threshold (e.g., 15%) and the CPU load is below the low load threshold (e.g., 60%), streaming inference output is disabled (results are returned only once), media file transfer is disabled, and tool call results are enabled (plain text summaries).

[0098] Rule 2: When the current battery percentage is below the low battery threshold (e.g., 15%) and the CPU load is above the high load threshold (e.g., 85%), streaming inference output is disabled (results are returned only once), media file transfer is disabled, and tool call results are enabled (plain text summaries).

[0099] Rule 3: When the current battery percentage is higher than the high battery threshold (30%) and the CPU load is lower than the low load threshold (e.g., 60%), streaming inference output, media file transfer, and tool call results are enabled.

[0100] Rule 4: When the current battery percentage is higher than the high battery threshold (30%) and the CPU load rate is higher than the high load threshold (e.g., 85%), streaming inference output is enabled (low refresh rate throttling), media file transfer is disabled, and tool call results are enabled (plain text summary).

[0101] If the second resource information includes the current battery percentage of 10% and CPU load rate of 25%, and rule 1 is hit, then the functional actions in rule 1: disabling streaming inference output (returning results only once), disabling media file transfer, and enabling tool call results (plain text summary) can be identified as the second functional information that matches the second resource information.

[0102] If the second resource information includes the current battery percentage of 40% and CPU load rate of 87%, and rule 4 is hit, then the functional actions in rule 4: enabling streaming inference output (low refresh rate throttling), disabling media file transfer, and enabling tool call results (plain text digest) can be identified as the second functional information that matches the second resource information.

[0103] This is achievable. In this embodiment, the AI ​​gateway supports online updates of the preset rule set without interrupting existing connections. The update operation is protected by read-write locks, allowing the AI ​​gateway to adjust the preset rules without restarting.

[0104] It should be noted that the setting method of the preset rule set in this embodiment is only for illustrative purposes and can be set according to actual needs. It will not be described in detail in this embodiment.

[0105] In this embodiment, a flexible mapping between resource status and functional status is achieved through a preset rule set.

[0106] In one implementation, each rule condition in the preset rule set is also associated with at least one setting mode identifier, which is used to characterize the setting method of the mobile client and the AI ​​gateway; the method further includes: obtaining and maintaining the setting mode identifier of the mobile client; matching the second resource information with the preset rule set, including: filtering out rule conditions that match the setting mode identifier from the preset rule set; and matching the second resource information with the filtered rule conditions.

[0107] The mode identifier can have at least two values. One value represents "remote deployment," in which the AI ​​gateway runs in the cloud or on an enterprise server, and the mobile client application connects to the AI ​​gateway via a persistent connection through an external network. The other value represents "same-device deployment," in which the AI ​​gateway runs locally on the mobile client as a system service process, and the mobile client application communicates with the AI ​​gateway through a file system path (local socket channel). Data transmission is completed within the operating system kernel, without going through any network protocol stack, and the communication latency is in the microsecond range. For example, the mode identifier can be set to 0 or 1, where 0 represents "remote deployment" and 1 represents "same-device deployment." This is just an example; in actual applications, the mode identifier can be set to a value that distinguishes different deployment scenarios.

[0108] Each rule condition in the preset rule set is associated with a setting mode identifier. The setting mode identifier is an identifier field used to characterize the setting method (i.e., deployment scenario) between the mobile client and the AI ​​gateway. It indicates which deployment scenario the rule is applicable to. It can be understood that one rule can be applicable to multiple deployment scenarios. Therefore, one rule can be associated with two or more setting mode identifiers.

[0109] In one example, the preset rule set can be as follows: Rule 1 - Setting mode identifier "0": Network connection type is no network, streaming inference output is disabled, media file transfer is disabled, and tool call results are disabled.

[0110] Rule 2—Set mode identifiers “0 and 1”: When the current battery percentage is below the low battery threshold (e.g., 15%), streaming inference output is disabled (results are returned only once), media file transfer is disabled, and tool call results are enabled (plain text digest).

[0111] Rule 3—Set mode identifier “0”: Network connection type is data network, streaming inference output is disabled (results are returned only once), media file transfer is disabled, and tool call results are enabled (plain text digest).

[0112] Rule 4—Set mode identifiers “0 and 1”: CPU load rate is higher than the high load threshold (e.g., 85%), streaming inference output is enabled (low refresh rate throttling), media file transfer is disabled, and tool call results are enabled (plain text digest).

[0113] Rule 5—Set mode identifiers “0 and 1”: When the current battery percentage is higher than the high battery threshold (30%), streaming inference output is enabled, media file transfer is enabled, and tool call results are enabled.

[0114] Rule 6—Set mode identifiers “0 and 1”: When CPU load is below the low load threshold (e.g., 60%), streaming inference output is enabled, media file transfer is enabled, and tool call results are enabled.

[0115] Rule 7 - Set mode identifier "0": Network connection type is Wifi, streaming inference output is enabled, media file transfer is enabled, and tool call results are enabled.

[0116] The priority order of the seven rules is: Rule 1 > Rule 2 > Rule 3 > Rule 4 > Rule 5 > Rule 6 > Rule 7.

[0117] The method in this embodiment also includes that when the mobile client establishes a connection with the AI ​​gateway, the mobile client reports the setting pattern identifier to the AI ​​gateway.

[0118] For example, if the deployment method reported by the mobile client is 0, which is "remote deployment", then when the AI ​​gateway matches the second resource information with the preset rule set, it first filters out the rule conditions that match the set mode identifier "0" from the preset rule set. The matching rule conditions are all rules (rules 1 to rules 7). Then, it matches the second resource information with the filtered rule conditions.

[0119] For example, if the deployment mode reported by the mobile client is 1, which is "deployment on the same device", then when the AI ​​gateway matches the second resource information with the preset rule set, it first filters out the rule conditions that match the set mode identifier "1" from the preset rule set. The matching rule conditions include some rules (rule 1, rules 4-6). Then, it matches the second resource information with the filtered rule conditions.

[0120] In this embodiment, a mode identifier is associated with each rule in a preset rule set, and the rules in the preset rule set are filtered according to the mode identifier set by the mobile client. This allows the same rule set to accurately adapt to both remote deployment and same-device deployment scenarios. Furthermore, by filtering the rules in the preset rule set, the number of rules for matching the second resource information can be reduced, thereby improving matching efficiency.

[0121] This application also provides an AI conversation function adaptation method, applied to a mobile client, as described above. Figure 4 In this embodiment, the AI ​​conversation function adaptation method includes steps S20 to S24: Step S20: Report the first resource information and the first function information to the AI ​​gateway accessed by the mobile client.

[0122] The mobile client reports first resource information to the connected AI gateway. This first resource information characterizes the mobile client's operating status when it connects to the AI ​​gateway. The first resource information includes various operating status parameters of the mobile client, and the corresponding first parameter values ​​for each operating status parameter. These first parameter values ​​are the latest parameter values ​​when the mobile client connects to the AI ​​gateway. The operating status parameters include one or more of the following: current battery percentage, network connection type (e.g., WiFi, mobile data network), CPU load rate, and available memory percentage.

[0123] The mobile client also reports its supported function list to the connected AI gateway. The AI ​​gateway matches the first resource information with a preset rule set to obtain matching rule conditions. The preset rule set includes rule conditions that characterize the correspondence between different combinations of parameter values ​​for running status parameters and different activation states of function items. Then, based on the mobile client's supported function list, the function items in the matching rule conditions are filtered out, removing those not supported by the mobile client. The activation state of the supported function items in the filtered rule conditions is determined as the first function information. The first function information includes the first function item used by the mobile client in the AI ​​session with the AI ​​gateway, and the corresponding activation state of the first function item; the activation state of the first function item matches the first resource information.

[0124] The AI ​​gateway sends the first functional information to the mobile client, which then controls the channel status of the corresponding functional item based on this information. The AI ​​gateway maintains first resource information and first functional information for each connected mobile client in its local memory.

[0125] Step S21: Collect and monitor whether the difference between the current parameter value and the first parameter value of the operating status parameter meets the preset requirements. If the determination is yes, proceed to step S22; if the determination is no, return to step S21.

[0126] Step S22: Determine the parameter whose current parameter value is different from the first parameter value in the running status parameters and whose difference meets the preset requirements as the target running status parameter.

[0127] As the mobile client's resource status changes continuously with its use, the mobile client continuously collects running status parameters in the background at the default sampling period, and compares the current parameter value after each collection with the first parameter value.

[0128] If the operating status parameters are numerical, such as current battery percentage, CPU load rate, or memory availability, in one example, the preset requirement is that the values ​​of the two parameters must be different. That is, if the current value of any operating status parameter differs from the first parameter, then that operating status parameter is determined as the target operating status parameter. In this way, even minor changes in resource status will be promptly reported by the mobile client to the AI ​​gateway. In another example, the preset requirement is that the difference between the values ​​of the two parameters must be greater than a preset threshold, which is not zero. That is, if the difference between the current value of any operating status parameter and the first parameter meets the preset threshold, then that operating status parameter is determined as the target operating status parameter. By setting preset thresholds to filter out minor fluctuations, the mobile client will only report to the AI ​​gateway when there are substantial, business-significant changes in resource status, significantly reducing invalid reports and lowering communication overhead and gateway computational load.

[0129] If the parameter value of the running status parameter is a character type, such as network connection type (e.g., WiFi, mobile data network), then the above-mentioned preset requirement is that the parameter values ​​of the two parameters are different. That is, if the current parameter value of any running status parameter is different from the value of the first parameter, then the running status parameter is determined as the target running status parameter.

[0130] The target operating status parameter is one or more of the operating status parameters included in the first resource information.

[0131] Step S23: Generate a resource change message based on the target running status parameters and the value of the second parameter corresponding to the target running status parameters.

[0132] Step S24: Send the resource change message to the AI ​​gateway.

[0133] The mobile client generates a resource change message based on the target running status parameter and the value of the corresponding second parameter of the target running status parameter. The second parameter is the current value of the target running status parameter.

[0134] The mobile client sends the generated resource change message to the AI ​​gateway. Based on the resource change message, the AI ​​gateway updates the first parameter value of the target running status parameter in the first resource information to the second parameter value, obtaining the second resource information. Based on the second resource information, it determines the second functional information, which includes: a second functional item and its corresponding activation status. The activation status of the second functional item matches the second resource information. Specifically, the AI ​​gateway matches the second resource information with a preset rule set, and determines the activation status of the functional item in the matching rule conditions as the second functional information.

[0135] It is worth noting that if the setting mode of the mobile client and the AI ​​gateway is set to 0 "remote deployment", and the network connection type is "no network", then when the mobile client communicates with the AI ​​gateway, the mobile client will route the session request to the local session model, and the local session model will continue to conduct the AI ​​session with the mobile client to avoid interruption of the user experience.

[0136] In this embodiment, the mobile client continuously monitors changes in its own resource status and actively reports resource change messages when resource status changes. It reports only the parameters whose current parameter value meets the preset requirements compared to the first parameter value in the running status parameters, as well as the corresponding current parameter value, in a differential manner, instead of reporting all running status parameters. This reduces communication overhead and makes continuous monitoring feasible on the mobile client.

[0137] In one implementation, such as Figure 5 As shown, steps S24 is followed by steps S25 to S27.

[0138] Step S25: Receive a function change message from the AI ​​gateway.

[0139] After determining the second functional information that matches the second resource information, the AI ​​gateway compares the second functional information with the first functional information to determine the target functional item whose activation status needs to be updated. Then, it determines the activation status of the corresponding target functional item, which is the activation status of the target functional item in the second functional information. Based on the target functional item and its activation status, a functional item change message is constructed and sent to the mobile client. In this embodiment, the functional item change message includes: the target functional item and the corresponding activation status of the target functional item. The target functional item is the functional item whose activation status needs to be updated after comparing the second and first functional information.

[0140] Step S26: In response to the function item change message, control operation is performed on the function channel corresponding to the target function item based on the enabled status of the target function item.

[0141] The mobile client controls the channel status of its corresponding function based on function change messages. For example, when a user is using mobile data while out and about, or when the mobile device has low battery, in response to a function change message, the mobile client automatically downgrades the AI ​​conversation function to lightweight mode (pure text conversation) to ensure the availability of core conversations while saving power and data. This ensures that the mobile client's resource status and the function's activation status automatically adapt to each other without requiring manual settings from the user.

[0142] Step S27: Based on the activation status of the actual effective function items in the mobile client, generate a function item change confirmation message and send it to the AI ​​gateway.

[0143] After the mobile client controls the channel status of its corresponding function item based on the function item change message, it will generate a function item change confirmation message based on the actual enabled status of the function item in the mobile client and return the function item change confirmation message to the AI ​​gateway. The function item change confirmation message includes the current enabled status of the function item that has changed in the mobile client.

[0144] In this embodiment, the mobile client controls the channel status of its corresponding function based on the function change message sent by the AI ​​gateway. This allows the mobile client to adjust the status of the function used in its AI session with the AI ​​gateway in a timely manner to adapt to the current resource status, such as battery level, network speed, CPU load, and memory. This effectively avoids excessive power consumption, interface lag, or even application crashes caused by receiving and processing data beyond its processing capacity. Simultaneously, users can still maintain smooth use of basic AI dialogue functions and obtain a stable and reliable service experience in resource-constrained scenarios.

[0145] In one implementation, the function item change message also includes a first preset duration; the method further includes: after receiving the function item change message from the AI ​​gateway, if no function item change confirmation message is sent within the first preset duration, executing a second preset security policy, the second preset security policy including: continuing the previous control operation on the function channel corresponding to the function item, or adopting a preset security control operation.

[0146] The function change message includes not only the target function and its enabled status, but also a first preset duration. After receiving the function change message from the AI ​​gateway, the mobile client must send a function change confirmation message to the AI ​​gateway within the first preset duration. If the AI ​​gateway receives the function change confirmation message from the mobile client within the first preset duration, it can determine that the current function status of the mobile client has been updated. At this time, the AI ​​gateway updates the first function information to the second function information, ensuring that the function information stored in the AI ​​gateway is the latest. Furthermore, the AI ​​gateway can adjust the message push strategy for AI conversations with the mobile client based on the second function information. The message push strategy includes message push permissions corresponding to the enabled status of the second function in the second function message. This ensures the synchronization of the AI ​​gateway's message push strategy with the mobile client's function status, preventing the AI ​​gateway from pushing data types that it cannot process under its current resource state to the mobile client, and avoiding pushing data beyond its processing capacity.

[0147] If the mobile client fails to send a function change confirmation message to the AI ​​gateway within the first preset time period, the mobile client will default to executing the second preset security policy. The second preset security policy includes at least two options: One is to continue using the previous control operations on the function channel corresponding to the function item. That is, the mobile client does not change the current function channel control state and continues to operate according to the previous function state, avoiding unexpected function interruptions due to timeout. The other is to adopt preset security control operations. For example, the mobile client sets all function channels to a disabled state, retaining only the ability to send and receive plain text messages, ensuring that the client will not further deteriorate by continuing to handle high-load functions when processing is slow due to resource constraints.

[0148] Accordingly, to ensure service reliability, if the AI ​​gateway does not receive a confirmation message from the mobile client regarding the change of function items within a first preset time period, it will determine that the status of the current function item on the mobile client has not been updated. At this time, the AI ​​gateway will execute a fallback strategy (the first preset security strategy).

[0149] It is feasible. If the AI ​​gateway does not receive a function change confirmation message from the mobile client within the first preset time period, it can resend the function change message. If it still does not receive a function change confirmation message from the mobile client within the first preset time period on the second attempt, the fallback strategy (first preset security strategy) will be executed.

[0150] In this embodiment of the application, by providing a security handling strategy for timeout situations on the mobile client side, it is ensured that the client can still maintain deterministic behavior when faced with delays or anomalies in function switching execution, thus avoiding anomalies caused by the uncertainty of the mobile client's state.

[0151] In one implementation, the method further includes: reporting the setting mode identifier of the mobile client to the AI ​​gateway, wherein the setting mode identifier is used to characterize the setting mode of the mobile client and the AI ​​gateway.

[0152] The mode identifier should have at least two possible values. One value represents "remote deployment," in which the AI ​​gateway runs in the cloud or on an enterprise server, and the mobile client accesses it via an external network. The other value represents "same-device deployment," in which the AI ​​gateway runs locally on the mobile client as a system service process, and the mobile client's application communicates with the AI ​​gateway through a local socket channel. For example, the mode identifier can be set to 0 or 1, where 0 represents "remote deployment" and 1 represents "same-device deployment." This is just an example; in actual applications, the mode identifier can be set to any value needed to distinguish between different deployment scenarios.

[0153] Each rule condition in the preset rule set is associated with a setting mode identifier. The setting mode identifier is an identifier field used to characterize the setting method (i.e., deployment scenario) between the mobile client and the AI ​​gateway. It indicates which deployment scenario the rule is applicable to. It can be understood that one rule can be applicable to multiple deployment scenarios. Therefore, one rule can be associated with two or more setting mode identifiers.

[0154] The AI ​​gateway is also used to, when matching first resource information with a preset rule set, or matching second resource information with a preset rule set, first filter out rule conditions that match the set mode identifier from the preset rule set, and then match the first or second resource information with the filtered rule conditions. This allows the same rule set to accurately adapt to both remote deployment and same-device deployment scenarios. Furthermore, by filtering rules in the preset rule set, the number of rules required to match the second resource information can be reduced, thereby improving matching efficiency.

[0155] like Figure 6 As shown, the AI ​​gateway 300 includes: a gateway transmission adaptation layer 310, a dynamic negotiation engine 320, a client state registry 330, a policy rule manager 340, a session router 350, and a message platform adaptation layer 360. Figure 7 As shown, the mobile client 400 includes: a client transmission adaptation layer 410, a resource monitoring module 420, a capability collection manager 430, a differential calculation and encoding module 440, and a function execution module 450.

[0156] The gateway transmission adaptation layer 310 corresponds to the client transmission adaptation layer 410, uniformly managing long connections or local communication connections, and providing a unified interface for sending messages according to client identifiers to the upper-layer dynamic negotiation engine 320.

[0157] The dynamic negotiation engine 320 receives and parses resource change messages, reads the corresponding mobile client's setting mode identifier from the client state registry 330, queries the policy rule manager 340 for applicable rules using the setting mode identifier as a filter condition, calculates the target function based on the matching rules, constructs a capability change push message based on the target function and its corresponding enabled status, and starts a change effective timeout countdown. After receiving the capability change confirmation message, it updates the client state registry 330. If the timeout occurs, a fallback policy is executed.

[0158] The client state registry 330 uses the mobile client's unique identifier as the key to store the current function's enabled status, setting mode identifier, and the latest resource status information. All read and write operations are guaranteed to be atomic, and multiple dynamic negotiation engines 320 can concurrently access the same client state registry 330.

[0159] The Policy Rule Manager 340 stores and manages preset rule sets. Each rule contains three fields: Applicable Scenario (applicable to all scenarios or only to remote deployments), Trigger Condition (specifying resource metrics, comparison operators, and thresholds), and Function Action (specifying the target function identifier and its enabled status). Multiple rules can be prioritized, with subsequent rule matching terminating after the first rule is matched. The preset rule set can be updated online without interrupting existing connections; update operations are protected by read-write locks.

[0160] Session Router 350 maintains a mapping from the current functionality of each mobile client to message routing policies. Upon receiving a functionality change message, it updates the routing policy for the corresponding mobile client. For example, when media file transmission is disabled, it skips the media encoding and push process; when streaming inference output is disabled, it pushes the large language model response all at once after buffering it completely on the server, instead of pushing it word by word; when tool call results are disabled, it replaces the structured data push with plain text summaries.

[0161] The client-side transport adaptation layer 410 provides a unified message sending and receiving interface for the upper-layer negotiation logic. In remote deployment scenarios, it is implemented internally based on long connections; in intra-device deployment scenarios, it is implemented internally based on local channels. Both implementations are completely transparent to upper-layer modules, and the upper-layer code does not need to be aware of the underlying transport type. The mode identifier is determined by this module during connection establishment and reported to the gateway.

[0162] The resource monitoring module 420 continuously collects multiple operating status parameters. Battery power is measured as a percentage and charging status via the system power management interface; network connection type is obtained through the system network connection management interface, showing the current connection type enumeration value; CPU load is calculated by reading the system process status information file to determine the average utilization of each processor core; and memory availability is obtained through the system activity management interface, showing the ratio of available memory to total memory. The sampling period and threshold can be dynamically adjusted through configuration.

[0163] The Capability Collection Manager 430 maintains the currently active capability graph for the mobile client, using capability identifiers as keys and capability start / stop status as values. Initial values ​​are written based on the initial negotiation result, and subsequent values ​​are atomically updated with each capability change push message. Update operations are locked to ensure thread safety. This module records the authoritative capability status on the client side and keeps it synchronized with the client status registry 330 on the gateway side.

[0164] The differential calculation and encoding module 440 caches the previously reported resource information and compares it with the current resource information after each sampling. Only when the change of any indicator meets the preset requirements involved in the preset rule set, the changed target running status parameter, the current parameter value, and the description of the reason for the change are extracted, and a resource change message is constructed and sent to the AI ​​gateway.

[0165] The function degradation execution module receives function status change notifications from the capability collection manager 430 and executes the corresponding function channel control operations. For example, when streaming inference output is disabled, a pause signal is sent to the message parsing module, and the rendering of received data frames stops; when media file transmission is disabled, the media download queue is cleared, and subsequent media messages are replaced with placeholder text; when streaming inference output is throttled, a rendering frame rate cap is set, limiting the interface refresh rate. After completing the operation within the change's effective timeout period, a capability change confirmation message is triggered.

[0166] The following section explains the interaction process between the AI ​​gateway and the mobile client, using the specific modules of the AI ​​gateway and mobile client described above. For example... Figure 8 As shown, it includes: Step S501: The mobile client establishes a persistent channel with the AI ​​gateway.

[0167] The mobile client's client transmission adaptation layer 410 selects the channel type according to the current deployment scenario. In the remote deployment scenario, it declares the capability negotiation sub-protocol identifier in the handshake request and establishes a long connection with the AI ​​gateway. For example, WebSocket declares the capability negotiation sub-protocol identifier. In the same device deployment scenario, it establishes a local persistent channel through the local communication mechanism. For example, it connects to the gateway socket file path.

[0168] Step S502: The mobile client sends registration information to the AI ​​gateway.

[0169] Once the channel is established, the mobile client immediately sends a registration message to the AI ​​gateway. The registration message contains a setting mode identifier, which represents the configuration method (i.e., deployment mode) between the mobile client and the AI ​​gateway. For example, the setting mode identifier can be 0 or 1, where 0 indicates remote deployment and 1 indicates deployment on the same device; or, the setting mode identifier can be "yes" or "no," where "no" indicates remote deployment and "yes" indicates deployment on the same device.

[0170] After receiving the registration message, the gateway transmission adaptation layer 310 of the AI ​​gateway will send it to the dynamic negotiation engine 320. The dynamic negotiation engine 320 maintains a client state registry 330 and creates an entry for the mobile client in the client state registry 330 to record the setting mode identifier.

[0171] In step S503, the AI ​​gateway sends a capability initialization request message to the mobile client. The capability initialization request message includes a unique request identifier and a protocol version number.

[0172] Step S504: The mobile client sends a capability initialization response message to the AI ​​gateway.

[0173] After receiving the capability initialization request message, the resource monitoring module 420 of the mobile client performs a full resource collection to obtain the first resource information. This first resource information includes various operating status parameters and their corresponding current values. The operating status parameters include at least one or more of the following: current battery percentage, network connection type, CPU load rate, and available memory percentage. Based on the first resource information and the list of functions supported by the mobile client, the mobile client generates a capability initialization response message and sends it to the AI ​​gateway. For example, the first resource information in the capability initialization response message might include: current battery percentage 85%, network connection type WiFi, CPU load rate 32%, and available memory percentage 61%. The list of functions supported by the mobile client might include: streaming inference output, media file transfer, and tool call results.

[0174] In step S505, the AI ​​gateway calculates the first functional information based on the capability initialization response message.

[0175] The AI ​​gateway's policy rule manager 340 stores a preset rule set, which includes multiple rules. Each rule corresponds to at least one setting mode identifier, indicating that the rule conditions are applicable to at least one deployment scenario.

[0176] After the AI ​​gateway's dynamic negotiation engine 320 parses the capability initialization response message, it first filters out rule conditions matching the setting mode identifier from the preset rule set based on the registration message reported by the mobile client. Then, it matches the first resource information in the capability initialization response message with the filtered rule conditions to obtain matching rule conditions. Next, based on the list of functions supported by the mobile client in the capability initialization response message, it filters out function items in the matching rule conditions, removing those not supported by the mobile client. The enabled status of the supported function items in the filtered rule conditions is determined as the first function information. The first function information includes the first function item used by the mobile client in the AI ​​session with the AI ​​gateway and the corresponding enabled status; the enabled status of the first function item matches the first resource information.

[0177] Continuing with the example above, if the first resource information in the capability initialization response message includes: current battery percentage 85%, network connection type WiFi, CPU load rate 32%, and memory availability 61%, it can be seen that in the initial connection state, the mobile client has sufficient battery power, good network connection, low CPU load rate, and sufficient memory availability. Usually, the streaming inference output, media file transfer, and tool call results in the first matched function information are all enabled normally.

[0178] In step S506, the AI ​​gateway adjusts the message push strategy for AI conversations with the mobile client based on the first functional information.

[0179] After obtaining the first function information, the AI ​​gateway also writes the first resource information and the first function information into the client status registry 330, and adjusts the message push strategy for AI conversations with the mobile client based on the first function information. The message push strategy includes message push permissions for the enabled status of the function items in the corresponding first function message. The message push strategy is essentially a set of routing and transmission rules, with the core logic being: only push data types corresponding to the currently enabled functions of the client, skipping or converting data corresponding to disabled functions.

[0180] For example, if media file transfer is disabled, the AI ​​gateway will skip the media file encoding and push process. Regardless of whether the large language model response originally contained images, audio, or video, the AI ​​gateway will no longer perform compression, transcoding, or fragmented transmission operations, but will only send a lightweight placeholder instruction to the mobile client. The mobile client will then display a grayed-out placeholder area and text description, thus completely avoiding the bandwidth consumption and memory pressure caused by large file transfers. The AI ​​gateway's message push strategy is synchronized with the mobile client's functional status to ensure that the AI ​​gateway does not push data types that it cannot process under its current resource state to the mobile client, and to prevent the AI ​​gateway from pushing data beyond its processing capacity.

[0181] In step S507, the AI ​​gateway sends the first function information to the mobile client.

[0182] After calculating the first functional information based on the capability initialization response message, the AI ​​gateway sends the first functional information to the mobile client. The mobile client then controls the status of the corresponding functional item's channel based on the first functional information.

[0183] Step S508: The mobile client monitors each running status parameter. If the difference between the current parameter value and the first parameter value meets the preset requirements, the target running status parameter is determined.

[0184] As the mobile client's resource status changes continuously with usage, the mobile client's resource monitoring module 420 continuously collects runtime status parameters in the background at a default sampling period. After each collection, the mobile client's differential calculation and encoding module 440 compares the current parameter value with the first parameter value to determine which parameters are target runtime status parameters. Target runtime status parameters are those whose difference between the current parameter value and the first parameter value meets preset requirements.

[0185] Step S509: The mobile client generates a resource change message based on the target running status parameters and the current parameter values ​​of the corresponding target running status parameters.

[0186] After the differential calculation and encoding module 440 of the mobile client determines the target running status parameters, it extracts the target running status parameters and the current parameter values ​​of the corresponding target running status parameters to form a resource change message.

[0187] In step S510, the mobile client sends a resource change message to the AI ​​gateway. The mobile client's transport adaptation layer also sends the resource change message to the AI ​​gateway.

[0188] In step S511, the AI ​​gateway updates the value of the first parameter of the target running status parameter in the first resource information to the value of the second parameter based on the resource change message, thereby obtaining the second resource information.

[0189] After receiving a resource change message, the AI ​​gateway determines the target operating status parameter and the corresponding second parameter value, and changes the first parameter value in the stored first resource information corresponding to the target operating status parameter to the second parameter value, thereby obtaining the second resource information.

[0190] In step S512, the AI ​​gateway determines the second functional information based on the second resource information.

[0191] The AI ​​gateway first reads the mobile client's setting mode identifier from the client status registry 330. Then, based on this identifier, it filters out rule conditions matching the selected setting mode identifier from a preset rule set. Next, it matches the second resource information with these filtered rule conditions to obtain matching rule conditions. Then, based on the list of functions supported by the mobile client, it filters the function items in the matching rule conditions, removing those not supported by the mobile client. The enabled status of the supported function items in the filtered rule conditions is determined as the second function information. The second function information includes the second function item and its corresponding enabled status, which is compatible with the second resource information.

[0192] In step S513, the AI ​​gateway generates a function item change message based on the first function signal and the second function signal, and sends it to the mobile client.

[0193] The AI ​​gateway's dynamic negotiation engine 320 compares the second functional information with the first functional information to determine the target functional item whose activation status needs to be updated. The activation status of the target functional item is defined in the second functional information. Then, based on the target functional item, its activation status, and a first preset duration, the AI ​​gateway's dynamic negotiation engine 320 constructs a functional item change message. The first preset duration is the change-effective timeout. In scenarios deployed on the same device, the change-effective timeout is automatically shortened to one-quarter of the default value for remote scenarios (e.g., 200 milliseconds) (e.g., 50 milliseconds) to accommodate the microsecond-level communication latency of local communication. The functional item change message is also sent to the mobile client.

[0194] In step S514, the mobile client responds to the function item change message and performs control operations on the function channel corresponding to the target function item based on the activation status of the target function item.

[0195] Within a first preset time period, the mobile client's function degradation execution module controls the corresponding function channels based on the activation status of the target function item. This includes actions such as pausing or resuming the reception and rendering of streaming inference output, and clearing or resuming the media file download queue. After execution, the mobile client's capability collection manager 430 updates the local function graph based on the latest activation status of each function item.

[0196] In step S515, the mobile client generates a function change confirmation message based on the actual enabled status of the function and sends it to the AI ​​gateway.

[0197] The mobile client's transport adaptation layer sends a function change confirmation message to the AI ​​gateway. This message includes the current enabled status of the changed function in the mobile client, as well as the operation completion timestamp.

[0198] In step S516, if the AI ​​gateway receives a function change confirmation message from the mobile client within a first preset time period, it updates the first function information to the second function information and adjusts the message push strategy for AI conversation with the mobile client accordingly.

[0199] After receiving a function change confirmation message from the mobile client within a first preset time period, the AI ​​gateway updates the client status registry 330, changing the first function information in the registry to the second function information. The AI ​​gateway also notifies the session router 350 to synchronously adjust the message push strategy for the AI ​​session with the mobile client based on the second function information. This message push strategy includes message push permissions for the enabled status of the second function item in the corresponding second function message. Essentially, the message push strategy is a set of routing and transmission rules, with the core logic being: only push data types corresponding to the currently enabled functions of the mobile client, skipping or converting data corresponding to disabled functions.

[0200] In another scenario, if the AI ​​gateway does not receive a confirmation message from the mobile client regarding the function change within a first preset time period, a fallback strategy (the first preset security strategy) will be adopted. The first preset security strategy includes at least two options: one is to continue using the message push strategy corresponding to the enabled state of the first function item in the first function information. That is, the AI ​​gateway will not change the currently used message push strategy and will continue to push messages according to the function state before the function change.

[0201] Another approach is to employ a preset security push strategy. This means that after a timeout, the AI ​​gateway proactively lowers the message push strategy to a preset minimum safety level. This minimum safety level is typically "only retaining the ability to send and receive plain text messages," meaning the gateway only pushes plain text messages to the client, disabling resource-intensive functions such as streaming inference output, media file transfer, and tool call results. While this message push strategy reduces the service experience, it ensures that the mobile client does not receive data beyond its current processing capacity.

[0202] The following example illustrates the adaptation relationship between resource status and functional information in the embodiments of this application.

[0203] If the current battery percentage in the mobile client's resource status is greater than the battery recovery threshold of 30%, the CPU load rate is lower than the low load threshold of 60%, and the network connection type is WiFi, the matching functional information includes: streaming inference output enabled, media file transfer enabled, and tool call results enabled. When the mobile client uses this functional information, it is in full-featured mode.

[0204] If the mobile client's current battery percentage is less than the low battery threshold of 15%, the CPU load rate is less than the high load threshold of 85%, and the network connection type is WiFi, the matching functional information includes: streaming inference output disabled, only returning one-time query results, media file transfer disabled, and tool call results enabled, but only outputting plain text summaries. When the mobile client uses this functional information, it is in power saving mode. When the mobile client enters power saving mode, the interface display effect is as follows: the streaming word-by-word output effect disappears, AI replies are changed to be fully generated and presented at once; image, voice, and video messages are displayed as gray placeholder areas with text explanations of the current situation.

[0205] If the mobile client's current battery percentage is not less than the low battery threshold of 15%, the CPU load rate is higher than the high load threshold of 85%, and the network connection type is WiFi, and the matching functional information includes: streaming inference output enabled but at a low refresh rate, media file transfer disabled, and tool call results enabled but only outputting plain text summaries, the mobile client is in high load throttling mode when using this functional information. When the mobile client enters high load throttling mode, the interface display effect is as follows: the streaming output refresh rate is reduced, and the text appearance rhythm is slower, but not interrupted.

[0206] The first three adaptation relationships apply to scenarios where the AI ​​gateway and mobile client are deployed remotely or on the same device.

[0207] If the network connection type in the mobile client's resource status is "Mobile Data," then regardless of other runtime parameters, the matching functional information includes: Streaming inference output enabled, media file transfer disabled, and tool call results enabled, but only plain text summaries are output. When the mobile client uses this functional information, it is in media degradation mode. This adaptation relationship only applies to scenarios where the AI ​​gateway and mobile client are remotely deployed, and not to device deployment scenarios.

[0208] In scenarios where AI gateways and mobile clients are remotely deployed, if the AI ​​gateway and mobile client are connected via network, the mobile client will automatically adapt to default function information. Default function information includes: disabling streaming inference output, disabling media file transfer, disabling tool call results, and local message queue buffering. When the mobile client uses this default function information, it is in offline buffering mode.

[0209] It is possible to provide an optional "Current AI Function Status" indicator on the mobile client's APP settings page to display the current working mode (full-function mode, media degradation mode, power saving mode, high load throttling mode, or offline buffering mode) and the triggering reason (e.g., "Power saving mode battery 12%)", to help users understand the reasons behind the change in working mode.

[0210] This application also provides an AI gateway, such as Figure 9 As shown, the AI ​​gateway 600 includes a processor 610, a memory 620, and a computer program stored in the memory 620 and executable on the processor 610. The computer program is configured to implement the AI ​​session function adaptation method applied to the AI ​​gateway in the above embodiments. The AI ​​gateway 600 also includes a communication interface 630 and a bus 640. The memory 620 and the communication interface 630 can be connected to the processor 610 via the bus 640, and the AI ​​gateway 600 communicates with external devices through the communication interface 630.

[0211] This application also provides a mobile client, such as Figure 10 As shown, the mobile client 700 includes a processor 710, a memory 720, and a computer program stored in the memory 720 and executable on the processor 710. The computer program is configured to implement the AI ​​session function adaptation method applied to the mobile client in the above embodiments. The mobile client 700 also includes a communication interface 730 and a bus 740. The memory 720 and the communication interface 730 can be connected to the processor 710 via the bus 740, and the mobile client 700 communicates with external devices through the communication interface 730.

[0212] This application also provides an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. The computer program is configured to implement the AI ​​session function adaptation method applied to an AI gateway in the above embodiments, and / or to implement the AI ​​session function adaptation method applied to a mobile client in the above embodiments.

[0213] When the electronic device implements the AI ​​conversation function adaptation method applied to the mobile client in the above embodiments, the electronic device can, as follows: Figure 11 As shown, this can include, but is not limited to, mobile terminals such as mobile phones, laptops, PADs (Portable Application Description: tablet computers), PMPs (Portable Media Players: portable multimedia players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 11 The electronic device 800 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0214] like Figure 11As shown, the electronic device 800 may include a processing unit 801 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 803 into a random access memory (RAM) 804. The RAM 804 also stores various programs and data required for the operation of the electronic device 800. The processing unit 801, ROM 802, and RAM 804 are interconnected via a bus 805. An input / output (I / O) interface 806 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 806: input devices 807 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 808 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 803 including, for example, magnetic tapes, hard disks, etc.; and communication devices 809. Communication device 809 allows electronic device 800 to communicate wirelessly or wiredly with other devices to exchange data. Although electronic device 800 with various systems is shown in the figures, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.

[0215] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 803, or installed from ROM 802. When the computer program is executed by processing device 801, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0216] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0217] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0218] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the AI ​​session function adaptation method applied to an AI gateway in the above embodiments, and / or the AI ​​session function adaptation method applied to a mobile client in the above embodiments.

[0219] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0220] The aforementioned computer-readable storage medium may be included in an electronic device or may exist independently without being assembled into an electronic device.

[0221] The aforementioned computer-readable storage medium carries one or more programs. When the aforementioned one or more programs are executed by an electronic device, the electronic device implements the AI ​​session function adaptation method applied to the AI ​​gateway in the above embodiments, and / or implements the AI ​​session function adaptation method applied to the mobile client in the above embodiments.

[0222] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0223] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0224] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0225] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the AI ​​session function adaptation method applied to an AI gateway in the above embodiments, and / or implements the AI ​​session function adaptation method applied to a mobile client in the above embodiments.

[0226] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A method for adapting AI conversational functions, characterized in that, Applied to an AI gateway, the method includes: Acquire and maintain first resource information and first function information of the mobile client accessing the AI ​​gateway, wherein the first resource information includes the running status parameters of the mobile client and the first parameter value corresponding to the running status parameters; the first function information includes the first function item used by the mobile client in the AI ​​session with the AI ​​gateway and the activation status corresponding to the first function item; the activation status corresponding to the first function item is adapted to the first resource information; The system receives a resource change message reported by the mobile client. The resource change message includes a target running status parameter and a second parameter value corresponding to the target running status parameter. The target running status parameter is a parameter in which the difference between the current parameter value and the first parameter value in the running status parameter meets a preset requirement. According to the resource change message, update the first parameter value of the target running status parameter in the first resource information to the second parameter value to obtain the second resource information; Based on the second resource information, second functional information is determined, which includes: a second functional item and an activation status corresponding to the second functional item. The activation status corresponding to the second functional item is adapted to the second resource information.

2. The method according to claim 1, characterized in that, After determining the second functional information based on the second resource information, the method further includes: The second function information is compared with the first function information to determine the target function item whose activation status needs to be updated; Based on the target function item, the activation status of the corresponding target function item, and a first preset duration, a function item change message is constructed and sent to the mobile client; If a function change confirmation message is received from the mobile client within the first preset time period, the first function information will be updated to the second function information; Based on the second function information, adjust the message push strategy for AI conversations with the mobile client. The message push strategy includes message push permissions corresponding to the enabled status of the second function item in the second function message.

3. The method according to claim 2, characterized in that, The method further includes: If no function change confirmation message is received from the mobile client within the first preset time period, a first preset security policy is executed. The first preset security policy includes: using the message push policy corresponding to the enabled status of the first function item in the first function information, or using a preset security push policy.

4. The method according to any one of claims 1-3, characterized in that, The determination of the second functional information based on the second resource information includes: The second resource information is matched with a preset rule set, which includes: rule conditions for characterizing the correspondence between different combinations of parameter values ​​of the running status parameter and different activation states of the function item; The enabled status of the function item in the matching rule conditions is determined as the second function information.

5. The method according to claim 4, characterized in that, Each rule condition in the preset rule set is also associated with at least one setting mode identifier, which is used to characterize the setting method of the mobile client and the AI ​​gateway. The method further includes: Obtain and maintain the settings mode identifier of the mobile client; The step of matching the second resource information with the preset rule set includes: Select rule conditions that match the setting mode identifier from the preset rule set; The second resource information is matched with the filtered rule conditions.

6. A method for adapting AI conversational functionality, characterized in that, Applied to mobile clients, the method includes: The mobile client reports first resource information and first function information to the AI ​​gateway it accesses. The first resource information includes the mobile client's running status parameters and the first parameter value corresponding to the running status parameters. The first function information includes the first function item used by the mobile client in the AI ​​session with the AI ​​gateway and the activation status corresponding to the first function item. The activation status corresponding to the first function item is adapted to the first resource information. Collect and monitor whether the difference between the current parameter value and the first parameter value of the operating status parameter meets the preset requirements; The parameter whose difference between the current parameter value and the first parameter value in the running status parameters meets the preset requirements is determined as the target running status parameter, and a resource change message is generated based on the target running status parameter and the second parameter value corresponding to the target running status parameter; The resource change message is sent to the AI ​​gateway. The AI ​​gateway updates the first parameter value of the target running status parameter in the first resource information to the second parameter value according to the resource change message to obtain the second resource information. Based on the second resource information, the second function information is determined. The second function information includes: a second function item and the activation status corresponding to the second function item. The activation status corresponding to the second function item is adapted to the second resource information.

7. The method according to claim 6, characterized in that, After sending the resource change message to the AI ​​gateway, the process further includes: Receive a function item change message from the AI ​​gateway. The function item change message includes: target function item and the activation status of the target function item. The target function item is the function item whose activation status needs to be updated after comparing the second function information with the first function information. In response to the function item change message, control operations are performed on the function channel corresponding to the target function item based on the activation status of the target function item; Based on the activation status of the actual active functions in the mobile client, a function change confirmation message is generated and sent to the AI ​​gateway.

8. The method according to claim 7, characterized in that, The function change message also includes a first preset duration; the method further includes: If, after receiving the function item change message from the AI ​​gateway, no confirmation message for the function item change is sent within the first preset time period, a second preset security policy is executed. The second preset security policy includes: continuing the previous control operation on the function channel corresponding to the function item, or adopting a preset security control operation.

9. The method according to any one of claims 6-8, characterized in that, The method further includes: reporting the setting mode identifier of the mobile client to the AI ​​gateway, wherein the setting mode identifier is used to characterize the setting method of the mobile client and the AI ​​gateway.

10. An AI gateway, characterized in that, The AI ​​gateway includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the AI ​​session function adaptation method as described in any one of claims 1 to 5.

11. A mobile client, characterized in that, The mobile client includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the AI ​​conversation function adaptation method as described in any one of claims 6 to 9.

12. An electronic device, characterized in that, The electronic device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the AI ​​conversation function adaptation method as described in any one of claims 1 to 5, and / or to implement the steps of the AI ​​conversation function adaptation method as described in any one of claims 6 to 9.

13. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the AI ​​conversation function adaptation method as described in any one of claims 1 to 5, and / or implements the steps of the AI ​​conversation function adaptation method as described in any one of claims 6 to 9.

14. A computer program product, characterized in that, When the computer program product is executed, it implements the steps of the AI ​​session function adaptation method as described in any one of claims 1 to 5, and / or implements the steps of the AI ​​session function adaptation method as described in any one of claims 6 to 9.