Message pushing method, system, device and equipment

By generating event messages to be pushed on the source site and pushing them to the edge pool of the target client, the problems of high computing pressure and inaccurate message push in the existing technology are solved, and efficient and accurate message push is achieved.

CN119814859APending Publication Date: 2025-04-11CHINA TELECOM CLOUD TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411773106.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The existing central cluster pushes the message to the client, which leads to high pressure on the central computing and cannot achieve accurate message push, which has the problem of bandwidth waste.

Method used

By generating event messages to be pushed on the source site, including information from the target client, determining the edge pool where the target client is located, and pushing the message to the edge pool. Finally, the message push function of the edge pool accurately pushes the message to the target client.

Benefits of technology

It reduces the computing pressure of the source station, realizes accurate message delivery, reduces the network interaction load between the client and the source station, and avoids bandwidth waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814859A_ABST
    Figure CN119814859A_ABST
Patent Text Reader

Abstract

The invention provides a message pushing method, system, device and equipment, and relates to the technical field of data processing, a source station is adopted to generate a to-be-pushed event message, and the to-be-pushed event message at least comprises information of a target client; then, based on the edge pool information of the target client, determining a target edge pool where the target client is located; further, the event message to be pushed is pushed to the target edge pool; and finally, pushing the to-be-pushed event message to the target client through a message pushing function of the target edge pool. According to the method, the message generation process and the message pushing process are completely decoupled, the source station is responsible for message generation, message pushing is completed through the edge function of the edge pool, and the calculation pressure of the source station can be greatly reduced. And meanwhile, accurate delivery of the message is realized, and the network interaction load of the client and the source station is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a message push method, system, device and equipment. Background Art

[0002] In the existing central cluster message push method for clients, the center refers to the server cluster that centrally processes all requests, and the edge refers to the computing resources close to the data source or client. Usually, the central computing pressure is relatively large. And as the number of clients increases, whether it is a polling method or a long connection method, there is still a lot of pressure on the central computing.

[0003] Even if a message queue tool is used, a message queue cluster with sufficient performance is still required to face a large number of clients. At the same time, the existing methods cannot achieve accurate message push, which wastes a lot of bandwidth. Summary of the invention

[0004] The present application provides a message push method, system, device and equipment to solve the above-mentioned problems.

[0005] In a first aspect, an embodiment of the present application proposes a message push method, which is applied to a source station, and the method includes:

[0006] The source station is used to generate an event message to be pushed, wherein the event message to be pushed includes at least information of a target client;

[0007] Based on the edge pool information of the target client, determining the target edge pool where the target client is located;

[0008] Pushing the event message to be pushed to the target edge pool;

[0009] The event message to be pushed is pushed to the target client through the message push function of the target edge pool.

[0010] Optionally, pushing the event message to be pushed to the target client through the message push function of the target edge pool includes:

[0011] Receive the event message to be pushed through the edge kafka in the target edge pool;

[0012] Obtain the event information to be pushed from the edge kafka of the target edge pool through the message push function of the target edge pool, and obtain the address of the target client from the edge KV of the target edge pool;

[0013] Based on the address of the target client, the event message to be pushed is sent to the target client.

[0014] Optionally, the method further includes:

[0015] Receiving a heartbeat message sent by the target client through the target edge pool;

[0016] In the case where the heartbeat message is the first heartbeat message, the heartbeat message is stored in the edge KV of the target edge pool through the heartbeat function of the target edge pool, and the heartbeat message includes a unique identifier and address of the target client;

[0017] Sending the registration message of the target client to the source station through the heartbeat function of the target edge pool;

[0018] After receiving the registration message of the target client, the source station records the edge pool information corresponding to the target client.

[0019] Optionally, the method further includes:

[0020] When the heartbeat function of the target edge pool does not receive a heartbeat message sent by the target client within a preset time, sending a logout message to the source station;

[0021] After receiving the deregistration message, the source station deregisters the edge pool information of the target client.

[0022] In a second aspect, an embodiment of the present application proposes a message push method, which is applied to a client, and the method includes:

[0023] Receive the event message to be pushed generated by the source station through the edge kafka of the target edge pool, where the event message to be pushed contains at least information of the target client;

