Agent-based user interface rendering method and system

CN122985157APending Publication Date: 2026-10-27RAJAX NETWORK &TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610993785.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-03
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0004]但由于组件代码内置在客户端中,每次组件更新,都需要发布新的客户端版本,维护成本很高

Benefits of technology

在本申请的实施例中,客户端响应于场景加载请求从服务端动态获取目标场景标识对应的组件集合并进行本地注册,结合声明式定义的界面描述信息驱动界面渲染,打破了传统技术中组件代码内置于客户端导致的更新依赖发版、维护成本高以及交互形式受限的技术瓶颈,实现了界面布局结构与组件逻辑的解耦及服务端动态下发,使得智能体能够根据对话上下文按需灵活组装和扩展用户界面,显著降低客户端版本迭代频率与维护成本,极大地提升了复杂服务场景下用户界面的动态适配能力、渲染效率及交互灵活性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122985157A_ABST
    Figure CN122985157A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a user interface rendering method and system based on an agent, relating to the field of artificial intelligence, comprising: in response to a scene loading request, obtaining a component set corresponding to a target scene identifier from a server, the component set comprising component codes of components bound to the target scene identifier; registering the components in a component registry based on the component set; rendering a user interface corresponding to the target scene identifier based on the component registry and interface description information corresponding to the target scene identifier issued by the server; and the interface description information being used to declaratively define a layout structure and data mapping relationship of the interface. The present application realizes decoupling of the interface layout structure and the component logic and dynamic issuance by the server, significantly reduces the iteration frequency and maintenance cost of the client version, and greatly improves the dynamic adaptation capability, rendering efficiency and interactive flexibility of the user interface in a complex service scenario.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a user interface rendering method and system based on intelligent agents. Background Technology

[0002] With the widespread adoption of large language models in consumer applications, intelligent agents have emerged as a new form of interaction on mobile devices. The response information of intelligent agents is no longer limited to plain text, but increasingly carries structured information in the form of user interfaces. Intelligent agents generate interfaces on demand within the dialogue flow, such as order interfaces, address selection interfaces, and product recommendation interfaces.

[0003] In related technologies, the component code of atomic components that may be used in the interface is built into the client. When the response information of the agent is the interface description information, the client calls the pre-built component code to complete the rendering of the user interface based on the interface description information.

[0004] However, since the component code is built into the client, a new client version needs to be released every time the component is updated, resulting in high maintenance costs. Moreover, it can only use components built into the client, which cannot meet more diverse interface rendering needs and limits the flexibility and scalability of the intelligent agent's interactive interface. Summary of the Invention

[0005] This application provides a user interface rendering method and system based on intelligent agents to alleviate or solve one or more technical problems existing in the prior art.

[0006] In a first aspect, embodiments of this application provide a user interface rendering method based on an intelligent agent, including: In response to a scene loading request, a set of components corresponding to a target scene identifier is obtained from the server. The set of components includes the component code of each component bound to the target scene identifier. Based on the aforementioned component set, each component is registered in the component registry. Based on the component registry and the interface description information corresponding to the target scene identifier issued by the server, the user interface corresponding to the target scene identifier is rendered; the interface description information is used to declaratively define the layout structure and data mapping relationship of the interface.

[0007] In some embodiments of this application, registering each component to the component registry based on the component set includes: The component code includes the source code of the component. The source code of the first component is compiled by a preset compiler to obtain the component script of the first component; or, the component code includes the component script of the component. The component script of the first component is obtained from the component set; the first component is any component in the component set. The component script of the first component is executed in a preset sandbox environment, and the execution result of the first component is output; the execution result includes a status flag, which is used to indicate whether the component script of the first component has been executed successfully; If the status indicator in the execution result indicates successful execution, the component description information of the first component included in the execution result is registered in the component registry; the component description information is used to characterize the running attributes or configuration parameters of the first component.

[0008] In some embodiments of this application, executing the component script of the first component in a preset sandbox environment includes: Obtain the pre-configured whitelist in the preset sandbox environment, the preset whitelist being used to specify the dependent program modules that are allowed to be loaded; During the execution of the component script of the first component in the preset sandbox environment, if the target program module requested by the component script is detected to be in the preset whitelist, then the target program module is loaded and executed. If the target program module is detected to be not in the preset whitelist, the loading of the target dependent program module is blocked, and an execution result indicating execution failure is output.

[0009] In some embodiments of this application, before compiling the source code of the first component using a preset compiler to obtain the component script of the first component, the method further includes: Based on preset code correction rules, the system detects whether there are target code segments to be corrected in the source code of the first component; the preset code correction rules are formulated to address differences in runtime environments and / or framework compatibility issues. If the target code fragment exists, replace the target code fragment in the source code of the first component with the corrected code fragment.

[0010] In some embodiments of this application, registering the component description information of the first component included in the execution result to the component registry includes: Based on the component identifier included in the component description information, determine whether there is registered component description information corresponding to the component identifier in the component registry; If the registered component description information exists, then the registered component description information in the component registry is replaced with the component description information of the first component; If the registered component description information does not exist, the component description information of the first component is added to the component registry.

[0011] In some embodiments of this application, the step of obtaining the set of components corresponding to the target scene identifier from the server in response to a scene loading request includes: In response to entering the dialogue page, the scene loading request is triggered, and the target scene identifier corresponding to the dialogue page is obtained; the target scene identifier is used to identify the interaction intent of the dialogue between the client and the intelligent agent; the interaction intent corresponds to the interactive interface to be rendered. Send the target scene identifier to the server; Receive the set of components corresponding to the target scene identifier returned by the server.

[0012] In some embodiments of this application, sending the target scene identifier to the server includes: Detect the type of the client's current runtime environment; Based on the type of the operating environment, select the network request interface that matches the operating environment; The target scene identifier is sent to the server using the network request interface.

[0013] In some embodiments of this application, after registering each component to the component registry based on the component set, the method further includes: Retrieve the preset component description information of the preset general components built into the client; Based on the preset component identifier included in the preset component description information, determine whether there is registered component description information corresponding to the preset component identifier in the component registry; If there is already registered component description information corresponding to the preset component identifier, then skip the registration operation of the preset general component; If no registered component description information corresponding to the preset component identifier exists, the preset component description information is added to the component registry.

[0014] In some embodiments of this application, rendering the user interface corresponding to the target scene identifier based on the component registry and the interface description information corresponding to the target scene identifier issued by the server includes: The interface description information corresponding to the target scene identifier is parsed to obtain the target component tree; For each component node in the target component tree, based on the component identifier of the component node, query the target component description information corresponding to the component node in the component registry; If the target component description information is found, the component node is rendered according to the target component description information to generate the user interface corresponding to the target scene identifier.

[0015] Secondly, embodiments of this application provide a user interface rendering method based on an intelligent agent, including: The system receives a target scene identifier sent by a client and sends a set of components corresponding to the target scene identifier to the client, so that the client registers each component bound to the target scene identifier in the component registry based on the component set; the component set includes the component code of each component. In response to a user request sent by the client in the scenario corresponding to the target scenario identifier, interface description information corresponding to the target scenario identifier is sent to the client, so that the client renders the user interface corresponding to the target scenario identifier based on the interface description information and the component registry; the interface description information is used to declaratively define the layout structure and data mapping relationship of the interface.

[0016] In some embodiments of this application, receiving a target scene identifier sent by the client and sending the component set corresponding to the target scene identifier to the client includes: The system receives the target scene identifier and, based on the target scene identifier, queries the component set corresponding to the target scene identifier from the pre-stored mapping relationship between scene identifiers and component sets. The target scene identifier is used to identify the interaction intent of the dialogue between the client and the intelligent agent. The interaction intent corresponds to the interactive interface to be rendered. The set of components corresponding to the target scene identifier obtained from the query is sent to the client.

[0017] In some embodiments of this application, the method further includes: Receive a component update request sent by the design end. The component update request includes a scene identifier to be updated and component data to be updated. The component data includes the component code of the component to be updated. The component code includes the source code or component script of the component to be updated. Based on the scene identifier to be updated, the component data to be updated is updated into the mapping relationship.

