H5 service long-acting touch method and system based on enterprise WeChat plug-in
By instantiating a dedicated conversation entry point and building a two-way interactive closed loop in WeChat Work, the problem of context loss caused by the temporary nature of H5 business entry points is solved, achieving the continuity of business flow and efficient and reliable message delivery, thus meeting the management needs of enterprise-level applications.
Patent Information
- Application Number
- CN202610311510.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-15
- Publication Date
- 2026-04-28
AI Technical Summary
In existing technologies, the temporary nature of the entry point for WeChat H5 business instances leads to context loss and difficulty in follow-up visits, lacking long-term reach and follow-up capabilities. Existing solutions cannot establish persistent and dedicated notification and follow-up entry points in the WeChat environment.
By using a business instance channelization mechanism, user confirmation intent is captured, precise timing linkage is executed, and a dedicated conversation entry is instantiated in WeChat using the WeChat application message interface. Through rich media messages, a two-way interactive closed loop between H5 pages and WeChat conversations is achieved, ensuring the continuity of business flow.
It has achieved long-term sustainability and traceability of H5 business entry points, built a seamless business context continuity capability, improved processing efficiency and experience continuity, and provided reliable delivery and management control capabilities for high-priority messages.
Smart Images

Figure CN121940370A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of mobile internet communication and message push technology, specifically to a method and system for establishing a long-term, traceable message delivery channel for embedded H5 services of self-built applications within the WeChat environment, based on the WeChat Enterprise Open Platform. Background Technology
[0002] In the technical architecture of WeChat Work, business systems provide H5 page services to users by creating self-built WeChat Work applications. Users can use the application directly within the WeChat Work app. Simultaneously, users can also follow the WeChat Work plugin associated with this self-built application in their WeChat client (i.e., their personal WeChat account), thereby receiving messages from the application within their regular WeChat account.
[0003] However, existing technical solutions suffer from a long-standing core flaw: the entry point for H5 business instances is temporary, lacking long-term reach and follow-up capabilities. When a user (especially in the WeChat client) enters a specific H5 business page (such as handling an alarm or approving an order) via a link or message, the page session is temporary. Once the page is closed, the interaction context of this specific business instance is lost. The system cannot establish a persistent, dedicated notification and follow-up entry point for this business instance within the user's WeChat. If the user needs to follow up again, they can only painstakingly search through a vast amount of historical messages, resulting in a long and inefficient operation path and causing business continuity interruptions.
[0004] To address this pain point, conventional solutions in this field have always been limited to three types of approaches: First, guiding users to bookmark H5 page links, which relies entirely on users actively searching for them and is easily lost; second, sending notifications with page links via WeChat template messages and official account messages, which is not only strictly limited by the number of times they can be sent and the timeliness of the push, but also lacks a fixed, permanent entry point, making the messages easily buried in historical conversations; third, adding a menu of historical business records within the WeChat Work application, which requires users to navigate through layers of navigation, resulting in a lengthy operation path.
[0005] Existing solutions utilizing WeChat Work application messages are all general push notifications passively initiated by the backend based on business events. They can only append messages to existing fixed application sessions and cannot generate a unique, user-confirmed session entry for a single temporary H5 business that the user is currently handling. Therefore, they cannot fundamentally solve the core industry pain point of "loss of business entry and context breakage after the temporary H5 page is closed". Summary of the Invention
[0006] The primary technical problem this invention aims to solve is: how to establish a long-term, precisely associated exclusive message channel within a user's WeChat environment for a specific, temporary H5 business interaction instance, in order to address the issues of context loss and difficulty in follow-up due to the temporary nature of the business entry point.
[0007] To address the aforementioned technical problems, this invention provides a long-term outreach method for H5 services based on a WeChat Work plugin. The core of this invention lies in proposing a business instance channelization mechanism and designing a complete two-way interactive closed loop:
[0008] Business Instance Channelization and Interaction Closed-Loop Mechanism: For specific H5 business instances, by capturing the user's confirmation intent within the page and executing precise timing linkage between "request sending" and "page closing," the backend is triggered to call the Enterprise WeChat application message interface to send a special initialization message to the user. Regardless of whether the user receives this message through the Enterprise WeChat APP or a plugin in the WeChat client, the message will instantiate an independent, persistent dedicated session entry in its corresponding chat list. More importantly, this invention constructs a two-way interaction closed loop between the "H5 business page" and the "WeChat dedicated session." By encapsulating subsequent business status notifications into rich media messages (such as WeChat card messages) with interactive elements (such as buttons) and sending them to this dedicated session, the user can directly jump back to the H5 page corresponding to this business instance by clicking on the interactive elements in the message. This design realizes a complete flow of "H5 page → WeChat persistent session → H5 page," transforming a one-time temporary interaction into a sustainable and revisitable immersive business flow within the WeChat ecosystem.
[0009] This invention breaks away from the conventional approach of "sending links and making records." Through a simplified linkage of "user active confirmation - request - closing the page," combined with the design of "interactive messages and revisitable status," it not only achieves the long-term effectiveness of the entry point but also realizes the closed-loop business interaction. The solution is lightweight and provides a consistent user experience.
[0010] A method for long-term outreach of H5 business applications based on WeChat Work plugins, characterized by the following steps:
[0011] S1. Business Instance Channelization Phase:
[0012] In response to the user's confirmation action on the temporary H5 business page embedded within the WeChat Work self-built application, corresponding to a single business transaction, the front end executes:
[0013] S11: Send a channel establishment request to the business backend, the request carrying the Enterprise WeChat member identifier corresponding to the current user;
[0014] S12: After receiving a successful response from the backend regarding the channel establishment request, call the WeChat JSAPI to close the current H5 page;
[0015] In response to the request, the business backend calls the WeChat application message interface based on the WeChat member identifier to send a session initialization message to the user, thereby instantiating an independent and persistent dedicated session entry in the user's WeChat environment.
[0016] S2. Message sending and interaction closed-loop stage:
[0017] S21. Message Reception and Rule Verification: When a business message needs to be sent to the dedicated session entry, the system receives the business message push request and parses its message type identifier; it verifies whether the message type is allowed to be sent according to the preset message type control rules configured by the administrator; if the verification fails, the process is terminated.
[0018] S22. Message Encapsulation and Delivery: If the verification passes, the enterprise WeChat member identifier is queried based on the target user identifier in the request. The business message is encapsulated into a rich media message format that can be associated with the original business context, and the enterprise WeChat application message interface is called for delivery.
[0019] Furthermore, in step S22, for high-priority messages, the delivery operation can employ an asynchronous message queue mechanism: the message task is submitted to the asynchronous message queue, and an independent consumer process retrieves the task from the queue and calls the WeChat Work interface for delivery. This asynchronous message queue mechanism decouples message delivery from the main business process: the main business can return after completing its core operations, and the message task is retrieved from the queue by an independent consumer process and delivered by calling the WeChat Work interface, thereby avoiding the WeChat Work interface timeout or failure from dragging down the main business, and supporting retry on failure and reliable delivery in high-concurrency scenarios.
[0020] Furthermore, in step S21, the message type control rules configured by the administrator are stored in an independent rule configuration table, and different rules can be configured for different organizational scopes.
[0021] The present invention also provides a system for implementing the above method, characterized in that it comprises:
[0022] H5 channel trigger module: Deployed on the H5 front end, used to respond to confirmation operations, send requests and control page closing.
[0023] Channel instantiation service: Deployed on the backend, it is used to handle channel establishment requests and call the WeChat application message interface to send initialization messages.
[0024] Message Receiving and Scheduling Gateway: Used to receive business message requests and perform management rule verification.
[0025] Message delivery service: Includes identity mapping query, message encapsulation, message queue management (if used) and WeChat API call unit, used to deliver interactive business messages.
[0026] Beneficial effects
[0027] 1. Achieve long-term sustainability and traceability of business instance entry points: By linking "confirmation-closing page-establishing connection" in sequence, a one-time H5 access is transformed into a permanent exclusive conversation entry point in the user's WeChat, solving the core pain point that temporary business entry points are easy to lose and difficult to retrieve, and providing a long-term traceable context for business interactions.
[0028] 2. A seamless business context continuity capability based on interactive messages has been built: By encapsulating business messages in dedicated sessions into clickable rich media messages, a reliable link has been established at the technical level from notification messages directly to the original business page. This completely changes the traditional "read-only, non-operable" notification mode, making each message reminder an entry point for continued work, achieving seamless continuity and high immersion in the business flow, and fundamentally improving processing efficiency and user experience continuity.
[0029] 3. Provides manageable business-level control capabilities for long-term communication channels: Through optional, independently configurable management rules and pre-send verification mechanisms, it ensures that the behavior of sending messages through this long-term channel can be controlled by unified policies, meeting the management needs of enterprise-level applications for compliance and clear responsibilities in message sending.
[0030] 4. Improved reliability of high-priority message delivery: By introducing scalable mechanisms such as asynchronous message queues, call result recording, and failure retries for critical messages, the robustness of the message system under high concurrency and abnormal conditions has been enhanced, providing effective underlying technical support for the "delivery" of critical business information. Attached Figure Description
[0031] Figure 1 This is a comparison diagram of the channel establishment process and core innovations provided in the embodiments of the present invention.
[0032] Figure 2 This is a timing interaction diagram of the channel instantiation stage provided in an embodiment of the present invention.
[0033] Figure 3 This is a flowchart of message management and reliable delivery provided in an embodiment of the present invention, which illustrates the delivery process when using an asynchronous message queue mechanism. Detailed Implementation
[0034] To make the objectives, technical solutions, and advantages of the present invention clearer, the following description will be provided in conjunction with the accompanying drawings (…). Figures 1-3The present invention will be illustrated by way of examples and typical application scenarios. The following embodiments do not constitute a limitation on the scope of protection of the present invention.
[0035] Example 1: Establishment and Closed-Loop Interaction of Dedicated Channels for Business Instances
[0036] This embodiment describes the process by which user Zhang San, within the WeChat client, has followed a plugin associated with a self-built application within WeChat Work. When he handles specific business transactions (such as "Alarm Handling #1001") through the application's H5 page, a dedicated notification channel and interactive loop are established for that business instance. Figure 1 and Figure 2 As shown.
[0037] 1. Prerequisites: Zhang San has already followed the relevant enterprise WeChat plugin. The users table in the business system already records the mapping relationship between his user_id and wechat_userid.
[0038] 2. Trigger confirmation: Zhang San clicks the "Operated, reply to WeChat" button on the "Alarm #1001 Handling" H5 page.
[0039] 3. Front-end Interaction: The H5 front-end first calls the user information API to obtain Zhang San's wechat_userid. Then, it sends a POST request to the channel establishment API ( / api / agent / nudge), carrying the wechat_userid in the request body. After receiving a successful response from the backend, the front-end executes WeixinJSBridge.call('closeWindow') to close the current H5 page. This strict timing control logic ensures that the channel establishment request has been successfully processed by the backend, completely avoiding the problem of channel establishment failure and users being unable to access the long-term entry point due to premature page closure.
[0040] 4. Dedicated entry point for backend instantiation: Upon receiving the request, the backend channel instantiation service calls the WeChat Enterprise cgi-bin / message / send interface to send a text message to Zhang San: "I'm here!" Since Zhang San has already enabled the enterprise WeChat plugin in the WeChat client, this message will generate a new, independent conversation entry at the top of Zhang San's WeChat chat list, for example, displayed as "Security Assistant". This entry becomes a dedicated notification channel corresponding to this alarm handling business instance, and will remain permanently in the user's WeChat chat list.
[0041] 5. Interaction Loop Implementation: Subsequently, when the alarm status changes to "Reviewed," the system generates a business notification. This notification is encapsulated as a WeChat card message titled "Alarm #1001 Status Update," containing a brief description and a prominent "View Details" button. After verification, this message is sent to Zhang San's "Security Assistant" conversation. Clicking the "View Details" button in the card message directly redirects Zhang San to the detailed handling H5 page for "Alarm #1001," thus completing a seamless return from the WeChat notification to the business context, forming a complete interaction loop.
[0042] Example 2: Patrol task reach combined with message control
[0043] This embodiment describes how, based on the dedicated session entry and interaction loop established in Embodiment 1, the optional message management mechanism of this invention is used to achieve compliant and controllable delivery of business messages, taking the park patrol task reminder scenario as an example.
[0044] 1. Event Occurrence: The system administrator creates a new patrol task. After the task is successfully created, the frontend calls the sendPatrolNotification function to send a push request of type "patrol" to the / api / wechat-robot / send-notification interface.
[0045] 2. Management Rule Verification: The backend service `sendNotificationToGroups` first performs management rule verification: it calls the `isNotificationTypeEnabledByGlobal` function to query the `global_notification_config` rule table to confirm whether the administrator has configured sending permission for this message type. If the verification passes, the subsequent process continues; if the verification fails, the push is terminated directly, ensuring that all message sending behavior complies with the enterprise's unified management policy and meets compliance control requirements.
[0046] 3. Message Encapsulation and Delivery: The system parses the user who should receive the notification, queries their wechat_userid, encapsulates the patrol task information into an interactive card message, and then calls the WeChat Work application message interface to send the card message to the user's established dedicated conversation entry. The user can quickly view task details or perform related operations by clicking the card.
[0047] (Supplementary Explanation) This embodiment demonstrates the basic synchronization process for message sending. For scenarios requiring higher reliability and decoupling, this invention can employ methods such as... Figure 3The asynchronous message queue mechanism is shown. Under this mechanism, message delivery tasks are submitted to a message queue (such as Redis), decoupled from the main business process, and delivered asynchronously by an independent consumer process. This avoids the main business being dragged down by timeouts or failures of the enterprise micro-enterprise interface, and supports failure retries and reliable delivery in high-concurrency scenarios.
Claims
1. A method for long-term outreach of H5 business based on WeChat Work plugins, characterized in that, Includes the following steps: In response to the user's confirmation operation in the temporary H5 business page embedded in the WeChat Work self-built application, which corresponds to a single business process, the front end obtains the WeChat Work member identifier corresponding to the current user and sends a channel establishment request to the business back end. The request carries the WeChat Work member identifier. After receiving a successful response from the back end of the channel establishment request, the front end calls the WeChat JSAPI to close the current H5 page. In response to the request, the business backend calls the WeChat application message interface based on the WeChat member identifier to send a session initialization message to the user, thereby instantiating an independent and persistent dedicated session entry in the user's WeChat environment.
2. The method according to claim 1, characterized in that, The operation of calling the WeChat JSAPI to close the current H5 page is only performed after the channel establishment request receives a successful response from the backend.
3. The method according to claim 1, characterized in that, It also includes the step of sending business messages to the dedicated session entry: receiving a business message push request and calling the WeChat application message interface to deliver the message.
4. The method according to claim 3, characterized in that, Before the step of sending the business message, the method further includes: verifying whether the type of the business message is allowed to be sent according to the preset message type control rules configured by the administrator; if the verification fails, the delivery process is terminated.
5. The method according to claim 4, characterized in that, The message type control rules configured by the administrator are stored in a separate rule configuration table, and different rules can be configured for different organizational scopes.
6. The method according to claim 3, characterized in that, In the message delivery step, the delivered business message is constructed as a rich media message containing interactive elements; by operating the interactive elements, the user can jump back to the original business H5 page associated with the exclusive session entry.
7. The method according to claim 3, characterized in that, In the step of sending business messages, the delivery of messages by calling the WeChat application message interface is implemented through an asynchronous message queue mechanism: the message task is submitted to the asynchronous message queue, and the consumer process asynchronously calls the interface.
8. The method according to claim 7, characterized in that, The asynchronous message queue is implemented using Redis, and the consumer process is a single instance.
9. A system for implementing the method according to any one of claims 1-8, characterized in that, include: The H5 channel trigger module is used to respond to user operations and control the page on the H5 side; The channel instantiation service is used to handle channel establishment requests and call the WeChat application message interface to send initialization messages; The message delivery service is used to call the WeChat Work application's message interface to deliver messages.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 8.