[0024] Using the message push function of the target edge pool to obtain the event message to be pushed from the edge kafka of the target edge pool, and push it to the target client;

[0025] The target client receives and processes the event message to be pushed pushed by the message push function of the target edge pool.

[0026] In a third aspect, an embodiment of the present application proposes a message push system, the system comprising: multiple clients, multiple edge pools and a source station, each of the edge pools comprising multiple heartbeat functions, an edge KV, multiple message push functions and an edge kafka;

[0027] The plurality of edge pools and one source station interact with each other to implement the message push method described in any one of the first aspects above;

[0028] The multiple edge pools and the multiple clients interact with each other to implement the message push method described in the second aspect.

[0029] Optionally, a plurality of the heartbeat functions in the system are deployed based on the number of the clients;

[0030] The multiple message push functions in the system are deployed based on the number of messages produced by the source station.

[0031] In a fourth aspect, an embodiment of the present application provides a message push device, which is applied to a source station, and the device includes:

[0032] A message generating module, configured to generate an event message to be pushed using the source station, wherein the event message to be pushed includes at least information of a target client;

[0033] A determination module, configured to determine a target edge pool where the target client is located based on the edge pool information of the target client;

[0034] A first pushing module, configured to push the event message to be pushed to the target edge pool;

[0035] The second push module is used to push the event message to be pushed to the target client through the message push function of the target edge pool.

[0036] In a fourth aspect, an embodiment of the present application provides a message push device, which is applied to a client, and the device includes:

[0037] A first receiving module is used to receive the event message to be pushed generated by the source station through the edge kafka of the target edge pool, wherein the event message to be pushed includes at least information of the target client;

[0038] An acquisition module, used for acquiring the event message to be pushed from the edge kafka of the target edge pool by using the message push function of the target edge pool;

[0039] The second receiving module is used to use the target client to receive the event message to be pushed obtained from the message push function of the target edge pool, and process it.

[0040] In the sixth aspect, an embodiment of the present application proposes an electronic device, comprising a memory, a processor, and a computer program stored on the memory, wherein the processor executes the computer program to implement the message push method described in any one of the first aspect above, or the message push method described in the second aspect above.

[0041] The present application includes the following advantages: The embodiment of the present application proposes a message push method, system, device and equipment, which uses the source station to generate an event message to be pushed, and the event message to be pushed contains at least the information of the target client; then, based on the edge pool information of the target client, the target edge pool where the target client is located is determined; further, the event message to be pushed is pushed to the target edge pool; finally, the event message to be pushed is pushed to the target client through the message push function of the target edge pool. This method completely decouples the message generation and message push processes. The source station is responsible for message generation, and the message push is completed by the edge function of the edge pool, which can greatly reduce the computing pressure of the source station. At the same time, accurate message delivery is achieved, reducing the network interaction load between the client and the source station. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0043] Figure 1 A schematic diagram of a process flow of a message push method applied to a source station proposed in an embodiment of the present application;

[0044] Figure 2 It is a flow chart of a message push method applied to a source station proposed in an embodiment of the present application;

[0045] Figure 3 This is a schematic diagram of the steps of a message push method applied to a client proposed in an embodiment of the present application;

[0046] Figure 4 It is a flowchart of a message push method applied to a client proposed in an embodiment of the present application;

[0047] Figure 5 It is a schematic diagram of the architecture of a message push system proposed in an embodiment of the present application;

[0048] Figure 6 This is a module diagram of a message push device applied to a source station proposed in an embodiment of the present application;

[0049] Figure 7 This is a module diagram of a message push device applied to a client proposed in an embodiment of the present application;

[0050] Figure 8 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0051] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0052] In the existing central cluster message push method for clients, the center refers to the server cluster that centrally processes all requests, and the edge refers to the computing resources close to the data source or client. The computing pressure of the center is usually relatively large. And as the number of clients increases, whether it is a polling method or a long connection method, it still puts a lot of pressure on the central computing. The existing client message push methods mainly have the following implementation methods: (1) The client side initiates a polling request. If the polling frequency is too high, it will bring higher network traffic and computing pressure on the source station. If the polling frequency is too low, the message timeliness will be reduced, and there is an irreconcilable contradiction. (2) Maintain a long connection between the client and the source station. This method requires matching a large number of source station resources in the case of massive clients. (3) Direct broadcasting through the message queue tool. In this method, the client needs to process a large number of redundant messages, and there is a risk of horizontal overreach of the message queue. At the same time, since it needs to connect to all clients, the performance requirements of the message queue are very high. (4) The client registers with the source station, and the source station directly sends messages. In this method, each client needs to make a large number of heartbeat requests to the source station. The network overhead and resource requirements of the source station are similar to those of method (1), and there is still performance pressure and resource waste.