[0018] In some embodiments of this application, when the component code includes the source code, updating the component data to be updated into the mapping relationship based on the scene identifier to be updated includes: The source code of the component to be updated is compiled by a preset compiler to obtain the component script of the component to be updated; Replace the source code of the component to be updated in the component data to be updated with the component script to obtain the target component data; Based on the scene identifier to be updated, the set of target components corresponding to the scene identifier to be updated is determined from the mapping relationship; Based on the component identifier included in the target component data, query whether historical component data corresponding to the component to be updated already exists in the target component set; If the historical component data already exists, then the historical component data in the target component set is replaced with the target component data; If the historical component data does not exist in the target component set, then the target component data is added to the target component set.

[0019] Thirdly, embodiments of this application provide a user interface rendering apparatus based on an intelligent agent, comprising: The acquisition module is used to obtain the component set corresponding to the target scene identifier from the server in response to the scene loading request. The component set includes the component code of each component bound to the target scene identifier. The registration module is used to register each component to the component registry based on the component set; The rendering module is used to render the user interface corresponding to the target scene identifier based on the component registry and the interface description information corresponding to the target scene identifier issued by the server; the interface description information is used to declaratively define the layout structure and data mapping relationship of the interface.

[0020] Fourthly, embodiments of this application provide a user interface rendering apparatus based on an intelligent agent, comprising: The receiving module is used to receive the target scene identifier sent by the client; A sending module is used to send a set of components corresponding to the target scene identifier to the client, so that the client registers each component bound to the target scene identifier into the component registry based on the component set; the component set includes the component code of each component; The sending module is further configured to respond to user request information sent by the client in the scenario corresponding to the target scenario identifier, and send interface description information corresponding to the target scenario identifier to the client, so that the client renders the user interface corresponding to the target scenario identifier based on the interface description information and the component registry; the interface description information is used to declaratively define the layout structure and data mapping relationship of the interface.

[0021] Fifthly, embodiments of this application provide an agent-based user interface rendering system, including a client and a server; The client is configured to respond to a scene loading request by sending a target scene identifier to the server; sending user request information corresponding to the target scene identifier to the server; receiving a component set corresponding to the target scene identifier returned by the server, and receiving interface description information corresponding to the user request information returned by the server; the component set includes component code of each component bound to the target scene identifier; the interface description information is used to declaratively define the layout structure and data mapping relationship of the interface; registering each component to a component registry based on the component set; and rendering the user interface corresponding to the target scene identifier based on the component registry and the interface description information. The server is used to receive the target scene identifier and the user request information, and send the component set and the interface description information to the client.

[0022] In some embodiments of this application, the client includes an application layer and a software development kit (SDK) module; The application layer is used to pass the target scene identifier and the user request information to the SDK module by calling the preloading interface of the SDK module; The SDK module is configured to respond to the call to the preloading interface, receive the target scene identifier and the user request information, and send them to the server; receive the component set and the interface description information returned by the server; register each component in the component registry based on the component set; and render the user interface corresponding to the target scene identifier based on the component registry and the interface description information.

[0023] In a sixth aspect, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the method described in the first or second aspect of embodiments of this application.

[0024] In a seventh aspect, embodiments of this application provide a computer-readable storage medium storing a computer program, which is executed by a processor to implement the methods described in the first or second aspect of embodiments of this application.

[0025] Eighthly, embodiments of this application provide a computer program product, including a computer program that is executed by a processor to implement the methods described in the first or second aspect of embodiments of this application.

[0026] Based on the interface generation method described in the first aspect above, this application has at least the following beneficial effects or advantages: In the embodiments of this application, the client responds to the scene loading request by dynamically obtaining the set of components corresponding to the target scene identifier from the server and registering them locally. Combined with the declaratively defined interface description information to drive interface rendering, it breaks through the technical bottlenecks of traditional technologies where component code is built into the client, resulting in update dependencies, high maintenance costs, and limited interaction forms. It achieves decoupling of the interface layout structure and component logic and dynamic distribution from the server, enabling the agent to flexibly assemble and expand the user interface as needed according to the dialogue context. This significantly reduces the client version iteration frequency and maintenance costs, and greatly improves the dynamic adaptability, rendering efficiency, and interaction flexibility of the user interface in complex service scenarios.

[0027] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application, it can be implemented according to the contents of the specification. In order to make the above and other objects, features and advantages of this application more obvious and understandable, specific embodiments of this application are given below. Attached Figure Description

[0028] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the various drawings denote the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings depict only some embodiments according to this application and should not be construed as limiting the scope of this application.

[0029] Figure 1 A flowchart of an agent-based user interface rendering method provided in an embodiment of this application is shown; Figure 2 A schematic diagram of the processing flow based on the matching network request interface of the runtime environment provided in an embodiment of this application is shown; Figure 3 A schematic diagram illustrating the component download and registration process provided in an embodiment of this application is shown; Figure 4 A schematic diagram illustrating the user interface rendering process provided in an embodiment of this application is shown; Figure 5 This paper illustrates another flowchart of the user interface rendering process provided in an embodiment of this application. Figure 6 A flowchart of an agent-based user interface rendering method provided in an embodiment of this application is shown; Figure 7 This illustration shows a schematic diagram of the structure of a user interface rendering device based on an intelligent agent according to an embodiment of this application; Figure 8This paper shows another structural schematic diagram of a user interface rendering device based on an intelligent agent provided in an embodiment of this application; Figure 9 This illustration shows a schematic diagram of the structure of an agent-based user interface rendering system provided in an embodiment of this application; Figure 10 A schematic diagram of an electronic device provided in an embodiment of this application is shown. Detailed Implementation

[0030] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the concept or scope of this application. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.

[0031] To facilitate understanding of the technical solutions of the embodiments of this application, the relevant technologies of the embodiments of this application are described below. The following relevant technologies are optional solutions and can be combined with the technical solutions of the embodiments of this application in any way, and all of them fall within the protection scope of the embodiments of this application.

[0032] With the widespread adoption of large language models in consumer applications, intelligent agents have emerged as a new form of interaction on mobile devices. The response information of intelligent agents is no longer limited to plain text, but increasingly carries structured information in the form of user interfaces. Intelligent agents generate interfaces on demand within the dialogue flow, such as order interfaces, address selection interfaces, and product recommendation interfaces.

[0033] In related technologies, atomic component implementations are built into the client-side renderer's SDK (Software Development Kit). For example, components such as Text, Column, Row, Image, IconImage, and GreetingCardContainer are built into the client. All these components are hard-coded into the bundle at compile time. After receiving the interface description information from the agent, the client calls the pre-built component implementations based on this information to complete the rendering of the user interface.

[0034] In the aforementioned technologies, because the component implementation is built into the client, each component update requires the release of a new client version, resulting in a long component update cycle and high maintenance costs. Furthermore, component updates can only replace the entire software package, leading to coarse-grained updates. Moreover, the limitation to built-in components cannot meet diverse interface rendering needs, thus restricting the flexibility and scalability of the intelligent agent's interactive interface.

[0035] Based on this, embodiments of this application provide a user interface rendering method based on intelligent agents. In this method, in response to a scene loading request, the client obtains a set of components corresponding to a target scene identifier from the server. The set of components includes the component code of each component bound to the target scene identifier. Based on the set of components, each component is registered in a component registry. Based on the component registry and the interface description information corresponding to the target scene identifier issued by the server, the user interface corresponding to the target scene identifier is rendered. The interface description information is used to declaratively define the layout structure and data mapping relationship of the interface.

[0036] In this method, the client responds to the scene loading request by dynamically obtaining the set of components corresponding to the target scene identifier from the server and registering them locally. Combined with the declaratively defined interface description information, the interface rendering is driven. This breaks through the technical bottlenecks of traditional technologies where component code is built into the client, resulting in update dependencies, high maintenance costs, and limited interaction forms. It achieves decoupling of the interface layout structure and component logic and dynamic distribution from the server, enabling the agent to flexibly assemble and expand the user interface as needed according to the dialogue context. This significantly reduces the client version iteration frequency and maintenance costs, and greatly improves the dynamic adaptability, rendering efficiency, and interaction flexibility of the user interface in complex service scenarios.

[0037] It should be noted that the application scenarios or examples provided in this application are for ease of understanding, and the embodiments of this application do not specifically limit the application of the technical solutions. Furthermore, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. The collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0038] The technical solution of this application and how it solves the aforementioned technical problems are described in detail below with specific embodiments. The listed specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0039] Figure 1 A flowchart illustrating an agent-based user interface rendering method provided in an embodiment of this application is shown. Figure 1 As shown, the method specifically includes steps 101-103.

