A Distributed Enterprise WeChat Private Domain Traffic Management Method and System

By introducing distributed management and message queues, the instability of messages sent by the WeChat robot was solved, achieving stable and reliable message transmission and failover, thus improving the availability and scalability of the system.

CN116016582BActive Publication Date: 2026-05-26JIANGSU YINCHENG NETWORK TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JIANGSU YINCHENG NETWORK TECH CO LTD
Filing Date
2022-11-30
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing WeChat Work robots suffer from frequent disconnections, missed messages, or poor timeliness when sending messages, and are prone to single points of failure, resulting in poor availability.

Method used

A distributed management approach is adopted, which uses a cloud platform to schedule simulators corresponding to robot accounts, introduces a message queue to achieve stable message push, and performs failover and dynamic scaling management in case of failure.

Benefits of technology

It enables stable and reliable sending of private traffic on WeChat for businesses, reduces single point of failure rate, ensures message timeliness and availability, and provides fault detection and dynamic configuration functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116016582B_ABST
    Figure CN116016582B_ABST
Patent Text Reader

Abstract

This invention proposes a distributed enterprise WeChat private domain traffic management system, which solves the problems of poor availability and high potential for single point of failure when enterprise WeChat robots handle repetitive maintenance information. The solution includes the following steps: S1, after the cloud platform reads the current simulator configuration from the configuration center, it schedules simulators with an equal number and corresponding robot accounts. The simulator reads its corresponding account configuration from the configuration center based on the robot account information and completes initialization; S2, the cloud platform renews all simulators and enterprise WeChat accounts periodically through one-to-one corresponding leases, determines the failure of simulators that have not been renewed within the specified period, and reschedules the simulators and enterprise WeChat account lease bindings; S3, when it is necessary to send a message to a customer, the cloud platform queries the customer's corresponding robot, generates the corresponding robot's message in the message queue, and the simulator consumes the message list of the corresponding robot account, pushes and marks it.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of private domain traffic management technology, and in particular to a distributed enterprise WeChat private domain traffic management system. Background Technology

[0002] Currently, businesses frequently communicate with customers via WeChat. However, a significant portion of this communication consists of repetitive, mechanical, or formulaic messages. Manually sending these messages by staff would be cumbersome, making the use of chatbots, similar to those used by Taobao's customer service, a natural alternative.

[0003] However, research revealed that existing robots on the market all suffer from various business challenges. For example, they do not support sending messages to external groups of customers, do not support WeChat for business and frequently disconnect. Even the best-performing robots sometimes miss messages or send time-sensitive messages too late. Furthermore, they all suffer from poor availability and the potential for single points of failure. This solution has been continuously iterated in a real-world production environment, overcoming these problems. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to overcome the defects of the existing technology. The present invention proposes a distributed enterprise WeChat private domain traffic management method and system that can perform distributed management of enterprise WeChat robots and introduce message queues.