[0053] Based on this, this application proposes a message push method, which deploys edge function computing in the edge computer room of CDN (Content Delivery Networks), so that the client's request can be sent directly to the nearest edge computer room, saving the consumption of accessing the central cluster through the network. While reducing network latency, it can also reduce the computing pressure of the central computer room (or source station). Edge function computing provides a BaaS (Function as a Service) capability that is different from the high cost and high latency characteristics of traditional centralized computing. Edge function computing has many characteristics such as Serverless, event-driven, low cost, and low latency. At present, edge function computing is used in scenarios such as image processing, user authentication, and data encryption.

[0054] See also Figure 1 , Figure 1 1 is a schematic diagram of a method for pushing a message to a source station according to an embodiment of the present application, wherein the method comprises the following steps:

[0055] Step 101: Use the source station to generate an event message to be pushed.

[0056] The event message generated by the source station refers to the notification or data of a specific event generated on the server or service end. These event messages can be triggered by various operations or state changes, such as user behavior, system state changes, data updates, etc. Event messages usually contain detailed information about the occurrence of the event, such as timestamp, event type, data involved, etc. In practical applications, event messages enable the system to respond to changes and implement dynamic and scalable functions. For example, in an e-commerce platform, a user's operation of adding a product to a shopping cart can generate an event message, triggering subsequent processes such as inventory checks and price calculations.

[0057] The embodiment of the present application takes into account that when a large number of event messages are generated, the computing pressure of the source station will be very large. Based on this, the message generation and message push processes in the source station are separated, so that the source station only generates messages to reduce the computing pressure of the source station.

[0058] At the same time, in order to achieve accurate delivery of messages, the event message to be pushed generated by the source station includes at least the information of the target client to be pushed. This information can be used to determine the unique target client and can be the unique identifier of the target client to achieve the binding of the event message to be pushed and the target client, achieve accurate delivery of messages, and avoid the risk of lateral unauthorized access when the client obtains the message.

[0059] In an embodiment of the present application, the content contained in the event information to be pushed generated by the source station is sent in the form of a key-value pair, where the key value is the unique identifier of the target client and the value value is the specific message content to be pushed.

[0060] It should be noted that the horizontal overstepping of authority when the client obtains messages here means: when the source station sends multiple event messages to multiple clients at the same time, assuming that each event message corresponds to a client one-to-one, if the source station sends the above multiple event messages to one client, then the client that receives all the event messages obtains other event messages. This situation is that the client has horizontal overstepping of authority.

[0061] Step 102: Based on the edge pool information of the target client, determine the target edge pool where the target client is located.

[0062] In order to achieve complete decoupling of the message production and message push processes of the source station, an embodiment of the present application proposes to establish an edge pool between the client and the source station, and deploy multiple edge functions for implementing message push in the edge pool, so that the message push process is completed by a specific edge function instead of by the source station.

[0063] It should be noted that one source station can push messages to multiple clients, multiple edge pools can be established between one source station and multiple clients, and each edge pool can exchange messages with multiple clients.

[0064] Based on this, after the event message to be pushed is generated, the target edge pool where the target client in the event message to be pushed is located needs to be determined, so that the event message can be pushed to the target client through the target edge pool.

[0065] Specifically, the source station determines the target client based on the information of the target client included in the event message to be pushed, and determines the edge pool information of the target client, and determines the target edge pool where the target client is located based on the edge pool information of the target client. The edge pool information of the target client includes at least an edge pool identifier, and the edge pool where the target client is located can be determined by the edge pool identifier. For example, the edge pool identifier can be the number of the actual edge pool.

[0066] In an example, if the edge pool information of the target client indicates that the target client is located in edge pool 1, edge pool 1 is determined as the target edge pool where the target client is located.