[0040] Step 101: In response to the scene loading request, the client obtains the component set corresponding to the target scene identifier from the server. The component set includes the component code of each component bound to the target scene identifier.

[0041] Step 102: The client registers each component to the component registry based on the component collection.

[0042] Step 103: The client renders the user interface corresponding to the target scene identifier based on the interface description information corresponding to the target scene identifier issued by the component registry and the server; the interface description information is used to declaratively define the layout structure and data mapping relationship of the interface.

[0043] The client can be an application installed on a mobile phone, computer, or other terminal. The client can be, but is not limited to, an app (APP), a web page, or a mini-program. The client can communicate with the server of the intelligent agent and also interact with the user.

[0044] The server side of an intelligent agent is a backend system or service endpoint that provides specialized service capabilities. It is responsible for executing core service logic, calling large language models for reasoning and decision-making, and encapsulating the processed task results into a structured data stream, which is then sent to the client for rendering and display.

[0045] In the embodiments of this application, a user can log in to the agent's server through a client. The user can then input a query in the client's dialog interface, which the client sends to the server. Based on the query, the server invokes the agent service and / or a large language model for inference, generates a response message corresponding to the query, and sends the response message to the client, which then renders it in the dialog interface.

[0046] Server-side responses can include various message types, such as text, images, and interactive user interfaces. Interactive user interfaces consist of components, which are the basic functional units that make up the user interface. These components are used to carry specific service logic, display specific visual content, or respond to user interactions. Examples include text display components, image display components, button components, and list components. The server guides the client to dynamically assemble and render a complete user interface that meets the needs of the current dialogue scenario by sending interface description information containing these components.

[0047] The interface description information declaratively defines the layout structure and data mapping relationships of the interface. The layout structure refers to the spatial arrangement and hierarchical nesting of components within the interface, specifying whether components are grouped in horizontal rows, vertical columns, or other container forms, as well as the relative positions, alignment, and size constraints between components. This abstractly describes the visual skeleton and topology of the user interface without relying on specific code implementations. The data mapping relationships refer to the rules defined in the interface description information used to bind dynamic service data sent from the server to the specific attributes of components. This clarifies which display content (such as text labels, image addresses, etc.) or states (such as visibility, disabling, etc.) of components need to be filled or controlled by externally input data fields. This decouples the interface display logic from the specific service data, allowing the same interface structure to dynamically present different content based on real-time returned data.

[0048] The aforementioned interface description information can be a structured description of pure data, and does not contain executable code. This is primarily based on security considerations, aiming to allow the client to obtain the layout structure and data mapping relationships of the interface to be rendered through a structured data description. The absence of code in the interface description information reduces the potential for malicious script injection during server-side generation and network transmission, thereby improving the determinism and security of the client's parsing and rendering of the interface.

[0049] Unlike related technologies that rely solely on built-in components in the client, this application's embodiments pre-store a mapping between scene identifiers and component sets on the server side. The component set includes component data for at least one component, and the component data includes the component's code. The scene identifier uniquely identifies the interaction intent between the client and the agent, such as order confirmation, address selection, or product recommendation scenarios. The server retrieves the mapping relationship using the scene identifier and distributes the corresponding component set, enabling the client to dynamically obtain and load the required component code based on the current dialogue context. This eliminates the reliance on built-in client components and achieves server-side configuration and on-demand expansion of interface functionality.

[0050] In addition to component code, the aforementioned component data may also include a scene identifier for the scene to which the component belongs, the component type name, the component version number, component protocol metadata, and minimum version information. The component type name in the component data is identical to the component type name in the corresponding component node of the target component tree subsequently constructed based on the interface description information. This allows for the retrieval of the corresponding component for rendering based on the component identifier containing the component type name. The component version number identifies the iteration version of the component code, enabling the client to accurately match and load the corresponding version of the component code after receiving the interface description information. This ensures that the rendering result matches the development expectations and supports the coexistence and canary release of multiple component versions.

[0051] Component protocol metadata defines the component's exposed attribute structure, event callbacks, and data binding rules. This enables the client to correctly validate the validity of input parameters when parsing UI description information and automatically complete attribute mapping and event registration, ensuring that the component can receive data and respond to user interactions in the agreed-upon manner at runtime. Minimum version information specifies the minimum version number of the rendering engine or runtime environment on which the component depends for normal operation. Before loading the component, the client checks whether the current environment meets this requirement. If not, loading is refused or downgraded, thereby reducing rendering anomalies or runtime crashes caused by environment incompatibility and improving system stability and compatibility.

[0052] When a scene loading request is triggered on the client side, the client downloads the corresponding component set from the server based on the current target scene identifier, realizing on-demand loading of component sets. The scene loading request can be triggered by the user triggering a specific intention in the dialog interface (such as clicking a function entry, entering a specific command, etc.) or by the client automatically determining that a structured interface needs to be displayed. In response to this request, the client can accurately pull the currently required component resources from the server, reducing the resource waste caused by full loading and ensuring the timeliness and relevance of interface rendering.

[0053] A component registry can be a global or local component index structure maintained by the client, used to store the mapping relationship between component descriptions and component identifiers of registered components. The component descriptions can include metadata such as the component's instantiation logic, default property configurations, supported interactive event types, and the corresponding renderer implementation. When parsing the interface description information, the rendering engine can retrieve the corresponding component description information from the component registry based on the component identifier, dynamically instantiate the component, apply its default properties and interactive logic, and ultimately complete the component's rendering. The component identifier can be a string, number, or code that uniquely distinguishes different components, such as the component name, type code, or hash value, and it serves as the component's index key.

[0054] After the client registers each component to the component registry based on the component collection, the rendering engine can quickly locate and instantiate the corresponding component by querying the component registry when parsing the interface description information, thereby realizing the dynamic association and rendering of the interface description information and the locally registered component description information.

[0055] In the embodiments of this application, the client responds to the scene loading request by obtaining the component set corresponding to the target scene identifier from the server and registering it in the component registry. Then, it combines the declarative interface description information issued by the server to render the user interface. This realizes the dynamic definition of the interface layout structure and data mapping relationship, as well as the on-demand loading and flexible configuration of component code. Since the component set is dynamically downloaded from the server, the size of the client's installation package can be effectively reduced, and the flexibility, maintainability and cross-platform reusability of interface development can be improved. At the same time, it supports the dynamic issuance and updating of the interface structure by the server, and can achieve rapid iteration of service scenarios without frequent releases.

[0056] In some embodiments of this application, in response to a scene loading request, the component set corresponding to the target scene identifier is obtained from the server, including: the client responding to entering the dialogue page determines that a scene loading request is triggered and obtains the target scene identifier corresponding to the dialogue page; the target scene identifier is used to identify the interaction intent of the dialogue interaction between the client and the intelligent agent; the interaction intent corresponds to the interactive interface to be rendered; Send the target scene identifier to the server; receive the set of components corresponding to the target scene identifier returned by the server.

[0057] The dialogue page is where the user interacts with the intelligent agent on the server. Target scene identifiers can be pre-set in the page code of the dialogue page. These identifiers identify possible interactive intentions within the dialogue page, corresponding to interactive interfaces to be rendered. An interactive intention can correspond to a single interactive interface, or multiple interactive interfaces that may be used in the current dialogue page. One or more scene identifiers can be pre-set in the page code of the dialogue page; these scene identifiers are collectively referred to as the aforementioned target scene identifiers.

[0058] After a user clicks the client's icon or link, the client launches and displays a dialog page. Upon entering the dialog page, a scene loading request is triggered. The client retrieves a pre-set target scene identifier from the dialog page's code and sends it to the server. The server then uses the target scene identifier to query the corresponding component set from the mapping relationship between scene identifiers and component sets, and sends the retrieved component set back to the client.

[0059] This embodiment triggers a scene loading request when the client enters the dialogue page, and dynamically downloads the component set corresponding to the target scene identifier from the server. Since the target scene identifier is used to identify the interaction intent corresponding to at least one interactive interface, the data of the interactive components that may be used in at least one interactive interface corresponding to the interaction intent can be dynamically downloaded from the server based on the target scene identifier. This realizes the advance on-demand retrieval of the interactive components required by the dialogue interface, breaking the static limitation of pre-installing all components on the client in the traditional mode. It can significantly reduce the size of the initial installation package of the client and ensure that the client can obtain the component set corresponding to the target scene identifier in advance, thereby improving the flexibility and iteration efficiency of the service scene.

