H5 Card Generation and Update Method, System, and Electronic Device Based on Dual-Agent Architecture
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-26
- Publication Date
- 2026-08-14
AI Technical Summary
上述方案中,卡片生成与数据刷新通常由同一模块或同一流程完成,AI推理和H5结构生成等复杂计算与高频数据刷新相互抢占资源,导致界面卡顿和数据延迟
[0053]本发明提出一种基于双Agent架构的H5卡片生成更新方法、系统及电子设备,通过卡片生成Agent与数据更新Agent的职责分离,将耗时的AI 生成、代码构建等慢逻辑与高频数据刷新的快逻辑彻底解耦,避免单一进程内的资源抢占。数据更新Agent可独立运行响应刷新请求,无需等待H5结构生成,使车机界面数据更新延迟从秒级降至毫秒级,实现卡片热加载与无感刷新,显著提升驾驶场景下的交互流畅度。
Smart Images

Figure CN122569798A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of human-computer interaction technology in smart cockpits, specifically to an H5 card generation and update method, system, and electronic device based on a dual-Agent architecture. Background Technology
[0002] With the rapid development of vehicle-to-everything (V2X) technology, the dynamic information that in-vehicle infotainment systems need to display to users is becoming increasingly complex, including various types of information such as traffic conditions, range information, and entertainment information. To facilitate users' quick access to key information, in-vehicle infotainment screens often feature persistent front-end interface elements such as card widgets. Cards, as a quick way to display information, allow users to quickly understand the key information of applications or services.
[0003] Existing technologies for generating and updating H5 cards for in-vehicle infotainment systems mainly include the following types of technical solutions:
[0004] Solution 1: Intelligent Agent Card Generation Technology (Publication No. CN121480467A). This solution obtains the card template of the target service configured by the management platform, receives user intent data, inputs the user intent data into a pre-trained intent recognition model to output intent recognition results, determines the target card template based on the intent recognition results, obtains configuration data, and updates the target card template with the configuration data to generate an intelligent agent card. The core of this solution lies in "intent recognition plus template filling," which solves the automation problem of card generation, but it does not address the continuous data update mechanism for the generated card and is not optimized for the resource-constrained environment of the vehicle system.
[0005] Option 2: AI-generated H5 page technology (Publication No. CN117075900A). This option uses AI to extract requirement keywords, match them with parameters from a scenario library to generate the page structure, and then renders the H5 page. Its focus is on the one-time generation process of "requirement-scenario-page," lacking consideration for how to achieve high-frequency, low-latency data refresh on the in-vehicle infotainment system after page generation.
[0006] Option 3: Vehicle-mounted infotainment system card refresh technology (Publication No. CN121501311A). This solution uses a signal parsing module to acquire various vehicle body signals generated on the CAN bus. A signal classifier queries a pre-established card mapping relationship based on the vehicle body signals to obtain the corresponding signal types. Based on the signal type classification, the vehicle body signals are registered to the corresponding card refresh channels. A target refresh mechanism processes the vehicle body signals and generates rendering instructions, which are then executed by the desktop rendering module to refresh the target card screen. This solution solves the performance problem of vehicle-mounted system signal refresh, but the refresh logic is strongly coupled with the card generation logic, and it does not introduce an intelligent agent for content orchestration, resulting in relatively fixed card content that cannot be dynamically reconstructed according to user intent.
[0007] Option 4: H5 Page Data Retrieval and Update (Publication No. CN115080894A). This option intercepts the Uniform Resource Locator (URL) when a user accesses an H5 page using a packet capture tool, queries the H5 page identifier, and sends the identifier to the server via a socket interface. It then receives the updated data from the server and uses a network view control to bridge the updated data to the H5 page using a data bridging method. Essentially, it involves "data bridging plus view updating," but it doesn't separate the card structure generation and real-time data stream updates into two independent processes. In complex in-vehicle infotainment systems, this can easily lead to interface lag and data asynchrony.
[0008] In summary, the existing technology has the following shortcomings:
[0009] First, the generation logic and update logic are coupled. In the above scheme, card generation and data refresh are usually completed by the same module or the same process. Complex calculations such as AI inference and H5 structure generation compete for resources with high-frequency data refresh, resulting in interface lag and data delay.
[0010] Second, the real-time update efficiency of in-vehicle infotainment systems is insufficient due to limited computing power. In-vehicle infotainment platforms have limited computing resources, and existing solutions often require re-rendering the entire page or reloading the WebView when updating H5 cards, resulting in high CPU and memory consumption, making it difficult to meet the low latency and high reliability requirements of in-vehicle infotainment systems.
[0011] Third, the card content lacks dynamic intent adaptation. Most existing in-vehicle infotainment cards are statically configured and cannot dynamically adjust the layout and content of the cards according to the user's real-time intent (such as voice commands or changes in driving scenarios).
[0012] Therefore, existing technologies lack a solution specifically designed for in-vehicle platforms that architecturally separates AI-driven intelligent generation of H5 cards from high-frequency real-time data stream updates. Summary of the Invention
[0013] To meet the above requirements, this invention provides an H5 card generation and update method, system, and electronic device based on a dual-Agent architecture. Through architecture-level separation of responsibilities, lightweight data channels, and local rendering mechanisms, it can simultaneously achieve intelligent dynamic generation of H5 cards and millisecond-level efficient data updates in an environment with limited vehicle resources, balancing interactive intelligence and operational performance.
[0014] To achieve the above objectives, the present invention adopts the following technical solution:
[0015] In a first aspect, the present invention provides an H5 card generation and update method based on a dual-Agent architecture, the method comprising:
[0016] In response to a user-triggered card generation request, a card generation instruction is sent to the card generation Agent;
[0017] The system receives the access link and initial data returned by the card generation agent, wherein the initial data is injected into the data channel variable by the card generation agent; it loads the H5 card code through the access link and reads the initial data from the data channel variable for initial rendering;
[0018] In response to a user-triggered data refresh operation, a data refresh request is sent to the data update agent;
[0019] The data update agent receives the structured data generated by the data refresh request, updates the stored content in the data channel variable, and re-renders the H5 card based on the updated stored content in the data channel variable.
[0020] Optionally, sending the card generation instruction to the card generation Agent includes:
[0021] The card generation request is parsed to determine the card type and content requirements;
[0022] The card type and the content requirements are encapsulated into the card generation instructions;
[0023] The card generation instruction is sent to the card generation Agent.
[0024] Optionally, receiving the access link and initial data returned by the card-generated Agent includes:
[0025] The system receives the access link generated by the card generation agent, wherein the card generation agent generates a card design scheme containing layout information, style information and data structure information according to the card generation instruction, calls the data source service to obtain the initial data, generates the H5 card code according to the card design scheme and the initial data, and deploys the H5 card code to the storage service to generate the access link;
[0026] Receive the initial data from the card-generated Agent injected into the data channel variable.
[0027] Optionally, when the card generation Agent injects the initial data into the data channel variable, it serializes the initial data according to the data structure information and assigns the serialized data to the data channel variable mounted on the global object.
[0028] Optionally, sending a data refresh request to the data update Agent in response to a user-triggered data refresh operation includes:
[0029] Get the time interval between the current time and the time of the last data refresh operation;
[0030] Determine whether the time interval is less than a preset time threshold;
[0031] If the time interval is less than the time threshold, then the data refresh operation is ignored;
[0032] If the time interval is not less than the time threshold, then the data refresh request is sent to the data update Agent.
[0033] Optionally, sending the data refresh request to the data update Agent includes:
[0034] Generate a timestamp containing the current time information;
[0035] Add the timestamp to the data refresh request;
[0036] The data refresh request with the timestamp added is sent to the data update Agent.
[0037] Optionally, the data update agent generates structured data based on the data refresh request, including:
[0038] Parse the data refresh request to extract search keywords and data format requirements;
[0039] Add the current date information to the search keywords to generate enhanced search keywords;
[0040] Use the enhanced search keywords to invoke the data source service to obtain the real-time data;
[0041] The real-time data is filtered for timeliness to remove data that does not meet the timeliness requirements;
[0042] The filtered data is assembled into the structured data according to the data format requirements.
[0043] Optionally, re-rendering the H5 card based on the stored content in the updated data channel variables includes:
[0044] Read the stored content from the updated data channel variable;
[0045] Based on the stored content, the rendering method is invoked to partially update the document object model of the H5 card without reloading the H5 card code.
[0046] Secondly, the present invention provides an H5 card generation and update system based on a dual-Agent architecture, comprising:
[0047] The response generation module is used to respond to a card generation request triggered by a user and send a card generation instruction to the card generation Agent.
[0048] The rendering module is used to receive the access link and initial data returned by the card generation agent, wherein the initial data is injected into the data channel variable by the card generation agent; load the H5 card code through the access link, and read the initial data in the data channel variable for initial rendering;
[0049] The refresh request module is used to respond to user-triggered data refresh operations by sending a data refresh request to the data update agent.
[0050] The data update module is used to receive structured data generated by the data update agent according to the data refresh request, update the stored content in the data channel variable, and re-render the H5 card based on the updated stored content in the data channel variable.
[0051] A third aspect of the present invention provides an electronic device including a memory and a processor, wherein the memory stores a computer program that, when executed by the processor, causes the processor to perform the steps of the method as described in any one of the first aspects.
[0052] Compared with the prior art, the present invention has the following beneficial effects:
[0053] This invention proposes an H5 card generation and update method, system, and electronic device based on a dual-Agent architecture. By separating the responsibilities of the card generation agent and the data update agent, the slow logic such as time-consuming AI generation and code building is completely decoupled from the fast logic of high-frequency data refresh, avoiding resource contention within a single process. The data update agent can run independently to respond to refresh requests without waiting for H5 structure generation, reducing the data update latency of the vehicle interface from seconds to milliseconds, achieving hot card loading and seamless refresh, and significantly improving the smoothness of interaction in driving scenarios.
[0054] Lightweight data transmission is achieved through data channel variables. The data update process only transmits structured JSON data, eliminating the need to reload the complete H5 card code. Combined with the document object model's partial update mechanism, the entire WebView does not need to be re-rendered. This solution reduces the vehicle's CPU usage and ensures more stable memory usage, effectively preventing stuttering and overheating issues caused by H5 card updates during core vehicle services such as navigation and music operation.
[0055] This invention employs date-enhanced keyword search and a multi-layered timeliness filtering mechanism to strictly ensure that updated data is the latest information of the day, preventing outdated data from being displayed. A de-jitter refresh control mechanism limits the minimum refresh interval, avoiding frequent requests that increase system load, thus improving the stability of the vehicle system while ensuring data freshness. The card generation logic and data update logic are independent of each other. Front-end developers only need to focus on H5 static template development; the data logic is uniformly managed by the data update agent, significantly reducing the coupling between the UI layer and the data layer. This facilitates iterative upgrades and bug fixes for card functionality, effectively shortening the development cycle. Attached Figure Description
[0056] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn to scale.
[0057] Figure 1 A flowchart of an H5 card generation and update method based on a dual-Agent architecture is provided in this embodiment of the invention;
[0058] Figure 2 A schematic diagram of the overall architecture of the H5 card generation and update system based on a dual-Agent architecture provided in an embodiment of the present invention;
[0059] Figure 3 A schematic diagram of the structure of an H5 card generation and update system based on a dual-Agent architecture provided in an embodiment of the present invention;
[0060] Figure 4 This is an internal structure diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0061] The embodiments of the technical solution of the present invention will now be described in detail with reference to the accompanying drawings. These embodiments are only used to more clearly illustrate the technical solution of the present invention and are therefore merely examples, and should not be construed as limiting the scope of protection of the present invention.
[0062] It should be noted that, unless otherwise stated, the technical or scientific terms used in this application should have the ordinary meaning as understood by one of ordinary skill in the art to which this invention pertains.
[0063] This invention provides a method, system, and electronic device for generating and updating H5 cards based on a dual-Agent architecture; it can be applied to H5 interaction scenarios on in-vehicle infotainment platforms, enabling intelligent generation of H5 cards and efficient real-time data refresh. The embodiments of this invention are described below with reference to the accompanying drawings.
[0064] The dual-Agent architecture adopted in this invention refers to splitting the complete lifecycle of an H5 card into two independent links: "structure generation" and "data update". These links are respectively handled by a dedicated card generation Agent and a data update Agent. The two agents work together through a standardized data protocol and can be deployed and run independently.
[0065] I. System Architecture
[0066] like Figure 2 As shown, the system of the present invention is divided into three layers: vehicle front-end, back-end service layer and data source layer.
[0067] The vehicle infotainment front end is deployed in the vehicle infotainment system's H5 container (such as WebView) and contains two core modules: an H5 card rendering engine and a data refresh controller.
[0068] H5 Card Rendering Engine: Built-in data channel variables, which are structured variables mounted on the front-end global window object (specifically implemented as window.loadData), used to persistently store all the data required for card display; The rendering engine provides the UILayer.render() rendering method, which can perform rendering updates only on the card content area based on the content of the data channel variables, without changing the page layout framework.
[0069] Data refresh controller: It has built-in anti-jitter control logic and a preset time threshold (10 seconds by default, which can be adjusted according to the vehicle's performance configuration) to control the trigger frequency of data refresh; it is also responsible for generating request timestamps, assembling request parameters, and sending data refresh requests to the backend.
[0070] Communication method: The vehicle's front-end communicates with the back-end service layer via HTTP POST requests. The target interface for data refresh requests is / api / data_updated_agent, and both the request and response bodies use lightweight JSON format.
[0071] The backend service layer, deployed in the cloud or in-vehicle system backend service, contains two independent Agent modules.
[0072] Card Generation Agent: Responsible for the entire process of generating H5 cards, including requirements analysis, card design output, initial data acquisition, H5 code generation, storage deployment, and output of complete H5 card access links and initial data. It is a heavy logic module with a long execution chain.
[0073] Data Update Agent: A lightweight, stateless service module that is only responsible for data refresh-related logic, including request parameter parsing, data source invocation, data filtering and structured assembly, and outputting JSON results in pure data format without any H5 code logic.
[0074] The two agents collaborate through a standardized data structure protocol, with no strong dependency on each other, and can be scaled up or down independently.
[0075] The data source layer provides data support for the backend agents and can be expanded according to business needs, including but not limited to: MCP network search service, local database, vehicle sensor / CAN bus interface, third-party service APIs (weather, stocks, news, etc.), caching system, and user behavior database. Among them, the MCP network search service provides network search capabilities, can obtain real-time Internet information and return structured data, and supports filtering results by date.
[0076] Example 1: This example provides a method for generating and updating H5 cards based on a dual-Agent architecture. The overall process of this method can be found in [reference needed]. Figure 1 Specifically, it includes the following steps:
[0077] S101 responds to a user-triggered card generation request by sending a card generation instruction to the card generation Agent;
[0078] S102 receives the access link and initial data returned by the card generation agent, wherein the initial data is injected into the data channel variable by the card generation agent; loads the H5 card code through the access link, and reads the initial data in the data channel variable for initial rendering;
[0079] S103 responds to a user-triggered data refresh operation by sending a data refresh request to the data update Agent;
[0080] S104 receives the structured data generated by the data update Agent according to the data refresh request, updates the stored content in the data channel variable, and re-renders the H5 card based on the updated stored content in the data channel variable.
[0081] In step S101, users can initiate card generation requests on the vehicle's infotainment system via voice commands, touch clicks, or automatic scene triggering. After receiving the request, the vehicle's front-end performs semantic parsing on the request content to determine the corresponding card type (such as news, weather, stock, vehicle status, etc.) and content requirements (such as the number of items to display, data fields, and display style preferences). The card type and content requirements are then encapsulated into standardized card generation instructions and sent to the backend card generation agent.
[0082] In step S102, after receiving the card generation instruction, the card generation Agent performs the following operations in sequence:
[0083] Generate card design scheme: Based on the card type and content requirements, output a complete card design document. The document includes layout information (module arrangement, area division), style information (visual style, font, color scheme) and data structure information (field names, data types, and format specifications of the required data).
[0084] Obtain initial data: Call the corresponding data source service to retrieve matching initial data based on the card content requirements. For example, news cards call the MCP online search service, weather cards call a third-party weather API, and vehicle status cards call the vehicle's CAN bus interface.
[0085] Generate H5 card code: Based on the layout and style specifications of the card design scheme, combined with the initial data, generate complete and runnable H5 card front-end code. The code predefines the mounting location and data structure specifications of data channel variables.
[0086] Deploy and generate access links: Deploy the generated H5 card code to a storage service (such as Object Storage Service OBS) to generate a directly accessible URL address, i.e., an access link.
[0087] Initial data injection: According to the data structure information in the card design scheme, the initial data is serialized into JSON. The serialized data is then assigned to the data channel variable mounted on the global window object, so that the front end can directly read the variable to complete the initial rendering when loading the page without initiating an additional data request.
[0088] Step S102, loading the H5 card and completing the initial rendering of the vehicle's infotainment system includes: the vehicle's infotainment system receives the access link returned by the Agent generated by the card, accesses the link through the H5 container, and loads the corresponding H5 card code; during the page loading process, the initial data in the data channel variable on the global object is directly read, and the UILayer.render() method of the rendering engine is called to complete the initial rendering and display of the H5 card.
[0089] Step S104, updating the stored content in the data channel variable includes:
[0090] Step S401: Respond to the data refresh operation, perform anti-shake verification, and then send a data refresh request. The data refresh operation can be manually triggered by the user clicking the card refresh button, or it can be automatically triggered by the system at regular intervals or scene changes. After receiving the refresh trigger signal, the data refresh controller at the front end of the vehicle's infotainment system first executes the anti-shake control logic:
[0091] Get the current system time and the time of the last successful data refresh operation, and calculate the time interval between the two;
[0092] Compare the time interval with a preset time threshold;
[0093] If the time interval is less than the time threshold, it is judged as frequent refresh, and the refresh operation is ignored to avoid repeated requests that increase the system load.
[0094] If the time interval is greater than or equal to the time threshold, a timestamp containing the current time information is generated. The timestamp, search keywords, and data format requirements are then encapsulated into a data refresh request and sent to the corresponding interface of the backend data update agent via an HTTP POST request.
[0095] Step S402: The data update agent processes the request, generates structured data, and returns it.
[0096] After receiving the data refresh request, the data update agent executes the following processing flow:
[0097] Request parsing: Parse the parameters of the data refresh request, extract search keywords and data format requirements, verify the validity of the request, and initialize a temporary session instance.
[0098] Keyword enhancement: By concatenating the current date information (in the format YYYY year MM month DD day) into the original search keywords, enhanced search keywords are generated, guiding the data source to return the latest data that is biased towards the current day.
[0099] Data source invocation: Use the enhanced search keywords to invoke the corresponding data source service to obtain real-time data.
[0100] Timeliness filtering: Perform multi-layer timeliness verification on the acquired real-time data, verify the release / generation date of each data item, retain only the valid data of the current day, and remove all expired old data to ensure the timeliness of the output data.
[0101] Data assembly: According to the data format requirements in the request, the filtered valid data is processed by extracting fields, formatting and sorting, and assembling into structured JSON data that conforms to the specifications. The data includes fields such as status identifiers, input parameters, and output datasets.
[0102] Response return and resource cleanup: The assembled structured data is returned to the vehicle front end via an HTTP response; after the session is completed, the session instance is automatically destroyed and running resources are cleaned up. The service itself is stateless and does not require persistent storage.
[0103] Step S403: The front-end updates the data channel variables and completes partial card re-rendering. After receiving the structured data returned by the data update agent, the vehicle's front-end performs the following operations:
[0104] Write the received structured data completely into the data channel variable, replacing the original stored content in the variable;
[0105] Call the UILayer.render() rendering method of the rendering engine, read the updated data channel variables, and perform a partial update on the document object model (DOM) of the H5 card. Only the display area corresponding to the data is modified, without reloading the entire H5 card code or rebuilding the WebView instance.
[0106] After the refresh is complete, update the loading status of the refresh button on the front end and notify the user that the data update is complete.
[0107] Example 2: News and Information Cards
[0108] This embodiment 2 is applied to a scenario where a user obtains the day's news information while waiting in their car.
[0109] Card Generation: The user issues a voice command to "generate a news card." The vehicle's front-end parses the command and determines the card type as news, requiring 5-8 key news items of the day. This is then encapsulated as a card generation command and sent to the card generation agent. The card generation agent generates a list-style layout for the news cards, calling the MCP online search service to retrieve the day's news data as initial data. It then generates H5 card code and deploys it to OBS storage. Simultaneously, it serializes the initial news data and injects it into the `window.loadData` data channel variable. The front-end loads the cards via a link, reads the initial data, and renders the news list.
[0110] Data Update: When a user clicks the refresh button, the data refresh controller verifies that the interval since the last refresh is greater than 10 seconds, generates a refresh request with a timestamp, uses the keyword "latest news," and requires 5 articles in the format of "title + publication time + summary," and sends it to the data update agent. The data update agent adds the current date to the keyword, calls the MCP search to retrieve real-time news, filters the content published that day, and assembles it into JSON according to the specified format before returning it. The frontend updates the `window.loadData` variable, calls the rendering method to partially refresh the news list DOM, and completes the update.
[0111] In this embodiment, the data update response time is 0.5-1 second, which is 80% more efficient than the traditional full-page refresh solution, with low CPU usage, and is suitable for in-vehicle embedded environments.
[0112] Example 3: Weather Information Cards
[0113] This embodiment 3 is applied to a scenario where a user checks the real-time weather while driving.
[0114] Card Generation: The user issues a voice command, "What's the weather like today?" The card generation agent generates a weather card design, defining fields such as temperature, air quality, and clothing suggestions. It calls a third-party weather API to obtain the current day's weather data for the current location as initial data, generates and deploys an H5 card, and injects the initial data into the data channel variables. The front-end loads and renders the weather card.
[0115] Data Updates: The system is set to automatically refresh the weather every day at midnight. After the anti-shake controller verifies that the interval meets the requirements, it sends a request to the data update agent. The data update agent calls the weather API to obtain the latest data, filters the valid data for the day, and returns it. The front end automatically updates the card content. When the vehicle travels across regions, the change in location triggers a refresh request. The data update agent obtains the weather for the corresponding region based on the new location and quickly switches the displayed content.
[0116] Example 4: Stock Quote Cards
[0117] This embodiment is applied to a scenario where a user views the stock quotes of their watchlist while the car is parked.
[0118] Card Generation: When a user issues the command "View my watchlist", the card generation agent generates a stock quote card design, defines data fields such as stock name, current price, and percentage change, calls the stock data API to obtain real-time quotes for the user's watchlist as initial data, generates and deploys an H5 card, and injects the initial data.
[0119] Data Update: The system triggers a refresh every 30 seconds. The anti-jitter controller sends a request after verifying the interval compliance. The data update agent calls the stock API to obtain the latest stock price, assembles it into lightweight JSON data, and returns it. The front-end updates data channel variables, partially refreshing the stock price and percentage change areas without reloading the page, resulting in low bandwidth consumption and support for high-frequency refreshes.
[0120] Example 5: Car Assistant Cards
[0121] This embodiment 5 is applied to a scenario where users view the real-time status of their vehicle and maintenance recommendations.
[0122] Card Generation: When a user issues the command "Check vehicle status", the card generation agent generates a car assistant card design scheme, defines data structures such as fuel consumption, mileage, tire pressure, and maintenance suggestions, calls the vehicle's CAN bus interface and user behavior database to obtain real-time vehicle data and personalized suggestions as initial data, and generates and deploys H5 cards.
[0123] Data Update: The system refreshes every 5 minutes while the vehicle is in motion. The data update agent retrieves the latest fuel consumption, range, and tire pressure data from the vehicle's infotainment system, assembles them, and returns them to the front end. The front end updates the data channel variables and performs partial rendering to synchronize the vehicle status in real time. If abnormal data such as low tire pressure is detected, the vehicle's infotainment system can be triggered to issue a warning.
[0124] Example 6: In one embodiment, Example 6 of the present invention provides an H5 card generation and update system based on a dual-Agent architecture, the system as follows: Figure 3 As shown, it includes: a response generation module 210, a rendering module 220, a refresh request module 230, and a data update module 240, wherein:
[0125] The response generation module 210 is used to send a card generation instruction to the card generation Agent in response to a card generation request triggered by the user.
[0126] The rendering module 220 is used to receive the access link and initial data returned by the card generation agent, wherein the initial data is injected into the data channel variable by the card generation agent; load the H5 card code through the access link, and read the initial data in the data channel variable for initial rendering;
[0127] The refresh request module 230 is used to send a data refresh request to the data update Agent in response to a data refresh operation triggered by the user.
[0128] The data update module 240 is used to receive the structured data generated by the data update agent according to the data refresh request, update the stored content in the data channel variable, and re-render the H5 card based on the updated stored content in the data channel variable.
[0129] Example 7: Example 7 of the present invention also provides an electronic device; the electronic device may be a terminal, and its internal structure diagram may be as follows. Figure 4As shown. The electronic device includes a processor, memory, communication interface, display screen, and input device connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements the H5 card generation and update method based on a dual-Agent architecture as described in any one of steps S101 to S104. The display screen can be a liquid crystal display or an e-ink display. The input device can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the device's casing, or an external keyboard, touchpad, or mouse.
[0130] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0131] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0132] This application is described with reference to flowchart illustrations and / or block diagrams of methods, electronic devices (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0133] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0134] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0135] The above are merely embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of the claims of the present invention pending approval.
Claims
1. A method for generating and updating H5 cards based on a dual-Agent architecture, characterized in that, include: In response to a user-triggered card generation request, a card generation instruction is sent to the card generation Agent; Receive the access link and initial data returned by the card-generating agent, wherein the initial data is injected into the data channel variable by the card-generating agent; The H5 card code is loaded through the access link, and the initial data in the data channel variable is read for initial rendering; In response to a user-triggered data refresh operation, a data refresh request is sent to the data update agent; The data update agent receives the structured data generated by the data refresh request, updates the stored content in the data channel variable, and re-renders the H5 card based on the updated stored content in the data channel variable.
2. The method according to claim 1, characterized in that, Sending the card generation instruction to the card generation Agent includes: The card generation request is parsed to determine the card type and content requirements; The card type and the content requirements are encapsulated into the card generation instructions; The card generation instruction is sent to the card generation Agent.
3. The method according to claim 1, characterized in that, The process of receiving the access link and initial data returned by the card-generated Agent includes: The system receives the access link generated by the card generation agent; wherein, the card generation agent generates a card design scheme containing layout information, style information, and data structure information according to the card generation instruction. The initial data is obtained by calling the data source service, the H5 card code is generated according to the card design scheme and the initial data, and the H5 card code is deployed to the storage service to generate the access link; Receive the initial data from the card-generated Agent injected into the data channel variable.
4. The method according to claim 3, characterized in that, When the card generation Agent injects the initial data into the data channel variable, it serializes the initial data according to the data structure information and assigns the serialized data to the data channel variable mounted on the global object.
5. The method according to claim 1, characterized in that, The step of sending a data refresh request to the data update Agent in response to a user-triggered data refresh operation includes: Get the time interval between the current time and the time of the last data refresh operation; Determine whether the time interval is less than a preset time threshold; If the time interval is less than the time threshold, then the data refresh operation is ignored; If the time interval is not less than the time threshold, then the data refresh request is sent to the data update Agent.
6. The method according to claim 1, characterized in that, Sending the data refresh request to the data update Agent includes: Generate a timestamp containing the current time information; Add the timestamp to the data refresh request; The data refresh request with the timestamp added is sent to the data update Agent.
7. The method according to claim 1, characterized in that, The data update agent generates structured data based on the data refresh request, including: Parse the data refresh request to extract search keywords and data format requirements; Add the current date information to the search keywords to generate enhanced search keywords; Use the enhanced search keywords to invoke the data source service to obtain the real-time data; The real-time data is filtered for timeliness to remove data that does not meet the timeliness requirements; The filtered data is assembled into the structured data according to the data format requirements.
8. The method according to claim 1, characterized in that, The step of re-rendering the H5 card based on the stored content in the updated data channel variables includes: Read the stored content from the updated data channel variable; Based on the stored content, the rendering method is invoked to partially update the document object model of the H5 card without reloading the H5 card code.
9. An H5 card generation and update system based on a dual-Agent architecture, characterized in that, include: The response generation module is used to respond to a card generation request triggered by a user and send a card generation instruction to the card generation Agent. The rendering module is used to receive the access link and initial data returned by the card generation agent, wherein the initial data is injected into the data channel variable by the card generation agent; The H5 card code is loaded through the access link, and the initial data in the data channel variable is read for initial rendering; The refresh request module is used to respond to user-triggered data refresh operations by sending a data refresh request to the data update agent. The data update module is used to receive structured data generated by the data update agent according to the data refresh request, update the stored content in the data channel variable, and re-render the H5 card based on the updated stored content in the data channel variable.
10. An electronic device, comprising a memory and a processor, characterized in that, The memory stores a computer program that, when executed by the processor, causes the processor to perform the steps of the method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Data calling and updating method and device for H5 page, equipment and storage medium
CN115080894A
Method and system for generating h5 page content based on AI
CN117075900A
Intelligent agent card generation method and device, electronic equipment and storage medium
CN121480467A
Desktop card refreshing method, device and equipment for vehicle machine and medium
CN121501311A