[0067] Step 103: Push the event message to be pushed to the target edge pool.

[0068] After determining the target edge pool where the target client in the event message to be pushed is located, the event message to be pushed is pushed to the target edge pool through the source station. The source station completes the process of event message generation, and the subsequent process of pushing the event message to be pushed to the target client is completed by the edge function in the edge pool, which greatly reduces the computing pressure of the source station.

[0069] Step 104: Push the event message to be pushed to the target client through the message push function of the target edge pool.

[0070] The edge function deployed in the edge pool for pushing event information is a message push function. After the edge pool receives the event message to be pushed, the event message to be pushed is pushed to the target client through the deployed message push function. At this point, the edge pool completes the push of the event message and accurately implements the push of the event message. At the same time, the target client will only be pushed to the messages that actually need to be processed, without having to read a large amount of redundant information, which can greatly reduce the computing pressure on the client. The message push process has higher timeliness. Compared with the existing timed polling solution, the total network distance of the overall message push remains unchanged, but the push process is actively initiated by the message producer and can reach the client faster.

[0071] The embodiment of the present application proposes a message push method, which generates an event message to be pushed by using the source station, and the event message to be pushed contains at least the information of the target client; then, based on the edge pool information of the target client, the target edge pool where the target client is located is determined; further, the event message to be pushed is pushed to the target edge pool; finally, the event message to be pushed is pushed to the target client through the message push function of the target edge pool. This method completely decouples the message generation and message push processes. The source station is responsible for message generation, and the message push is completed by the edge function of the edge pool, which can greatly reduce the computing pressure of the source station. At the same time, accurate message delivery is achieved, reducing the network interaction load between the client and the source station. The timeliness of message push is optimized without significantly increasing the computing power cost; in the scenario where the client data is huge, the network cost can be reduced, and at the same time, only the message push-related capability components can be expanded in a targeted manner to reduce the computing power cost.

[0072] In an optional implementation, in the above step 104, the event message to be pushed is pushed to the target client through the message push function of the target edge pool, which specifically includes the following sub-steps:

[0073] Step 1041: Receive the event message to be pushed through the edge Kafka in the target edge pool.

[0074] The edge Kafka in the edge pool provides a powerful data collection, processing and transmission platform for edge computing, which is suitable for scenarios that require real-time data processing and large-scale data transmission. Based on this, the event message to be pushed is received by the edge Kafka in the target edge pool, so that the message push function in the edge pool can obtain the event message to be pushed from the edge Kafka without interacting with the source station.

[0075] In the process of the source station sending event messages to each edge function through edge kafka, different strategies can be selected according to the business scenario of the event message. For example, if the importance level of the event message to be pushed is high and it is necessary to ensure that the event message must be sent to the client, the source station can choose to send the event message to the client at least once to ensure that the client can receive the event message. If the importance level of the event message to be pushed is average, the event message can be sent to the client, and the source station can choose to send the event message to the client at most once. If the importance level of the event message to be pushed is low, it does not matter whether the client receives the time information, then the source station can choose to send the event message to the client only once.

[0076] Step 1042: Obtain the event information to be pushed from the edge kafka of the target edge pool through the message push function of the target edge pool, and obtain the address of the target client from the edge KV of the target edge pool.

[0077] The edge function deployed in the edge pool for pushing event messages is a message push function, and the event information to be pushed is obtained from the edge kafka of the target edge pool through the message push function in the target edge pool.

[0078] In order to accurately push the event message to be pushed to the target client, this application obtains the address of the target client from the edge KV deployed in the edge pool through the message push function, and accurately pushes the event message to be pushed through the address of the target client. The edge KV deployed in the edge pool stores the key-value pair information of the target client, the key value is the unique identifier of the target client, and the value value is the address of the target client.

[0079] It should be noted that multiple message push functions can be deployed in an edge pool, and the message push functions can be flexibly deployed according to the number of event messages to be pushed. When the number of event messages to be pushed is large, more message push functions are relatively deployed. When the number of event messages to be pushed is small, fewer message push functions are relatively deployed.

[0080] Step 1043: Based on the address of the target client, the event message to be pushed is sent to the target client.