[0060] In some embodiments of this application, sending a target scenario identifier to the server includes: detecting the type of the client's current operating environment; selecting a network request interface that matches the operating environment based on the type of the operating environment; and using the network request interface to send the target scenario identifier to the server.

[0061] The client's current runtime environment can refer to the operating system platform or host container on which the client is located. The type of runtime environment can include, but is not limited to, web environment (World Wide Web environment), H5 environment (Hypertext Markup Language environment), Weex environment, and mini-program environment.

[0062] A network request interface can refer to a low-level function or SDK method used locally on the client to initiate a network call. The network request interface matched varies depending on the client's runtime environment. For example, if the client's current runtime environment is a web environment or an H5 environment, the matched network request interface could be a browser API (Application Programming Interface). If the client's current runtime environment is a mini-program environment, the matched network request interface could be the API of the mini-program's application. The client uses the network request interface matching its current runtime environment to send a target scenario identifier to the server.

[0063] Figure 2 This diagram illustrates the processing flow of matching network request interfaces based on the runtime environment. Figure 2As shown, the client obtains the target scene identifier and performs runtime probing to determine the type of the current runtime environment. If the current runtime environment is a Weex environment, it selects the API in the Weex framework used to initiate network requests, such as `window.weex.requireModule('stream').fetch`. If the current runtime environment is an H5 environment, it selects the script API used to initiate network requests, such as `fetch(url)`. The client then sends the target scene identifier to the server through the selected API and receives the component set returned by the server.

[0064] In some embodiments, the client may include an application layer and an SDK module. The interface address and server domain name of the aforementioned network request interface may be built into the SDK module. The application layer cannot modify the interface address and server domain name, thereby improving the accuracy of the interface address and server domain name. When modifications are needed, only the interface address and server domain name in the SDK module need to be modified, without modifying the application layer data.

[0065] By detecting the type of the client's current operating environment and adaptively selecting the matching network request interface to send the target scene identifier, the system effectively solves the interface call failure or compatibility issues caused by differences in the underlying network implementation in cross-platform development. This ensures that a stable and efficient communication link with the server can be established in different operating systems and host containers, thereby significantly improving the success rate of scene loading request sending and the client's environment adaptability.

[0066] In some embodiments of this application, each component is registered to a component registry based on a component set, including: The component code includes the component's source code. The source code of the first component is compiled using a preset compiler to obtain the component script of the first component; or, the component code includes the component script of the first component, which is obtained from the component collection. The first component is any component in the component collection. The component script of the first component is executed in a preset sandbox environment, and the execution result of the first component is output. The execution result includes a status flag, which is used to indicate whether the component script of the first component was executed successfully. If the status flag in the execution result indicates successful execution, the component description information of the first component included in the execution result is registered in the component registry. The component description information is used to characterize the running attributes or configuration parameters of the first component.

[0067] The default compiler can be any compiler capable of compiling source code. The component's source code is the set of raw files written during development, uncompiled and unpackaged, required to build the component. The component's source code may include, but is not limited to, import statements, JSX (JavaScript Extended Syntax), and TypeScript type annotations. Component scripts refer to the code files within the component's source code responsible for control logic, data processing, and lifecycle management; they are obtained by parsing and compiling the component's source code.

[0068] In some embodiments, the component data of each component in the component collection stored on the server includes the component code, which is the component's source code. In this case, after the client receives the component collection corresponding to the target scene identifier, it needs to compile the source code of each component separately using a preset compiler to obtain the component script for each component.

[0069] In some implementations, source code compilation can be performed on the main thread. In others, compilation can be handled in other threads, with the results returned to the main thread for serialization, ultimately resulting in the component script. Performing compilation on other threads reduces main thread blocking, thus ensuring smooth user interface interaction and responsiveness.

[0070] In other embodiments, the component code included in the component data of each component in the component collection stored on the server is component script. In this case, the client does not need to compile the component code after receiving the component collection.

[0071] Taking the first component as an example, after the client obtains the component script of the first component, it inputs the component script of the first component into the preset sandbox environment. The preset sandbox environment provides a runtime container for the safe isolation of the component script execution. Its function is to safely execute the component script of the first component and capture its execution result.

[0072] In some embodiments of this application, the preset sandbox environment may employ a scope isolation strategy based on dynamic function construction. Under this strategy, component scripts cannot read local variables in outer closures during execution to prevent variable pollution. The preset sandbox environment explicitly retains access permissions to the global runtime environment object. The global runtime environment object provides a Document Object Model (DOM) interface to support component scripts in calling necessary rendering interfaces and obtaining page state information during execution, thereby maintaining the integrity of component functionality while ensuring a certain degree of isolation.

[0073] The execution results of component scripts output from the default sandbox environment include status indicators. If the component script executes successfully, the status indicator indicates success, and the execution result includes component description information obtained from the execution of the component script. If the component script fails to execute, the status indicator indicates failure, and the execution result does not include component description information. If the component script is skipped from execution because it does not meet preset conditions, the status indicator indicates that it was skipped, and the execution result does not include component description information. These preset conditions may include, but are not limited to, component version mismatch with client version, component script already being executed, etc.

[0074] If the status indicator indicates successful execution, the component description information of the first component included in the execution result is added to the local component registry. If the status indicator indicates execution failure or is skipped, it can be logged for subsequent troubleshooting, performance analysis, or status backtracking.

[0075] In this embodiment, when the component set downloaded from the server includes component scripts, the client does not need to perform compilation operations, saving client computing power and improving client interface rendering efficiency. After obtaining the component scripts, the client executes them securely in a preset sandbox environment. The execution results include status indicators, clearly distinguishing the execution status of component scripts for different components. Upon successful execution, the component description information, including runtime attributes or configuration parameters, is registered to the component registry, thereby achieving dynamic verification, error isolation, and standardized registration management of components while ensuring system stability and security. Since the compilation of the source code and the execution of the component scripts are performed independently, the failure of compilation or execution of a single component script will not affect the registration of other components.

[0076] In some embodiments of this application, executing the component script of the first component in a preset sandbox environment includes: obtaining a preset whitelist pre-configured in the preset sandbox environment, the preset whitelist being used to specify the dependent program modules that are allowed to be loaded; during the execution of the component script of the first component in the preset sandbox environment, if it is detected that the target program module requested to be loaded by the component script is in the preset whitelist, then the target program module is loaded and executed; if it is detected that the target program module is not in the preset whitelist, then the loading of the target dependent program module is blocked, and an execution result indicating execution failure is output.

[0077] Dependent program modules can refer to third-party function libraries, external resource packages, or system built-in interfaces that component scripts need to reference, call, or load during execution to achieve specific functions. Dependent program modules can include, but are not limited to, basic runtime libraries and UI (user interface) component libraries. Basic runtime libraries can include the basic support required for component operation, such as the React framework and its related runtime modules (e.g., react, react / jsx-runtime). UI component libraries provide specific interface rendering capabilities; for example, they can be component libraries built based on specific UI specifications (e.g., @a2ui / react). The default whitelist limits the dependent program modules that component scripts are allowed to call or load. If a component script attempts to call or load other program modules not included in the default whitelist, it will be immediately blocked. For example, if a component script attempts to call fs (file system), child_process (child process), or http (network request), etc., program modules not in the default whitelist, it will be immediately blocked.

[0078] Both the preset sandbox environment and the preset whitelist are pre-configured in the client. During the execution of the first component's script in the preset sandbox environment, the component script may request to call or load some dependent program modules. If the requested dependent program module is detected to be on the preset whitelist, the component script is allowed to call or load that dependent program module. However, if the requested dependent program module is detected to be not on the preset whitelist, calling or loading that dependent program module is not allowed. In this case, the execution of the component script is stopped, the component script's status is set to execution failure, and the execution result containing this status is output.

[0079] In this embodiment, in a preset sandbox environment, a whitelist mechanism is used to dynamically verify and control the dependent program modules loaded by the component script. Only dependent program modules in the preset whitelist are allowed to be called or loaded. Requests from risky program modules not in the preset whitelist are blocked and execution failure results are reported. This effectively reduces unauthorized access to system resources or functions by the component script and significantly improves the security isolation capability and operational stability of the preset sandbox environment.