[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is: a distributed enterprise WeChat private domain traffic management method, comprising the following steps:

[0006] S1. After the cloud platform reads the current simulator configuration from the configuration center, it schedules simulators that are equal in number and correspond to the robot accounts. The simulators read their corresponding account configurations from the configuration center based on the robot account information and complete the initialization.

[0007] S2, the cloud platform renews all simulators and WeChat accounts with one-to-one rental contracts on a regular basis, determines the failure of simulators that have not been renewed within the specified period, and re-schedules the binding of simulators and WeChat accounts with rental contracts.

[0008] S3. When it is necessary to send a message to a customer, the cloud platform queries the customer's corresponding robot, generates the corresponding robot's message in the message queue, and the simulator consumes the message list of the corresponding robot account, pushes and marks it.

[0009] Furthermore, in step S3, when the simulator comes back online due to a fault, it re-consumes from its last marked-read message, ignoring messages that have exceeded their lifespan and directly marking them as read.

[0010] Furthermore, when a new simulator is added, the client on the simulator automatically registers the simulator in the configuration center and then adds it to the simulator pool to wait for scheduling. When a new WeChat account is added, the account configuration is written to the configuration center. The configuration center checks whether the WeChat account has a renewed lease. If not, the cloud platform schedules the simulator to be bound to its lease.

[0011] A distributed enterprise WeChat private domain traffic management system includes:

[0012] The initialization module is used to schedule an equal number of corresponding simulators to the WeChat Work robot. Each simulator completes the configuration initialization for each account.

[0013] The message sending module is used to implement message routing between the cloud platform and various simulators;

[0014] The configuration module is used to distribute overall or individual configurations to the emulator and to perform liveness detection on the emulator;

[0015] The failover module is used to identify simulators that have not been renewed within the specified period as faulty, reschedule the simulators to be bound to the WeChat Work lease, and mark the faulty simulators and put them back into the simulator pool.

[0016] Furthermore, under normal system operation, the number of simulator pools is set to n / 5+1, where n is the number of simulator worker nodes.

[0017] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the distributed enterprise WeChat private domain traffic management method described above.

[0018] A non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is used to implement the steps of the distributed enterprise WeChat private domain traffic management method described above.

[0019] Compared with the prior art, the beneficial effects of the present invention include: it can perform distributed management of enterprise WeChat private domain traffic, and correspondingly introduce message queues to realize the direct sending of repetitive messages in user interaction and communication, ensuring stable and reliable message timeliness, low single point of failure rate, and providing functions such as fault detection, fault transfer, pooling management, dynamic scaling, and unified configuration distribution for enterprise WeChat private domain information. Attached Figure Description

[0020] The disclosure of this invention is illustrated with reference to the accompanying drawings. It should be understood that the drawings are for illustrative purposes only and are not intended to limit the scope of protection of this invention. In the drawings, the same reference numerals are used to refer to the same parts. Wherein:

[0021] Figure 1 A schematic diagram of a system flowchart according to an embodiment of the present invention is shown. Detailed Implementation

[0022] It is readily understood that, based on the technical solution of this invention, those skilled in the art can propose various interchangeable structural methods and implementations without altering the essential spirit of the invention. Therefore, the following detailed embodiments and accompanying drawings are merely illustrative examples of the technical solution of this invention and should not be considered as the entirety of the invention or as limitations or restrictions on the technical solution of this invention.

[0023] According to one embodiment of the present invention, Figure 1 As shown.

[0024] A distributed enterprise WeChat private domain traffic management system includes:

[0025] The initialization module is used to schedule an equal number of corresponding simulators to the WeChat Work robot. Each simulator completes the configuration initialization for each account.

[0026] The message sending module is used to implement message routing between the cloud platform and various simulators;

[0027] The configuration module is used to distribute overall or individual configurations to the emulator and to perform liveness detection on the emulator;

[0028] The failover module is used to identify simulators that have not been renewed within the specified period as faulty, reschedule the simulators to be bound to the WeChat Work lease, and mark the faulty simulators and put them back into the simulator pool.

[0029] The components that make up each module of the system are described in detail below.

[0030] Cloud platform: This is the entry point of the system, providing a visual interface for users to operate and query the system;

[0031] Emulator: also known as WeChat Work robot. On the hardware side, it is a Windows machine. On the software side, the WeChat Work client and the WeChat Work emulator client are installed, and it is logged into a WeChat Work account to automatically send and receive messages for that account.

[0032] Emulator pool: This is a collection of emulators that provides a backup mechanism for emulators;

[0033] Scheduler: When an emulator crashes, the scheduler puts the crashed emulator into the emulator pool and retrieves available emulators from the pool to achieve failover;

[0034] Message queue: Implements the routing function for sending messages from the cloud platform to specific simulators, as well as functions such as peak smoothing of the sending rate and persistence of the sent content;

[0035] Configuration Center: Distributes overall or individual configurations to the emulator and performs liveness checks on the emulator.

[0036] The specific implementation methods for ensuring the availability and scalability of the entire system are as follows.

[0037] Initialization: During system initialization, the cloud platform first reads the current simulator configuration from the configuration center. The simulator configuration mainly includes which robot accounts should be working. Then, the scheduler uses the same number of simulators as the robot accounts from the simulator pool to be converted to working status. At this time, there is a one-to-one relationship between the simulator and the robot account. Then, the simulator reads the configuration of the robot account (such as login token, WeChat Work configuration login) from the configuration center according to the robot account information, and completes the initialization of the WeChat Work environment.

[0038] Sending messages: When a message needs to be sent to a customer, the user can query the corresponding robot for that customer on the cloud platform, then produce a message with the topic of that robot in the message queue. The simulator will consume the message list corresponding to its own robot account, then push the message, and finally mark the message as read (committed). When the simulator comes back online due to a failure, it will start consuming from the last read message in its own topic. The message contains a lifecycle field; if the time has exceeded the message's lifecycle, the message is ignored and directly marked as read.

[0039] Failover: This is divided into simulator failure and component failure. Components are deployed with multiple replicas; the cloud platform can guarantee availability as long as one replica survives, while other components can guarantee availability as long as more than half of their replicas survive. The availability of the simulator is related to the number of simulator pools.

[0040] All emulators apply for a lease that corresponds one-to-one with a WeChat Work account from the registration center and periodically apply for renewal. When the registration center detects that a lease has not been renewed within the specified period, it determines that the emulator corresponding to that lease has malfunctioned and notifies the cloud platform of this information along with the list of currently available emulators. The cloud platform then uses the scheduler to select a new emulator from the emulator pool to perform the WeChat Work task and marks the malfunctioning emulator as down, returning it to the pool.

[0041] Member joining and leaving: This is divided into two parts. One part is the joining and leaving of emulators. When an emulator joins the cluster, the client on the emulator will automatically register the emulator with the configuration center and then join the emulator pool to wait for scheduling. The reverse is true for leaving. The other part is the joining and leaving of WeChat Work. When a WeChat Work account joins, the user needs to write the account configuration into the configuration center on the cloud platform. When the configuration center detects that the lease of this WeChat Work account has not been renewed, it notifies the cloud platform to schedule the emulator, as described above.

[0042] In principle, the number of available simulators in the simulator pool determines how many working simulators might fail simultaneously, ensuring the system can continue functioning normally. However, in our production environment, while simulator crashes due to performance or network issues are frequent, the probability of simultaneous failures is not high. In the most extreme case, only one-fifth of the simulators fail. Therefore, setting the simulator pool size to n / 5+1, where n is the number of simulator worker nodes, allows the system to maintain normal operation.

[0043] The technical scope of this invention is not limited to the content described above. Those skilled in the art can make various modifications and variations to the above embodiments without departing from the technical concept of this invention, and all such modifications and variations should fall within the protection scope of this invention.

Claims

1. A distributed enterprise WeChat private domain traffic management method, characterized in that, Includes the following steps: S1. After the cloud platform reads the current simulator configuration from the configuration center, it schedules simulators that are equal in number and correspond to the robot accounts. The simulators read their corresponding account configurations from the configuration center based on the robot account information and complete the initialization. S2, the cloud platform renews all simulators and WeChat accounts with one-to-one rental contracts on a regular basis, determines the failure of simulators that have not been renewed within the specified period, and re-schedules the binding of simulators and WeChat accounts with rental contracts. S3. When it is necessary to send a message to a customer, the cloud platform queries the customer's corresponding robot, generates the corresponding robot's message in the message queue, and the simulator consumes the message list of the corresponding robot account, pushes and marks it.

2. The distributed enterprise WeChat private domain traffic management method according to claim 1, characterized in that: In step S3, when the simulator comes back online due to a fault, it starts consuming from its last read message again, ignoring messages that have exceeded their lifespan and directly marking them as read.

3. The distributed enterprise WeChat private domain traffic management method according to claim 1, characterized in that: When a new emulator is added, the client on the emulator automatically registers the emulator in the configuration center and then adds it to the emulator pool to wait for scheduling. When a new WeChat account is added, the account configuration is written to the configuration center. The configuration center checks whether the WeChat account has a renewed lease. If not, the cloud platform schedules the emulator to be bound to its lease.

4. A distributed enterprise WeChat private domain traffic management system, characterized in that, include: The initialization module is used to schedule an equal number of corresponding simulators to the WeChat Work robot. Each simulator completes the configuration initialization for each account. The message sending module is used to implement message routing between the cloud platform and various simulators; The configuration module is used to distribute overall or individual configurations to the emulator and to perform liveness detection on the emulator; The failover module is used to identify simulators that have not been renewed within the specified period as faulty, reschedule the simulators to be bound to the WeChat Work lease, and mark the faulty simulators and put them back into the simulator pool.

5. A distributed enterprise WeChat private domain traffic management system according to claim 4, characterized in that: Under normal system operation, the number of simulator pools is set to n / 5+1, where n is the number of simulator worker nodes.

6. 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 steps of the distributed enterprise WeChat private domain traffic management method as described in any one of claims 1 to 3.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it is used to implement the steps of the distributed enterprise WeChat private domain traffic management method according to any one of claims 1 to 3.