[0081] Through the address of the target client, the event message to be pushed can be accurately sent to the target client, avoiding the risk of horizontal unauthorized access when the client obtains the message.

[0082] Based on the above embodiment, the method further includes the following steps:

[0083] Step 105: Receive a heartbeat message sent by the target client through the target edge pool.

[0084] In order to accurately push the event message to be pushed to the target client, it is necessary to determine whether the target client is in a connected state. For a target client that is not in a connected state, the event message cannot be pushed to the target client that is not in a connected state.

[0085] Based on this, by deploying an edge function in the edge pool for detecting whether the client is in a connected state, a heartbeat function is deployed in the edge pool in the present application to achieve the above connection state detection.

[0086] Specifically, after the client goes online, it will send a heartbeat message. The heartbeat message is a mechanism used to detect and maintain the connection status in network communication. It notifies the other party that it is still online by sending specific data packets regularly to ensure the validity of the connection. The target edge pool determines the connection status of the client by receiving the heartbeat message sent by the client.

[0087] It should be noted that multiple heartbeat functions can be deployed in an edge pool, and the heartbeat functions are flexibly deployed according to the number of clients. When the number of clients is large, more heartbeat functions are deployed relatively, and when the number of clients is small, fewer heartbeat functions are deployed relatively.

[0088] Step 106: When the heartbeat message is the first heartbeat message, the heartbeat message is stored in the edge KV of the target edge pool through the heartbeat function of the target edge pool.

[0089] If the target client has just come online and the heartbeat message sent to the edge pool is the first heartbeat message, the heartbeat message of the target client needs to be stored so that in the subsequent process of pushing messages to the target client, the relevant information of the target client can be obtained from the stored heartbeat message.

[0090] Specifically, when the heartbeat message is the first heartbeat message, the heartbeat message is stored in the edge KV of the target edge pool through the heartbeat function of the target edge pool. The edge KV deployed in the edge pool stores the information of the target client in the form of key-value pairs. The key value is the unique identifier of the target client, and the value value is the address of the target client.

[0091] In the present application, the above-mentioned heartbeat message includes the unique identifier and address of the target client, and the content in the above-mentioned heartbeat message is stored in the form of a key-value pair, the key value is the unique identifier of the target client, and the value value is the address of the target client.

[0092] Step 107: Send the registration message of the target client to the source station through the heartbeat function of the target edge pool.

[0093] When the heartbeat function sends the heartbeat message to the edge KV for storage, the heartbeat function will also send a registration message of the target client to the source station so that the source station can register the target client. After registration, the source station can push event messages to the target client. The registration message includes the unique identifier of the target client and the edge pool identifier.

[0094] Step 108: After receiving the registration message from the target client, the source station records the edge pool information corresponding to the target client.

[0095] After the source station receives the registration message of the target client, the edge pool information corresponding to the target client is recorded based on the content in the registration message, so that the source station can determine the target client according to the edge pool information when sending an event message.

[0096] In an optional embodiment, the method further comprises the following steps:

[0097] Step 109: When the heartbeat function of the target edge pool does not receive a heartbeat message sent by the target client within a preset time, a deregistration message is sent to the source station.

[0098] If the heartbeat function does not receive the heartbeat message sent by the client within the preset time, it is considered that the client heartbeat has timed out, that is, the client may be offline and cannot continue to process event messages. For example, the preset time can be set to 3 seconds, 5 seconds, etc.

[0099] Specifically, when the heartbeat function of the target edge pool does not receive a heartbeat message sent by the target client within a preset time, it is considered that the target client may have been offline, and the heartbeat function sends a logout message to the source station.

[0100] Step 110: After receiving the deregistration message, the source station deregisters the edge pool information of the target client.

[0101] After receiving the deregistration message sent by the heartbeat function, the source station deregisters the edge pool information of the target client. That is, the source station removes the target client from the active client list and releases the resources related to it, which can avoid resource waste and ensure the accuracy of the system status.