[0080] In some embodiments of this application, before compiling the source code of the first component using a preset compiler to obtain the component script of the first component, the method further includes: the client detecting whether there is a target code segment to be corrected in the source code of the first component based on preset code correction rules; the preset code correction rules are formulated to address differences in the runtime environment and / or framework compatibility issues; if a target code segment exists, the target code segment in the source code of the first component is replaced with the corrected code segment.

[0081] Predefined code correction rules refer to a predefined set of transformation logic used to identify and replace specific strings or syntactic structures in the source code. These rules can manifest as a mapping between regular expression matching patterns and corresponding replacement strings, or as script logic containing conditional statements and string manipulation functions. The purpose of predefined code correction rules can be as a "patch layer," performing automated string-level repairs before the source code is compiled or executed.

[0082] Preset code correction rules can be pre-set within the client's rendering engine SDK. As an example, the preset code correction rules are encapsulated in a function similar to patchRenderScript. When the client loads the source code of a component, this function is called first to process the source code string before handing it over to the preset compiler for compilation.

[0083] Alternatively, pre-defined code correction rules can be stored in a separate configuration file or database and dynamically retrieved by the client to fix newly discovered compatibility issues without updating the client version. The separate configuration file can be in formats such as JSON (JavaScript Object Notation) or YAML (YAML is not Markup Language).

[0084] The default code correction rules are designed to address runtime environment differences and / or framework compatibility issues. Runtime environment differences can refer to inconsistencies between the expected standard execution environment of a component's source code and the actual target runtime environment, in areas such as API support, CSS (Cascading Style Sheets) property parsing, or script engine behavior. For example, the expected standard execution environment of a component's source code might be a web browser, while the actual client runtime environment might be a Weex container. As another example, a web browser environment might support the CSS shorthand property `background: url(...) linear-gradient(...)`, but the Weex container might not support this shorthand.

[0085] Framework compatibility issues refer to problems where the source code of components distributed by the server cannot be rendered correctly or throws errors in a specific version of the UI framework due to version iterations, changes in the definition of interface description information, or defects in internal implementation logic. UI frameworks can include, but are not limited to, React, Vue (view), and A2UI (Agent-to-User Interface). As an example, the A2UI framework injects the string "weight: 'initial'" into nodes whose interface description information does not declare weight, leading to subsequent logical misjudgments.

[0086] The target code snippet is a syntax structure or logical judgment statement in the component's source code that conforms to the matching pattern in the preset code correction rules and has runtime environment differences or framework compatibility defects. For example, in the component's source code, if there is a conditional judgment statement for determining whether the node layout weight property exists (such as node.weight !== undefined), and this conditional judgment statement will cause logical branch misjudgment in the runtime environment of a specific framework due to the default value automatically injected by the framework (such as the string type 'initial'), thus causing UI rendering abnormalities (such as node width collapse), then this conditional judgment statement will be identified as the target code snippet.

[0087] For such target code snippets, the preset code correction rules use text processing methods such as regular expression matching to replace them with corrected code snippets. For example, non-strict judgments are replaced with strict data type validation statements, that is, node.weight !== undefined is replaced with typeof node.weight === 'number'. This automatically reduces the risks caused by underlying defects of the framework or cross-platform environment differences before the source code is compiled, so that the compilation of the component's source code and the subsequent execution of the component script in the preset sandbox environment can be completed smoothly, thereby ensuring the normal rendering and interaction of the user interface.

[0088] In some embodiments, once runtime environment differences and framework compatibility issues are eliminated, the preset code correction rules in the client can also be deleted, and the operation of correcting the source code will no longer be performed after deletion.

[0089] By automatically correcting the source code during the preprocessing stage, not only are layout calculation errors caused by differences in framework versions or specific runtime environments (such as the Weex container) in handling non-standard data types (such as the string 'initial') reduced, but also UI display anomalies caused by node width collapse are reduced. Thus, without modifying the underlying source code of the framework or relying on framework version updates, the rendering consistency and runtime stability of components on different clients are significantly improved.

[0090] In this application embodiment, the client automatically detects whether there is a target code segment to be corrected in the source code of the first component based on the preset code correction rules formulated for differences in the runtime environment and framework compatibility issues. When the target code segment is detected, it is replaced with the corrected code segment. This reduces logical anomalies caused by runtime environment or framework defects before the source code is compiled, and significantly improves the rendering consistency and running stability of the component under different terminal devices and framework versions.

[0091] In some embodiments of this application, registering the component description information of the first component included in the execution result to the component registry includes: the client determining whether there is registered component description information corresponding to the component identifier in the component registry based on the component identifier included in the component description information; if there is registered component description information, the registered component description information in the component registry is replaced with the component description information of the first component; if there is no registered component description information, the component description information of the first component is added to the component registry.

[0092] In this embodiment, the client performs an existence check on the component registry based on the component identifier in the component description information, and performs a replacement operation when a registered component description information exists, and performs an addition operation when it does not exist, thereby realizing dynamic registration and automatic updating of component description information and ensuring the real-time and accuracy of component registry data.

[0093] In some embodiments of this application, after registering each component to the component registry based on the component set, the method further includes: obtaining preset component description information of preset general components built into the client; determining whether there is registered component description information corresponding to the preset component identifier in the component registry based on the preset component identifier included in the preset component description information; if there is registered component description information corresponding to the preset component identifier, skipping the registration operation of the preset general component; if there is no registered component description information corresponding to the preset component identifier, adding the preset component description information to the component registry.

[0094] In this embodiment, the client can pre-build some general-purpose components, namely the aforementioned preset general-purpose components. These preset general-purpose components may include, but are not limited to, atomic components such as text, image, and button. The preset component description information describes the basic attribute definitions, rendering behavior logic, and native mapping relationships of the preset general-purpose components. Specifically, it may include the component's unique identifier, supported configuration parameters, default style specifications, and the corresponding client-side native implementation class name.

[0095] After registering each component from the component set downloaded from the server to the component registry, the pre-built default general components are then registered. During this registration process, if the component registry already contains description information for a registered component corresponding to a default component identifier, the default general component corresponding to that default component identifier is skipped. Only if the component registry does not contain description information for a registered component corresponding to a default component identifier will the default component description information for that default general component be added to the component registry.

[0096] In this embodiment, after registering each component in the component set to the component registry, the registration process for the preset general components built into the client is then performed. The addition operation is only performed if the corresponding registered component description information does not exist in the component registry. This establishes a registration sequence that prioritizes components dynamically downloaded from the server and uses the general components built into the client as a fallback. This effectively reduces the chance of dynamic components issued by the server being accidentally overwritten or conflicting with local older versions of general components, ensuring the immediate effectiveness and version consistency of service logic. It also ensures that the underlying basic rendering capabilities remain intact when dynamic components are missing or abnormal, significantly improving the stability and fault tolerance of client component loading.

[0097] The client can include an application layer and an SDK module. The SDK module can include a scene loader, a component registry, and a UI renderer. Figure 3 A flowchart illustrating the component download and registration process is provided. Figure 3As shown, the application layer transmits the target scene identifier to the scene loader. The scene loader downloads the component collection and compiles and executes the source code of each component in the collection to obtain the component description information. Then, it registers the component description information of each component in the component registry. After completing the registration operation, the scene loader sends a completion notification to the application layer. After the client obtains the interface description information, the application layer calls the interface renderer to perform the rendering operation. First, it registers the client's built-in preset general components. For component type names that are already registered, the registration of the preset general components for that component type name is skipped. For unregistered component type names, the preset component description information of the preset general components for that component type name is added to the component registry. Then, the interface renderer constructs a target component tree based on the interface description information. For each component node in the target component tree, based on the component identifier included in the component node, it queries the component registry for the corresponding component description information. The retrieved component description information is then used to render the corresponding component.

[0098] In some embodiments of this application, rendering the user interface corresponding to the target scene identifier based on the interface description information corresponding to the target scene identifier issued by the component registry and the server includes: the client parses the interface description information corresponding to the target scene identifier to obtain a target component tree; for each component node in the target component tree, based on the component identifier of the component node, the client queries the target component description information corresponding to the component node in the component registry; if the target component description information is found, the client renders the component node according to the target component description information to generate the user interface corresponding to the target scene identifier.