[0102] See also Figure 2 , Figure 2 1 is a flow chart of a message push method applied to a source station proposed in an embodiment of the present application. Figure 2 In the process, an event message is generated by the center or source station, and the user refers to the client. Specifically, an event message is first generated by the center / source station, and then the user (i.e., the client in the event message) is checked to see if there is an edge pool record. If there is no edge pool record, it indicates that the client may be wrong or offline, and the message push process ends. If there is an edge pool record, the event message is pushed to the corresponding edge pool kafka. Then, the message push function in the edge pool obtains the event message from the edge pool kafka, obtains the client address from the edge KV, and pushes the event message to the client through the client address. The client receives the event message and processes the message.

[0103] See also Figure 3 , Figure 31 is a schematic diagram of a method for pushing a message to a client according to an embodiment of the present invention, wherein the method comprises the following steps:

[0104] Step 301: Receive the event message to be pushed generated by the source station through the edge Kafka of the target edge pool.

[0105] In order to achieve complete decoupling of the message production and message push processes of the source station, an embodiment of the present application proposes to establish an edge pool between the client and the source station, and deploy multiple edge functions for implementing message push in the edge pool, so that the message push process is completed by a specific edge function instead of by the source station.

[0106] Based on this, firstly, the edge kafka in the target edge pool receives the event message to be pushed generated by the source station. In order to accurately push the event message to be pushed to the target client, the event message to be pushed contains at least the information of the target client, which is a unique identifier and can be used to determine the unique target client.

[0107] Step 302: Using the message push function of the target edge pool, the event message to be pushed is obtained from the edge kafka of the target edge pool, and pushed to the target client.

[0108] The message to be pushed is obtained through the message push function deployed in the target edge pool. Specifically, the event message to be pushed is obtained from the edge kafka and pushed to the target client.

[0109] Step 303: Using the target client to receive the event message to be pushed pushed by the message push function of the target edge pool, and process it.

[0110] In order to accurately push to the target client, the address of the target client is obtained from the edge KV through the message push function to achieve accurate push. Based on this, the target client receives and processes the event message to be pushed pushed by the message push function of the target edge pool.

[0111] The embodiment of the present application proposes a message push method, which receives the event message to be pushed generated by the source station through the edge kafka of the target edge pool, and the event message to be pushed contains at least the information of the target client; the message push function of the target edge pool is used to obtain the event message to be pushed from the edge kafka of the target edge pool, and push it to the target client; the target client is used to receive the event message to be pushed pushed by the message push function of the target edge pool, and processes it. The heartbeat message of the client is processed by the heartbeat function deployed in the edge pool, and there is only one registration request and one deregistration request for the source station, which minimizes the processing pressure of the source station and reduces the network overhead from the edge pool to the source station. The client side will only be pushed to the messages that actually need to be processed, without having to read a large amount of redundant information, reducing the computing pressure of the client.

[0112] See also Figure 4 , Figure 4 FIG. 1 is a flow chart of a message push method applied to a client proposed in an embodiment of the present application. Since both the source station and the center can generate messages, Figure 4 In the event message generated by the center or source station, the user refers to the client. First, the client sends a heartbeat message to the heartbeat function deployed in the edge pool. The heartbeat function determines whether the heartbeat message is the first heartbeat. If the heartbeat message is not the first heartbeat, it indicates that the client is always connected. If the heartbeat message is the first heartbeat, the edge KV of the edge pool records the client information corresponding to the user (client unique identifier and address), and sends a registration message (client unique identifier and edge pool identifier) ​​to the center / source station. After receiving the registration message, the center / source station records the edge pool information corresponding to the user.

[0113] See also Figure 5 , Figure 5 : This is a schematic diagram of the architecture of a message push system proposed in an embodiment of the present application, wherein the system includes: multiple clients, multiple edge pools and a source station, each of the edge pools includes multiple heartbeat functions, an edge KV, multiple message push functions and an edge kafka; multiple edge pools in the system interact with one source station to implement a message push method applied to the source station; wherein the number of edge pools can be many, Figure 5 Only two edge pools are shown as examples. Multiple edge pools in the system interact with multiple clients to implement a message push method applied to the client, wherein one edge pool can interact with multiple clients. Figure 5 Only three clients are shown as an example.

[0114] The deployment method of the above system is: deploy edge kafka in each CDN edge pool, and publish multiple heartbeat functions and multiple message push functions in each edge pool, and access the source station and client of the service through these functions.