[0099] Interface description information can be structured data, and its format can be JSON, XML (Extensible Markup Language), or a custom binary protocol, etc. Interface description information can describe the interface's hierarchical structure, layout, and style attributes.

[0100] The client parses the interface description information, identifies the nesting relationships of data objects within it, converts each data object into a component node, establishes parent-child reference relationships between these nodes, and connects them together to form a tree-like data structure starting from the root node—this is the target component tree described above. Here, a data object can refer to the smallest structured data unit that constitutes the user interface; each data object corresponds to a specific element on the user interface, such as a button, text box, or image container.

[0101] A component node is the basic unit that makes up the target component tree; it is a memory-mapped object of a single UI element in the interface description information. A component node can include a component identifier, a set of attributes, style information, a list of child nodes, native mapping references, etc.

[0102] For each component node in the target component tree, the corresponding target component description information is retrieved from the component registry based on the component identifier included in each component node. Then, rendering is performed based on the retrieved target component description information, ultimately obtaining the user interface corresponding to the target scene identifier. This user interface is then displayed as a response message on the dialog page shown on the client. The rendering of all or some component interfaces in the target component tree can be performed synchronously, or the rendering of each component node can be performed sequentially.

[0103] In this embodiment, the client parses the interface description information to construct the target component tree, and uses the component identifier to dynamically match the corresponding component description information in the component registry for rendering. This achieves decoupling of the user interface structure and rendering logic and on-demand loading, allowing the client to dynamically construct and display the user interface of any target scene based only on the interface description information and the component registry, without having to hardcode the interface logic for each scene. This significantly improves the flexibility of interface generation and the efficiency of subsequent iteration and maintenance.

[0104] In embodiments of this application, the component identifier may include a component type name, or the component identifier may include a component type name and a component version number, or the component identifier may also include a component type name and a scene identifier. When the component identifier includes both a component type name and a scene identifier, the design end can update the entire set of components corresponding to the scene identifier on a scene-by-scene basis when updating the component.

[0105] In some embodiments, the client can use local storage or cross-platform storage technology instead of traditional memory-mapped structures as the caching medium to cache data such as component collections, interface description information, and component registry entries. By leveraging the data persistence features of the above storage methods, data reuse across pages and application startup cycles can be achieved, thereby effectively reducing the initialization overhead during the cold start phase and improving response speed.

[0106] To facilitate understanding of the interface rendering process provided in the embodiments of this application, the following description is provided in conjunction with the accompanying drawings. Figure 4 This diagram illustrates the user interface rendering process. The client can include an application layer and an SDK module. The SDK module can include a scene loader, a component registry, and a UI renderer. Figure 4As shown, when a user enters the dialogue page, the application layer transmits the target scene identifier to the scene loader. The scene loader then requests the download of a component set from the server gateway. The scene loader receives the component set from the server gateway and modifies, compiles, and executes the source code of each component in the set within a pre-defined sandbox environment to obtain the component description information for each component. This component description information is then registered in the component registry, and a registration completion notification is sent to the application layer. When the user inputs their request information, the application layer obtains the interface description information generated by the agent on the server based on the user request information and sends this information to the interface renderer. The interface renderer constructs a target component tree based on the interface description information. For each component node in the target component tree, based on the component identifier in the component node, it queries the corresponding component description information from the component registry. Using the retrieved component description information, it renders the component, ultimately obtaining the rendered user interface, which is then displayed to the user.

[0107] Figure 5 Another flowchart illustrating the user interface rendering process is shown, such as... Figure 5 As shown, the client includes an application layer and an SDK module. The server contains a scene database that stores the mapping between scene identifiers and component sets. The server provides a gateway interface. In the client, the SDK module provides a preloading interface. The application layer calls this interface through its application code. The SDK module responds to the application layer's call by establishing a communication connection with the server's gateway interface and downloading the component set corresponding to the target scene identifier from the server. The SDK module performs controlled compilation and execution of the source code of the components in the downloaded component set to obtain component description information, which is then registered in the component registry. When the application layer receives user request information from the user's dialog page, it obtains the interface description information from the server through the SDK module. The renderer in the SDK module constructs a target component tree based on this interface description information. For each component node in the target component tree, based on the component identifier in the component node, it queries the corresponding component description information from the component registry, renders the component using the retrieved description information, and finally obtains the rendered user interface, which is then displayed to the user.

[0108] In the embodiments of this application, a global component registry and a method of querying the component registry by component identifier are used to enable the same interface description information to use both client-built-in preset general components and dynamic components delivered from the server. The component implementation is bound to the component node in the target component tree at runtime (rather than at compile time), thus decoupling the protocol layer from the component implementation, allowing server-delivered components and built-in components to be used interchangeably. On the client side, the compilation and processing of component source code, the execution of component scripts in a pre-defined sandbox environment, and the configuration of a pre-defined whitelist within the sandbox environment can all be built into the SDK modules included in the client. The application layer included in the client only needs to call the pre-loaded interfaces provided by the SDK modules. This reduces the cost of application layer integration and centralizes potentially scattered remote code execution risks to a single entry point—the SDK module—effectively limiting the scope of potential security threats and improving the overall security of the client. By standardizing and defining external interfaces, ambiguity and differences in interface definitions are eliminated, enabling the server to centrally and standardizedly manage and maintain interaction logic, thereby improving system manageability and operational efficiency.

[0109] During the component registration process, components downloaded from the server are registered first, followed by the registration of pre-defined general components built into the client. For already registered component types, registration of built-in components with the same name can be skipped. Furthermore, the registration strategy for dynamically downloaded and built-in components can be adjusted for different stages such as development, testing, and service deployment. For example, during development, dynamically downloaded components can be registered first, followed by built-in components only if no such components are already registered. Alternatively, during testing, built-in components can be registered first, followed by downloaded components only if no such components are already registered. This approach caters to the needs of different stages, providing testing flexibility and service stability. In the embodiments of this application, runtime detection can be performed in the scene loader of the client, and the corresponding network request interface can be automatically matched based on the client's runtime environment, thereby enabling simultaneous support for clients with multiple different runtime environments and improving the practicality of the interface rendering method.

[0110] Before the client compiles the component's source code, string-level code fixes are performed on the source code to address known vulnerabilities. This shifts the cost of cross-platform or framework-specific issues from the client's application layer or server to the SDK module, reducing overall compatibility costs.

[0111] In some embodiments, the component identifier includes a component type name and a component version number. When a component in the component set corresponding to a scene identifier is updated while other components remain unchanged, after obtaining the component set, the client can first query the component registry based on the component identifiers of each component in the set. If the component registry already contains description information for the same component identifier, the compilation and execution of the source code of the component corresponding to that component identifier is skipped. Only for component identifiers not found in the component registry, or component identifiers containing the same component type name but different component version numbers, are the source code of the components corresponding to those component identifiers compiled, executed, and registered. This ensures that when a few components corresponding to a scene identifier are updated, the client only recompiles the changed components, while the remaining components are reused, significantly reducing the overhead of repeated compilation. Corresponding to the methods provided in the foregoing embodiments, this application also provides a user interface rendering method based on an intelligent agent, applied to the server side, see [link to relevant documentation]. Figure 6 The method includes: Step 201: The server receives the target scene identifier sent by the client and sends the component set corresponding to the target scene identifier to the client, so that the client can register each component bound to the target scene identifier into the component registry based on the component set; the component set includes the component code of each component.

[0112] Step 202: In response to the user request information sent by the client in the scenario corresponding to the target scenario identifier, the server sends the interface description information corresponding to the target scenario identifier to the client, so that the client can render the user interface corresponding to the target scenario identifier based on the interface description information and the component registry; the interface description information is used to declaratively define the layout structure and data mapping relationship of the interface.

[0113] The embodiments described herein only differ from the embodiments described above. Explanations of terms or descriptions of schemes that are the same as those in the embodiments described above can be referred to the embodiments described above, and will not be repeated here.

[0114] In this embodiment, the server sends a set of components to the client based on the target scenario identifier to dynamically update the component registry, and sends declaratively defined interface description information to drive the client to render the user interface in conjunction with the local component registry. This achieves decoupling of the interface layout structure and the underlying component logic and on-demand loading, enabling the client to flexibly adapt to the interface display requirements of different service scenarios without updating the installation package. This effectively reduces the client's code redundancy and installation package size, and significantly improves the efficiency and flexibility of interface iteration updates.