[0115] Specifically, the functions of the client, heartbeat function, message push function, and source station included in the system are as follows: The client is used to notify the heartbeat function of the client information when the client is started, and continuously and intermittently send heartbeat messages to it. The heartbeat function is used to record the message content in the edge KV when receiving the first heartbeat message of the client, and send a registration request to the source station. If the heartbeat message is found to have timed out, a logout request is sent to the source station. There are only two requests to the source station during the entire client message interaction process (one registration request and one logout request). The heartbeat function is also used to maintain the information in the edge KV to determine whether the client is in a connected state. The message push function is used to monitor the kafka in the local edge pool, subscribe to event messages from the edge kafka and parse them, and send them to the corresponding client according to the information stored in the edge KV. The message push function can also query the address of the client from the edge KV to achieve accurate event message push. After receiving the registration request of the heartbeat function, the source station is used to push the client-related messages in its registration request to the kafka of the corresponding edge pool. After receiving the logout request, the event message push is stopped.

[0116] In an optional implementation, in order to achieve accurate expansion and contraction of computing resources according to the pressure of different push links, the number of heartbeat functions can be elastically expanded according to the number of clients, and the number of message push functions can be elastically expanded according to the amount of messages. Specifically, the multiple heartbeat functions in the system are deployed based on the number of clients; the multiple message push functions in the system are deployed based on the number of messages generated by the source station.

[0117] See also Figure 6 , Figure 6 : is a module schematic diagram of a message push device applied to a source station proposed in an embodiment of the present application, the device comprising:

[0118] A message generating module 601 is used to generate an event message to be pushed using the source station, wherein the event message to be pushed includes at least information of a target client;

[0119] A determination module 602 is configured to determine a target edge pool where the target client is located based on the edge pool information of the target client;

[0120] A first push module 603 is used to push the event message to be pushed to the target edge pool;

[0121] The second push module 604 is configured to push the event message to be pushed to the target client through the message push function of the target edge pool.

[0122] Wherein, the second push module includes:

[0123] A receiving submodule, configured to receive the event message to be pushed through the edge Kafka in the target edge pool;

[0124] An acquisition submodule is used to acquire the event information to be pushed from the edge kafka of the target edge pool through the message push function of the target edge pool, and acquire the address of the target client from the edge KV of the target edge pool;

[0125] The push submodule is used to send the event message to be pushed to the target client based on the address of the target client.

[0126] Wherein, the device further comprises:

[0127] A heartbeat message receiving module, used for receiving a heartbeat message sent by the target client through the target edge pool;

[0128] A storage module, configured to store the heartbeat message to the edge KV of the target edge pool through the heartbeat function of the target edge pool when the heartbeat message is the first heartbeat message, wherein the heartbeat message includes a unique identifier and an address of the target client;

[0129] A registration message sending module, used to send the registration message of the target client to the source station through the heartbeat function of the target edge pool;

[0130] The registration module is used for recording the edge pool information corresponding to the target client after the source station receives the registration message of the target client.

[0131] Wherein, the device further comprises:

[0132] A deregistration message sending module, configured to send a deregistration message to the source station if the heartbeat function of the target edge pool does not receive a heartbeat message sent by the target client within a preset time;

[0133] The deregistration module is used to deregister the edge pool information of the target client after the source station receives the deregistration message.

[0134] See also Figure 7 , Figure 7 : is a module schematic diagram of a message push device applied to a client proposed in an embodiment of the present application, the device comprising:

[0135] The first receiving module 701 is used to receive the event message to be pushed generated by the source station through the edge kafka of the target edge pool, where the event message to be pushed contains at least information of the target client;

[0136] An acquisition module 702 is used to acquire the event message to be pushed from the edge kafka of the target edge pool by using the message push function of the target edge pool;

[0137] The second receiving module 703 is used to use the target client to receive the event message to be pushed obtained from the message push function of the target edge pool, and process it.

[0138] Based on the same application concept, the embodiment of the present application discloses an electronic device in a sixth aspect, Figure 8 A schematic diagram of an electronic device disclosed in an embodiment of the present application is shown. Figure 8 As shown, the electronic device 100 includes: a memory 110 and a processor 120, the memory of the electronic device is not less than 12G, the main frequency of the processor is not less than 2.4GHz, the memory 110 and the processor 120 are connected via a bus communication, and a computer program is stored in the memory 110. The computer program can be run on the processor 120 to implement a message push method disclosed in an embodiment of the present application.