[0115] In some embodiments of this application, receiving a target scene identifier sent by a client and sending a set of components corresponding to the target scene identifier to the client includes: the server receiving the target scene identifier, querying the set of components corresponding to the target scene identifier from a pre-stored mapping relationship between scene identifiers and component sets; the target scene identifier is used to identify the interaction intent of the dialogue between the client and the intelligent agent; the interaction intent corresponds to the interactive interface to be rendered; and sending the queried set of components corresponding to the target scene identifier to the client.

[0116] The server pre-stores a mapping relationship between different scene identifiers and component sets. The component set corresponding to a scene identifier includes the component data of each component bound to that scene identifier, and the component data includes the component code of the component. After receiving the target scene identifier sent by the client, the server retrieves the matching component set from the mapping relationship based on the target scene identifier and sends it to the client.

[0117] In this embodiment, the server maintains the mapping relationship between scene identifiers and component sets, and distributes component sets as needed accordingly. This realizes centralized configuration management and dynamic association between service scenes and underlying component resources, enabling the server to flexibly control the component resources required by different scenes without requiring the client to hardcode or perform a full update. This effectively reduces the size of the client's installation package and resource redundancy, and significantly improves the distribution efficiency of component resources in multiple scenarios and the convenience of maintenance for subsequent service iterations.

[0118] In some embodiments of this application, the server also receives a component update request sent by the design end. The component update request includes a scene identifier to be updated and component data to be updated. The component data includes the component code of the component to be updated. The component code includes the source code or component script of the component to be updated. Based on the scene identifier to be updated, the component data to be updated is updated to the above mapping relationship.

[0119] The design end can be a client or terminal used to design components. After generating the component data of the component to be updated, the design end determines the scene identifier corresponding to the component to be updated and sends the component update request to the server. The component to be updated can be a newly designed component or a component obtained by modifying an existing component.

[0120] After receiving a component update request, the server determines the component set corresponding to the scene identifier of the component to be updated from the aforementioned mapping relationship. Then, based on the component identifier included in the component data to be updated, it queries whether the component data corresponding to the scene identifier already exists in the component set. If yes, the existing component data corresponding to the component identifier in the component set is replaced with the component data to be updated. If not, the component data to be updated is added to the component set corresponding to the scene identifier.

[0121] In this embodiment, the server receives a component update request containing component code and dynamically refreshes the mapping relationship between scene identifiers and component sets accordingly. This enables online hot updates of component resources and immediate version updates, allowing the server to flexibly replace or upgrade components in specific scenarios without relying on client releases or application reinstallation. This significantly improves the response speed of service iterations and the consistency of multi-terminal experiences.

[0122] In some embodiments of this application, when the component code includes source code, updating the component data to be updated in the mapping relationship based on the scene identifier to be updated includes: The server compiles the source code of the component to be updated using a preset compiler to obtain the component script of the component to be updated; it then replaces the source code of the component to be updated in the component data with the component script to obtain the target component data; based on the scene identifier to be updated, it determines the target component set corresponding to the scene identifier to be updated from the mapping relationship; based on the component identifier included in the target component data, it queries whether the historical component data corresponding to the component to be updated already exists in the target component set; if the historical component data already exists, it replaces the historical component data in the target component set with the target component data; if the historical component data does not exist in the target component set, it adds the target component data to the target component set.

[0123] In the mapping relationship between scene identifiers and component sets stored on the server, the component data includes component code, which can be the component's source code or the component's script. When the component code is source code, after the server sends the component set corresponding to the target scene identifier to the client, the client needs to compile the component's source code to obtain the component script, and then input the component script into a preset sandbox environment for execution, ultimately obtaining the component's description information. The specific processing procedure for the client can be referred to the relevant descriptions in the previous embodiments, and will not be repeated here.

[0124] In some embodiments, where the component code in the mapping relationship stored on the server is a component script, the design end can compile the component's source code to obtain the component script, and then include the component script in the aforementioned component update request. When the server receives the component update request to update the mapping relationship, it can store the component script of the component to be updated in the mapping relationship. Subsequently, when the server sends a component set to the client, the component code included in the component set will be the component script.

[0125] In other embodiments, the source code of the components to be updated is sent from the design end to the server. The server first compiles the source code to obtain the component script. Then, the server performs an update operation on the mapping relationship, thereby storing the component script of the component to be updated in the mapping relationship, so that the component code in the component set subsequently sent by the server to the client is the component script.

[0126] In this embodiment, the server compiles the source code of the component to be updated into a component script, and incrementally replaces or adds components in the mapping relationship accordingly. This realizes server-side preprocessing and standardized delivery of component runtime resources, reduces the high-performance compilation overhead and potential runtime parsing risks that the client has to bear due to directly receiving the source code, effectively reduces the client's computing resource consumption and interface loading latency, while ensuring the execution efficiency and cross-device compatibility of the distributed components, and significantly improves the response speed and user experience of component hot updates.

[0127] Corresponding to the methods provided in the foregoing embodiments, this application also provides an agent-based user interface rendering apparatus, applied to a client, see [link to relevant documentation]. Figure 7 The device includes: The acquisition module 301 is used to respond to the scene loading request and obtain the component set corresponding to the target scene identifier from the server. The component set includes the component code of each component bound to the target scene identifier. Registration module 302 is used to register each component to the component registry based on the component collection; The rendering module 303 is used to render the user interface corresponding to the target scene identifier based on the interface description information corresponding to the target scene identifier issued by the component registry and the server; the interface description information is used to declaratively define the layout structure and data mapping relationship of the interface.

[0128] The specific implementation details of each module of the device can be found in the specific operation details of the client in the method embodiment above, and will not be repeated here.

[0129] The agent-based user interface rendering apparatus and the agent-based user interface rendering method provided in the above embodiments of this application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the applications stored therein.

[0130] Corresponding to the methods provided in the foregoing embodiments, this application also provides an agent-based user interface rendering apparatus, applied to a server. See [link to relevant documentation]. Figure 8 The device includes: The receiving module 401 is used to receive the target scene identifier sent by the client; The sending module 402 is used to send the component set corresponding to the target scene identifier to the client, so that the client can register each component bound to the target scene identifier into the component registry based on the component set; the component set includes the component code of each component; The sending module 402 is also used to respond to the user request information sent by the client in the scene corresponding to the target scene identifier, and send the interface description information corresponding to the target scene identifier to the client, so that the client renders the user interface corresponding to the target scene identifier based on the interface description information and the component registry; the interface description information is used to declaratively define the layout structure and data mapping relationship of the interface.

[0131] The specific implementation details of each module of the device can be found in the specific operation details of the server in the method embodiment above, and will not be repeated here.

[0132] The agent-based user interface rendering apparatus and the agent-based user interface rendering method provided in the above embodiments of this application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the applications stored therein.

[0133] Corresponding to the methods provided in the foregoing embodiments, this application also provides an agent-based user interface rendering system, see [link to relevant documentation]. Figure 9 The system includes: client 501 and server 502; Client 501 responds to a scene loading request by sending a target scene identifier to server 502; sending user request information corresponding to the target scene identifier to server 502; receiving the component set corresponding to the target scene identifier returned by server 502, and receiving the interface description information corresponding to the user request information returned by server 502; the component set includes the component code of each component bound to the target scene identifier; the interface description information is used to declaratively define the layout structure and data mapping relationship of the interface; based on the component set, registering each component to the component registry; and rendering the user interface corresponding to the target scene identifier based on the component registry and the interface description information. The server-side 502 is used to receive the target scene identifier and user request information, and send the component set and interface description information to the client 501.

[0134] In some embodiments of this application, such as Figure 9 As shown, client 501 includes application layer 503 and SDK module 504; Application layer 503 is used to pass the target scene identifier and user request information to SDK module 504 by calling the preloading interface of SDK module 504; SDK module 504 is used to respond to the call of the preload interface, receive the target scene identifier and user request information, and send them to the server 502; receive the component set and interface description information returned by the server 502; register each component in the component registry based on the component set; and render the user interface corresponding to the target scene identifier based on the component registry and interface description information.

[0135] The interface definition code for a preloaded interface exposed as an example SDK module can be: exportasyncfunctionprefetchScene(sceneId:number):Promise <loadsceneresult>; Where prefetchScene() is the preloading function, sceneId:number is the scene identifier, and Promise is used. <loadsceneresult>This indicates that the return value of the interface definition code is an object containing the loading results. The application layer only needs to pass the scene identifier through the preloading interface to execute the above interface definition code to download the component collection corresponding to the scene identifier from the server.