[0139] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0140] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, apparatuses, electronic devices, and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0141] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0142] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0143] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0144] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0145] The above is a detailed introduction to a message push method, system, device and equipment provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A message push method, characterized in that: Applied to a source station, the method includes: The source station is used to generate an event message to be pushed, wherein the event message to be pushed includes at least information of a target client; Based on the edge pool information of the target client, determining the target edge pool where the target client is located; Pushing the event message to be pushed to the target edge pool; The event message to be pushed is pushed to the target client through the message push function of the target edge pool.

2. The message push method according to claim 1, characterized in that: Pushing the event message to be pushed to the target client through the message push function of the target edge pool includes: Receive the event message to be pushed through the edge kafka in the target edge pool; Obtain the event information to be pushed from the edge kafka of the target edge pool through the message push function of the target edge pool, and obtain the address of the target client from the edge KV of the target edge pool; Based on the address of the target client, the event message to be pushed is sent to the target client.

3. The message push method according to claim 1 or 2, characterized in that: The method further comprises: Receiving a heartbeat message sent by the target client through the target edge pool; In the case where the heartbeat message is the first heartbeat message, the heartbeat message is stored in the edge KV of the target edge pool through the heartbeat function of the target edge pool, and the heartbeat message includes the unique identifier and address of the target client; Sending the registration message of the target client to the source station through the heartbeat function of the target edge pool; After receiving the registration message of the target client, the source station records the edge pool information corresponding to the target client.

4. The message push method according to claim 3, characterized in that: The method further comprises: When the heartbeat function of the target edge pool does not receive a heartbeat message sent by the target client within a preset time, sending a logout message to the source station; After receiving the deregistration message, the source station deregisters the edge pool information of the target client.

5. A message push method, characterized in that: Applied to a client, the method comprises: Receive the event message to be pushed generated by the source station through the edge kafka of the target edge pool, where the event message to be pushed contains at least information of the target client; Using the message push function of the target edge pool to obtain the event message to be pushed from the edge kafka of the target edge pool, and push it to the target client; The target client receives and processes the event message to be pushed pushed by the message push function of the target edge pool.

6. A message push system, characterized in that: The system includes: multiple clients, multiple edge pools and a source station, each of the edge pools includes multiple heartbeat functions, an edge KV, multiple message push functions and an edge kafka; The plurality of edge pools and one source station interact with each other to implement the message push method according to any one of claims 1 to 4; The plurality of edge pools and the plurality of clients interact with each other to implement the message push method described in claim 5.

7. The message push system according to claim 6, characterized in that: A plurality of the heartbeat functions in the system are deployed based on the number of the clients; The multiple message push functions in the system are deployed based on the number of messages produced by the source station.

8. A message push device, characterized in that: Applied to a source station, the device comprises: A message generating module, configured to generate an event message to be pushed using the source station, wherein the event message to be pushed includes at least information of a target client; A determination module, configured to determine a target edge pool where the target client is located based on the edge pool information of the target client; A first pushing module, configured to push the event message to be pushed to the target edge pool; The second push module is used to push the event message to be pushed to the target client through the message push function of the target edge pool.

9. A message push device, characterized in that: Applied to a client, the device comprises: A first receiving module is used to receive the event message to be pushed generated by the source station through the edge kafka of the target edge pool, wherein the event message to be pushed includes at least information of the target client; An acquisition module, used for acquiring the event message to be pushed from the edge kafka of the target edge pool by using the message push function of the target edge pool; The second receiving module is used to use the target client to receive the event message to be pushed obtained from the message push function of the target edge pool, and process it.

10. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the message pushing method according to any one of claims 1 to 4, or the message pushing method according to claim 5.

Citation Information

Patent Citations

  • Transparent proxy forwarding method for content distribution network

    CN107347100A

  • Poster generation method and device

    CN111104602A

  • Man-machine conversation-based message pushing method and device

    CN114238600A

  • Data pushing method and system, electronic equipment and storage medium

    CN116506283A

  • Task processing method and device, equipment and storage medium

    CN116560807A