[0136] In this embodiment, the complex processing logic, such as sending the target scene identifier and user request information, receiving the component set and registering the component, and rendering based on the interface description information and the component registry, is uniformly executed by the SDK module 504. This allows the application layer 503 to trigger scene loading simply by calling the preloading interface, thereby significantly reducing the access cost and code coupling of the application layer 503. It also achieves effective decoupling of service logic and underlying rendering capabilities, and significantly improves the development efficiency and system maintainability of the client 501.

[0137] The specific implementation details of the client and server in this embodiment can be found in the specific operation details of the client and server in the method embodiment described above, and will not be repeated here.

[0138] The agent-based user interface rendering system and the agent-based user interface rendering method provided in the above embodiments of this application are based on the same inventive concept and have the same beneficial effects as the methods used, run or implemented by the applications they store.

[0139] Figure 10 This is a block diagram of an electronic device used to implement embodiments of this application. For example... Figure 10 As shown, the electronic device includes a memory 601 and a processor 602. The memory 601 stores a computer program that can run on the processor 602. When the processor 602 executes the computer program, it implements the method described in the above embodiments. The number of memories 601 and processors 602 can be one or more. In a specific implementation, the electronic device may also include a communication interface 603 for communicating with external devices and exchanging data.

[0140] In practical implementation, if the memory 601, processor 602, and communication interface 603 are implemented independently, they can be interconnected via a bus to communicate with each other. This bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 10 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0141] Optionally, in a specific implementation, if the memory 601, processor 602 and communication interface 603 are integrated on a single chip, the memory 601, processor 602 and communication interface 603 can communicate with each other through an internal interface.

[0142] This application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method provided in this application.

[0143] This application provides a computer program product, including a computer program that, when executed by a processor, implements the method provided in this application.

[0144] This application also provides a chip including a processor for calling and executing instructions stored in a memory, causing a communication device equipped with the chip to perform the method provided in this application.

[0145] This application also provides a chip, including: an input interface, an output interface, a processor, and a memory. The input interface, output interface, processor, and memory are connected through an internal connection path. The processor is used to execute code in the memory. When the code is executed, the processor is used to execute the method provided in this application.

[0146] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. General-purpose processors can be microprocessors or any conventional processor. It is worth noting that the processor can be a processor supporting Advanced Reduced Instruction Set Machines (ARM) architecture.

[0147] Further, optionally, the aforementioned memory may include read-only memory and random access memory. The memory may be volatile memory or non-volatile memory, or may include both. Non-volatile memory may include read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available. Examples include Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Sync Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).

[0148] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another.

[0149] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.

[0150] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.

[0151] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process. Furthermore, the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functionality involved.

[0152] The logic and / or steps described in the flowchart or otherwise herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution client, apparatus, or device (such as a computer-based client, a processor-included client, or other client that can fetch and execute instructions from the instruction execution client, apparatus, or device), or in conjunction with such instruction execution client, apparatus, or device.

[0153] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution client. All or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware, the program being stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiments.

[0154] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. This storage medium can be a read-only memory, a disk, or an optical disk, etc.

[0155] The above are merely exemplary embodiments of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various variations or substitutions within the technical scope described in this application, and these should all 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.< / loadsceneresult> < / loadsceneresult>

Claims

1. A user interface rendering method based on intelligent agents, characterized in that, include: In response to a scene loading request, a set of components corresponding to a target scene identifier is obtained from the server. The set of components includes the component code of each component bound to the target scene identifier. Based on the aforementioned component set, each component is registered in the component registry. Based on the component registry and the interface description information corresponding to the target scene identifier issued by the server, the user interface corresponding to the target scene identifier is rendered; the interface description information is used to declaratively define the layout structure and data mapping relationship of the interface.

2. The method according to claim 1, characterized in that, The step of registering each component to the component registry based on the component set includes: The component code includes the source code of the component. The source code of the first component is compiled by a preset compiler to obtain the component script of the first component; or, the component code includes the component script of the component. The component script of the first component is obtained from the component set; the first component is any component in the component set. The component script of the first component is executed in a preset sandbox environment, and the execution result of the first component is output; the execution result includes a status flag, which is used to indicate whether the component script of the first component has been executed successfully; If the status indicator in the execution result indicates successful execution, the component description information of the first component included in the execution result is registered in the component registry; the component description information is used to characterize the running attributes or configuration parameters of the first component.

3. The method according to claim 2, characterized in that, The step of executing the component script of the first component in a preset sandbox environment includes: Obtain the pre-configured whitelist in the preset sandbox environment, the preset whitelist being used to specify the dependent program modules that are allowed to be loaded; During the execution of the component script of the first component in the preset sandbox environment, if the target program module requested by the component script is detected to be in the preset whitelist, then the target program module is loaded and executed. If the target program module is detected to be not in the preset whitelist, the loading of the target dependent program module is blocked, and an execution result indicating execution failure is output.

4. The method according to claim 2, characterized in that, Before compiling the source code of the first component using a preset compiler to obtain the component script of the first component, the method further includes: Based on preset code correction rules, the system detects whether there are target code segments to be corrected in the source code of the first component; the preset code correction rules are formulated to address differences in runtime environments and / or framework compatibility issues. If the target code fragment exists, replace the target code fragment in the source code of the first component with the corrected code fragment.

5. The method according to claim 2, characterized in that, Registering the component description information of the first component, including the execution result, into the component registry includes: Based on the component identifier included in the component description information, determine whether there is registered component description information corresponding to the component identifier in the component registry; If the registered component description information exists, then the registered component description information in the component registry is replaced with the component description information of the first component; If the registered component description information does not exist, the component description information of the first component is added to the component registry.

6. The method according to claim 1, characterized in that, The step of responding to a scene loading request by obtaining the set of components corresponding to the target scene identifier from the server includes: In response to entering the dialogue page, the scene loading request is triggered, and the target scene identifier corresponding to the dialogue page is obtained; the target scene identifier is used to identify the interaction intent of the dialogue between the client and the intelligent agent; the interaction intent corresponds to the interactive interface to be rendered. Send the target scene identifier to the server; Receive the set of components corresponding to the target scene identifier returned by the server.

7. The method according to claim 6, characterized in that, Sending the target scene identifier to the server includes: Detect the type of the client's current runtime environment; Based on the type of the operating environment, select the network request interface that matches the operating environment; The target scene identifier is sent to the server using the network request interface.

8. A user interface rendering method based on intelligent agents, characterized in that, include: The system receives a target scene identifier sent by a client and sends a set of components corresponding to the target scene identifier to the client, so that the client registers each component bound to the target scene identifier in the component registry based on the component set; the component set includes the component code of each component. In response to a user request sent by the client in the scenario corresponding to the target scenario identifier, interface description information corresponding to the target scenario identifier is sent to the client, so that the client renders the user interface corresponding to the target scenario identifier based on the interface description information and the component registry; the interface description information is used to declaratively define the layout structure and data mapping relationship of the interface.

9. The method according to claim 8, characterized in that, The receiving client sends a target scene identifier, and the receiving client sends a set of components corresponding to the target scene identifier to the client, including: The system receives the target scene identifier and, based on the target scene identifier, queries the component set corresponding to the target scene identifier from the pre-stored mapping relationship between scene identifiers and component sets. The target scene identifier is used to identify the interaction intent of the dialogue between the client and the intelligent agent. The interaction intent corresponds to the interactive interface to be rendered. The set of components corresponding to the target scene identifier obtained from the query is sent to the client.

10. A user interface rendering system based on intelligent agents, characterized in that, Including both client and server sides; The client is configured to respond to a scene loading request by sending a target scene identifier to the server; sending user request information corresponding to the target scene identifier to the server; receiving a component set corresponding to the target scene identifier returned by the server, and receiving interface description information corresponding to the user request information returned by the server; the component set includes the component code of each component bound to the target scene identifier; the interface description information is used to declaratively define the layout structure and data mapping relationship of the interface; and registering each component to a component registry based on the component set. Based on the component registry and the interface description information, render the user interface corresponding to the target scene identifier; The server is used to receive the target scene identifier and the user request information, and send the component set and the interface description information to the client.