CN116436887A - Method and system for pushing messages - Google Patents
Method and system for pushing messages Download PDFInfo
- Publication number
- CN116436887A CN116436887A CN202310162710.3A CN202310162710A CN116436887A CN 116436887 A CN116436887 A CN 116436887A CN 202310162710 A CN202310162710 A CN 202310162710A CN 116436887 A CN116436887 A CN 116436887A
- Authority
- CN
- China
- Prior art keywords
- client
- message
- push
- clientuuid
- platform
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 26
- 238000012546 transfer Methods 0.000 claims abstract description 6
- 238000004590 computer program Methods 0.000 claims description 4
- 238000013500 data storage Methods 0.000 description 6
- 238000007726 management method Methods 0.000 description 4
- 230000000903 blocking effect Effects 0.000 description 2
- 230000010354 integration Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000005856 abnormality Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000000739 chaotic effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
- H04L63/0435—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
Description
技术领域technical field
本发明涉及通信领域,尤其设计一种消息推送的方法及系统。The present invention relates to the communication field, and in particular designs a method and system for pushing messages.
背景技术Background technique
消息推送作为客户端与服务端连接的重要桥梁,是用户感知信息,体验业务功能的重要交互方式,在系统中搭建消息推送机制使得业务操作可以稳定、及时将推送模块的应用信息传送至用户。当前,互联网大数据发展迅速,用户群体数量庞大,为保证广大用户群可实现功能体验,通常会选择基于第三方推送平台来支持推送服务,在实现信息传递高效的同时也引发了用户信息泄漏的问题。用户的个人数据不属于个人,数据被转手、信息被泄漏,隐私信息变成了各个平台实现商业利益的交易。As an important bridge connecting the client and the server, message push is an important interactive way for users to perceive information and experience business functions. Building a message push mechanism in the system enables business operations to transmit the application information of the push module to users in a stable and timely manner. At present, Internet big data is developing rapidly, and the number of user groups is huge. In order to ensure that the majority of user groups can realize functional experience, they usually choose to support push services based on third-party push platforms, which not only realizes efficient information transmission, but also leads to user information leakage. question. The user's personal data does not belong to the individual, the data is changed hands, the information is leaked, and the private information becomes a transaction for various platforms to realize commercial interests.
发明内容Contents of the invention
为解决上述现有技术的问题,本发明提供了一种消息推送方法及系统。该系统在保证用户使用体验的同时保护用户数据安全,防范信息泄漏风险。In order to solve the above-mentioned problems in the prior art, the present invention provides a message push method and system. The system protects user data security while ensuring user experience, and prevents the risk of information leakage.
本发明的技术内容,包括:The technical contents of the present invention include:
一种消息推送方法,应用于与客户端建立信任关系的私有设备,所述方法包括:A method for pushing messages, applied to a private device establishing a trust relationship with a client, the method comprising:
获取客户端的ClientUUID,并基于所述客户端的包含欲推送消息的业务请求,生成主消息队列;Obtain the ClientUUID of the client, and generate a main message queue based on the client's business request including the message to be pushed;
消费所述主消息队列,得到包含欲推送消息的消息推送通知和所述欲推送消息对应的Message ID与类型;Consuming the main message queue to obtain the message push notification containing the message to be pushed and the Message ID and type corresponding to the message to be pushed;
基于所述客户端的ClientUUID,判断所述客户端是否在线;Based on the ClientUUID of the client, determine whether the client is online;
在所述客户端在线的情况下,将所述消息推送通知推送到客户端;When the client is online, push the message push notification to the client;
在所述客户端不在线的情况下,将所述客户端的ClientUUID、所述Message ID、所述类型以及所述私有设备ID发送至平台,以经由所述平台和第三方平台基于所述客户端的ClientUUID进行信息传递,且使所述客户端基于所述Message ID、所述类型以及所述私有设备ID在所述私有设备中获取所述欲推送消息。When the client is not online, send the client's ClientUUID, the Message ID, the type, and the private device ID to the platform, so as to use the platform and a third-party platform based on the client's The ClientUUID performs information transfer, and enables the client to obtain the message to be pushed from the private device based on the Message ID, the type, and the private device ID.
进一步地,所述基于所述客户端的ClientUUID,判断所述客户端是否在线,包括:Further, the determining whether the client is online based on the ClientUUID of the client includes:
与客户端建立长轮询;Establish a long poll with the client;
当客户端请求poll接口携带加密访问令牌时,保存所述ClientUUID的时间戳;When the client requests the poll interface to carry an encrypted access token, save the timestamp of the ClientUUID;
在当前时间与所述时间戳的差值大于设定值,或发现预设标识符号的情况下,判定所述客户端不在线;其中,所述预设标识符号表示客户端主动断开连接;In the case that the difference between the current time and the timestamp is greater than a set value, or a preset identifier is found, it is determined that the client is not online; wherein the preset identifier indicates that the client actively disconnects;
在当前时间与所述时间戳的差值小于设定值,且未发现预设标识符号的情况下,判定所述客户端在线。If the difference between the current time and the timestamp is less than a set value and no preset identifier is found, it is determined that the client is online.
进一步地,所述将所述消息推送通知推送到客户端,包括:Further, the pushing the message push notification to the client includes:
基于所述消息推送通知,生成客户端消息队列;Generate a client message queue based on the message push notification;
将所述客户端消息队列推送至客户端,以使所述客户端通过加密poll接口,获取欲推送消息。Pushing the client message queue to the client, so that the client obtains the message to be pushed through the encrypted poll interface.
进一步地,在所述客户端不在线的情况下,将所述客户端的ClientUUID、所述MessageID、所述类型以及所述私有设备ID发送至平台,包括:Further, when the client is not online, sending the client's ClientUUID, the MessageID, the type, and the private device ID to the platform, including:
基于所述客户端的ClientUUID、所述消息推送通知的Message ID与类型以及所述私有设备ID,生成离线时消息队列;Generate an offline message queue based on the ClientUUID of the client, the Message ID and type of the message push notification and the private device ID;
设置一预设的时间范围;Set a preset time range;
将所述离线时消息队列对应的线程挂起;Suspend the thread corresponding to the message queue when said offline;
在所述预设的时间范围内,判定所述客户端在线,则基于所述消息推送通知,生成客户端消息队列,并将所述客户端消息队列推送至客户端,以使所述客户端通过加密poll接口,获取欲推送消息;Within the preset time range, if it is determined that the client is online, a client message queue is generated based on the message push notification, and the client message queue is pushed to the client, so that the client Obtain the message to be pushed through the encrypted poll interface;
在所述预设的时间范围内,判定所述客户端不在线,则将所述离线时消息队列发送至平台。If it is determined that the client is not online within the preset time range, the offline message queue is sent to the platform.
进一步地,所述平台基于所述客户端的ClientUUID,且通过第三方平台将所述Message ID传递给所述客户端之后,所述客户端基于所述Message ID、所述类型以及所述私有设备ID在所述私有设备中获取所述欲推送消息,包括:Further, the platform is based on the ClientUUID of the client, and after passing the Message ID to the client through a third-party platform, the client based on the Message ID, the type and the private device ID Obtaining the message to be pushed in the private device includes:
所述平台通过客户端对第三方平台SDK接口的调取,获取所有客户端的deviceToken;The platform obtains the deviceTokens of all clients through the calling of the third-party platform SDK interface by the client;
所述平台基于客户端的ClientUUID,获取该客户端对应的deviceToken,并生成包含所述Message ID、所述类型以及所述私有设备ID的Push消息之后,将所述deviceToken和所述Push消息发送给所述第三方平台;The platform obtains the deviceToken corresponding to the client based on the ClientUUID of the client, and after generating a Push message including the Message ID, the type, and the private device ID, sends the deviceToken and the Push message to the the third-party platform;
所述第三方平台基于所述deviceToken,将所述Push消息推送给客户端;The third-party platform pushes the Push message to the client based on the deviceToken;
所述客户端基于所述Push消息访问所述私有设备,以得到所述欲推送消息。The client accesses the private device based on the Push message to obtain the message to be pushed.
进一步地,所述第三方平台基于所述deviceToken,将所述Push消息推送给客户端,包括:Further, the third-party platform pushes the Push message to the client based on the deviceToken, including:
获取该客户端的所有Push消息;Get all Push messages of this client;
对于所有Push消息,建立Push消息时序;For all Push messages, establish the timing of Push messages;
基于所述Push消息时序,依次将Push消息推送给客户端,Based on the timing sequence of the Push messages, push the Push messages to the client in turn,
进一步地,所述第三方平台包括:友盟Push服务器或华为Push服务器。Further, the third-party platform includes: Youmeng Push server or Huawei Push server.
一种消息推送系统,其特征在于,所述系统包括:A message push system, characterized in that the system includes:
客户端,用于提供客户端的ClientUUID与包含欲推送消息的业务请求;The client is used to provide the ClientUUID of the client and the service request containing the message to be pushed;
私有设备,用于获取客户端的ClientUUID,并基于所述客户端的包含欲推送消息的业务请求,生成主消息队列;消费所述主消息队列,得到包含欲推送消息的消息推送通知和所述欲推送消息对应的Message ID与类型;基于所述客户端的ClientUUID,判断所述客户端是否在线;在所述客户端在线的情况下,将所述消息推送通知推送到客户端;在所述客户端不在线的情况下,将所述客户端的ClientUUID、所述Message ID、所述类型以及所述私有设备ID发送至平台;The private device is used to obtain the ClientUUID of the client, and generate a main message queue based on the client's business request containing the message to be pushed; consume the main message queue to obtain a message push notification containing the message to be pushed and the message to be pushed Message ID and type corresponding to the message; based on the ClientUUID of the client, judge whether the client is online; when the client is online, push the message push notification to the client; when the client is not In the case of online, send the ClientUUID, the Message ID, the type and the private device ID of the client to the platform;
平台,用于基于所述客户端的ClientUUID,将所述客户端的ClientUUID、所述MessageID、所述类型以及所述私有设备ID发送至第三方平台;The platform is configured to send the ClientUUID of the client, the MessageID, the type, and the private device ID to a third-party platform based on the ClientUUID of the client;
第三方平台,用于基于所述客户端的ClientUUID,将所述Message ID、所述类型以及所述私有设备ID发送至客户端。The third-party platform is configured to send the Message ID, the type, and the private device ID to the client based on the ClientUUID of the client.
一种电子设备,包括:An electronic device comprising:
处理器;processor;
用于存储所述处理器可执行指令的存储器;memory for storing said processor-executable instructions;
所述处理器,用于从所述存储器中读取所述可执行指令,并执行所述可执行指令以实现上述任一所述方法。The processor is configured to read the executable instruction from the memory, and execute the executable instruction to implement any one of the above methods.
一种计算机可读存储介质,其上存储有计算机程序指令,其特征在于,该程序指令被处理器执行时,以实现上述任一所述方法。A computer-readable storage medium, on which computer program instructions are stored, is characterized in that, when the program instructions are executed by a processor, any one of the above-mentioned methods can be realized.
与现有技术相比,本发明至少具有如下优势:Compared with the prior art, the present invention has at least the following advantages:
本发明提供的一种消息推送方法及系统,依据客户端的状态设计区别的消息推送模式。当客户端在线状态时实现端对端加密应用内推送,从而可以实现用户及时、快速、高效、稳定、安全接收到消息通知。当客户端离线状态时虽依赖于第三方平台转发实现推送,但第三方无法获取到具体推送内容,从而保证用户数据安全,防止第三方获取数据信息。In the message push method and system provided by the present invention, different message push modes are designed according to the state of the client. When the client is online, the end-to-end encrypted in-app push is realized, so that the user can receive the message notification in a timely, fast, efficient, stable and safe manner. When the client is offline, although it relies on the third-party platform to forward and realize the push, the third party cannot obtain the specific push content, so as to ensure the security of user data and prevent the third party from obtaining data information.
附图说明Description of drawings
图1消息推送系统图。Figure 1. Message push system diagram.
图2消息推送流程图。Figure 2 Message push flow chart.
图3私有设备处理模块运行的具体步骤。Fig. 3 The specific steps of the operation of the private device processing module.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
本发明的消息推送系统包括:客户端、私有设备、平台、第三方平台。所述客户端为用户可以接收到推送消息的终端程序,包括APP、Web、PC。所述平台为所述私有设备与所述客户端的中转调度管理台,用于管理客户端设备标识、中转消息,缓存数据等内容。所述私有设备用于存储、处理业务及推送消息,基于所述客户端状态选择是否接入外部第三方平台(友盟或其他厂商通道)等相关的内容,从而实现消息推送。其可以为包含处理器和存储器的硬件装置,所述存储器中存储有计算机程序,也可以为一种存储介质,所述存储介质中存储有计算机程序。The message push system of the present invention includes: a client, a private device, a platform, and a third-party platform. The client is a terminal program through which users can receive push messages, including APP, Web, and PC. The platform is a transfer scheduling management platform for the private device and the client, and is used to manage client device identification, transfer messages, cached data, and other content. The private device is used to store, process business and push messages, and choose whether to access related content such as external third-party platforms (youmeng or other manufacturers' channels) based on the status of the client, so as to realize message push. It may be a hardware device including a processor and a memory in which a computer program is stored, or a storage medium in which a computer program is stored.
一.消息推送系统的搭建。1. Construction of the message push system.
如图1所示,基于所述客户端的状态将消息推送分为应用内推送与系统推送。当所述客户端在线时,可实现应用内推送。当所述客户端离线时,则需要借助所述平台的转发消息推送至第三方厂商通道发送。As shown in FIG. 1 , message push is divided into in-app push and system push based on the state of the client. When the client is online, in-app push can be implemented. When the client is offline, it needs to use the forwarding message of the platform to push to the channel of the third-party manufacturer for sending.
如图2所示。私有设备的消息推送模块参照客户端ClientUUID的时间戳判断客户端的状态,当客户端在线时,客户端与所述私有设备直接建立长轮询,消息推送模块将欲推送的消息内容发送至客户端clientuuid的单独队列,私有设备将消息内容推送至对应客户端,客户端通过加密poll接口,获取欲推送到该客户端的消息数据,实现应用内推送。所述私有设备属于用户个人的存储设备,所述客户端调用的poll接口采用公私钥加密协商后的对称密钥加密,所包含的消息数据不经平台读取或记录,以保证用户的数据安全。as shown in picture 2. The message push module of the private device judges the status of the client by referring to the timestamp of the client ClientUUID. When the client is online, the client and the private device directly establish a long poll, and the message push module sends the content of the message to be pushed to the client A separate queue for clientuuid, the private device pushes the message content to the corresponding client, and the client obtains the message data to be pushed to the client through the encrypted poll interface to realize in-app push. The private device belongs to the user's personal storage device, and the poll interface invoked by the client is encrypted with a public-private key encryption negotiated symmetric key, and the contained message data is not read or recorded by the platform to ensure the user's data security .
如图3所示,私有设备的消息推送模块参照客户端ClientUUID的时间戳判断客户端的状态,当客户端离线时,消息推送模块将欲推送的消息内容对应发送至push_notification_platform(离线时消息队列)队列,并将Message ID和类型及ClientUUID发送至平台及第三方厂商通道。在此转发过程中传递的为Message ID和类型及ClientUUID,而不包含消息的具体数据内容,其消息本身仍在所述私有设备中存储。所述第三方厂商通道将其返回至目标客户端后,所述客户端基于收到的Message ID向所述私有设备请求获取具体的消息内容。As shown in Figure 3, the message push module of the private device judges the status of the client by referring to the timestamp of the client ClientUUID. When the client is offline, the message push module sends the content of the message to be pushed to the push_notification_platform (message queue when offline) queue , and send the Message ID, type, and ClientUUID to the platform and third-party vendor channels. What is passed in this forwarding process is the Message ID, type and ClientUUID, but does not contain the specific data content of the message, and the message itself is still stored in the private device. After the third-party vendor channel returns it to the target client, the client requests the private device to obtain specific message content based on the received Message ID.
具体地,所述客户端与所述私有设备的调用消息推送的poll接口预设了加密方案,建立信任关系,当客户端向私有设备发起访问请求时会携带accessToken进行认证,以此保证数据安全。Specifically, the poll interface of the call message push between the client and the private device presets an encryption scheme to establish a trust relationship. When the client initiates an access request to the private device, it will carry an accessToken for authentication, thereby ensuring data security. .
具体地,离线的推送方式会相比较于在线的应用内推送方式会存在稍小的延迟,但两种推送方式同时保证了用户的数据安全。Specifically, the offline push method will have a slightly smaller delay than the online in-app push method, but the two push methods simultaneously ensure the user's data security.
具体地,所述私有设备内包含消息推送模块、业务模块、数据存储模块。所述消息推送模块与发送请求的客户端建立消息长轮询,负责调度待推送的消息、加密推送消息数据、准确地推送至所述客户端侧或所述平台侧等内容;所述业务模块接收请求客户端的业务请求,转换生成需要通知的推送消息及消息对应的Message ID并将其全部存放至所述数据存储模块;所述数据存储模块用于记录存储消息推送通知或查询消息通知生成消息队列,且将接收到的消息推送通知发送至消息推送模块。Specifically, the private device includes a message push module, a service module, and a data storage module. The message push module establishes message long polling with the client sending the request, and is responsible for scheduling messages to be pushed, encrypting push message data, and accurately pushing content to the client side or the platform side; the business module Receive the service request of the request client, convert and generate the push message that needs to be notified and the Message ID corresponding to the message and store it all in the data storage module; the data storage module is used to record and store the message push notification or query the message notification to generate the message queue, and send the received message push notification to the message push module.
具体地,所述私有设备中的业务模块会将产生的需通知的消息,存储在数据存储模块的消息队列中;当消息推送模块获取到消息推送通知时,会依据判断对应将其推送至所述平台,可同时处理多条消息、多个客户端的推送需求。Specifically, the service module in the private device will store the generated message to be notified in the message queue of the data storage module; when the message push module obtains the message push notification, it will push it to the corresponding The above platform can handle multiple messages and push requests from multiple clients at the same time.
具体地,所述平台包括管理模块、转发模块、缓存模块。所述转发模块用于校验私有设备身份、接收转发消息并将其发送至对应的第三方厂商通道;所述缓存模块用于缓存一定时效的消息数据,从而支持网络异常或第三方厂商通道系统异常的情况;所述管理模块用于协调管理所述客户端的设备标识(deviceToken)等内容。Specifically, the platform includes a management module, a forwarding module, and a cache module. The forwarding module is used to verify the identity of the private device, receive the forwarded message and send it to the corresponding third-party vendor channel; the cache module is used to cache certain time-sensitive message data, so as to support network abnormalities or third-party vendor channel systems Abnormal situation: the management module is used for coordinating and managing the device identification (deviceToken) and other content of the client.
具体地,所述消息推送的下发会遵循时序一致,按序推送以避免出现同一客户端多条消息混乱推送的结果。Specifically, the delivery of the message push will follow the same time sequence, and push in order to avoid the result of chaotic push of multiple messages from the same client.
二.平台的集成。2. Platform integration.
以客户端侧APP为实施例,所述客户端侧APP会生成一ClientUUID,作为对应用户设备的唯一识别码,用于后续消息推送在私有设备侧和平台侧的对接;集成其他可选择的第三方厂商通道,如友盟Push服务器、华为Push服务器等。所述平台面向所述私有设备设置消息推送接口,通过boxRegKey鉴权,校验所述私有设备的身份信息;根据客户端侧APP状态判定推送通道,通过使用ClientUUID标识目标推送设备定向推送消息。所述平台面向所述客户端的APP侧设置deviceToken注册接口,该deviceToken与App侧之前生成的ClientUUID一一对应,所述deviceToken为APP集成第三方厂商通道SDK时获取到的设备身份标识,且需向所述平台侧注册该身份凭证。具体的,所述平台对推送的消息进行中转,对推送消息数据不做读取和记录,只传递消息中的Message ID。通过平台转发至友盟或第三方厂商的通道,其消息时序不由所述平台决定,基于选择的友盟或第三方厂商而保证。Taking the client-side APP as an example, the client-side APP will generate a ClientUUID as the unique identification code of the corresponding user equipment, which is used for the connection between the private device side and the platform side for subsequent message push; integration of other optional first Three-party vendor channels, such as Youmeng Push server, Huawei Push server, etc. The platform sets a message push interface for the private device, and verifies the identity information of the private device through boxRegKey authentication; determines the push channel according to the status of the client-side APP, and uses the ClientUUID to identify the target push device to push messages. The platform sets a deviceToken registration interface for the APP side of the client, and the deviceToken corresponds to the ClientUUID previously generated on the App side. The platform side registers the identity certificate. Specifically, the platform relays the pushed message, does not read and record the pushed message data, and only transmits the Message ID in the message. For the channel forwarded by the platform to Youmeng or a third-party manufacturer, the timing of the message is not determined by the platform, but is guaranteed based on the selected Youmeng or third-party manufacturer.
其中,以客户端侧APP形式为实施例,用户实现消息推送的具体步骤:Among them, taking the form of client-side APP as an example, the specific steps for users to implement message push:
1.APP端预设如友盟、华为等第三方厂商的PushSDK。当用户客户端APP在线时,则通过应用内直接推送。当用户客户端离线时,则通过接入友盟或转为其他第三方厂商通道推送;APP端通过调用友盟SDK接口调取可以得到deviceToken;1. The APP is preset with the PushSDK of third-party manufacturers such as Youmeng and Huawei. When the user client APP is online, it is directly pushed through the application. When the user client is offline, it will be pushed by connecting to Youmeng or other third-party manufacturer channels; the APP can get the deviceToken by calling the Youmeng SDK interface;
2.APP端将所获取到的deviceToken上报至所述平台;2. The APP reports the obtained deviceToken to the platform;
3.所述私有设备、所述平台管理模块使用保存的deviceToken调用友盟(Push服务端)提供的API推送Push消息。3. The private device and the platform management module use the saved deviceToken to call the API provided by Youmeng (Push server) to push the Push message.
4.友盟Push服务器将从平台获得的Push消息,通过其他第三方厂商Push服务器中转,将发送给deviceToken对应的用户设备,设备接收Push消息。4. The Umeng Push server will transfer the Push message obtained from the platform through the Push server of other third-party manufacturers, and will send it to the user device corresponding to the deviceToken, and the device will receive the Push message.
可选地,当其他第三方厂商的Push服务器检测到设备回复消息响应时,将响应状态回执给友盟Push服务器,友盟Push服务器便可在APP上显示通知提示。Optionally, when the Push server of another third-party manufacturer detects that the device replies with a message, it will send the response status back to the Umeng Push server, and the Umeng Push server can display a notification prompt on the APP.
三.所述客户端与私有设备的消息推送模块的架构。3. The structure of the message push module of the client and the private device.
所述消息推送模块与发送请求的客户端建立消息长轮询,负责接收消息推送通知、加密推送数据、准确推送至所述平台侧等内容。所述消息推送模块接收来自所述客户端的需推送消息的业务请求后,会将其存储在主消息队列push_notification中。有多个客户端同时向所述私有设备发送推送消息的业务需求,不同的客户端会自形成一个单独的消息队列,以对应的ClientUUID为标识排列。The message push module establishes message long polling with the client that sends the request, and is responsible for receiving message push notifications, encrypting push data, and accurately pushing to the platform side. After the message push module receives the service request to push the message from the client, it will store it in the main message queue push_notification. If there are business requirements for multiple clients to send push messages to the private device at the same time, different clients will form a separate message queue, which will be identified by the corresponding ClientUUID.
具体地,来自于业务模块的业务请求消息将会直接进入所述消息推送模块的主消息队列push_notification。根据客户端的状态,进行消息提取,拆分消息存入对应消息队列,同时进行自动化存储以支持后续查阅使用。若客户端(APP)在线时,将其对应发送至客户端ClientUUID的单独队列;若客户端(APP)离线时,发送push_notification_platform将其对应推送至所述平台,所述平台依据上述第二方面,将消息推送至对应设备。Specifically, the service request message from the service module will directly enter the main message queue push_notification of the message push module. According to the status of the client, the message is extracted, the message is split and stored in the corresponding message queue, and the automatic storage is carried out at the same time to support subsequent reference and use. If the client (APP) is online, send it to the separate queue of the client ClientUUID; if the client (APP) is offline, send push_notification_platform to push it to the platform, and the platform is based on the second aspect above, Push the message to the corresponding device.
具体地,所述客户端侧设置有接口轮询,用于读取判断当前的ClientUUID单独消息队列中是否有消息挤压,若有检测到存在消息挤压情况则直接将其返回至接口。Specifically, the client side is provided with interface polling, which is used to read and judge whether there is a message squeeze in the current ClientUUID individual message queue, and if a message squeeze is detected, it is directly returned to the interface.
具体地,判断客户端状态以ClientUUID的时间戳为参照。当请求poll接口携带加密访问令牌(accestoken)时,所述私有设备会保存对应的ClientUUID和时间戳。若对应时间戳>1min,则认为此时的客户端状态默认为离线,若用户主动断开连接时间戳会显示预设的标识符号,此时也代表为离线。确定客户端离线后,会预设时间(如3s)定时任务检测push_notification_platform队列中是否有消息,避免出现消息漏转的可能。Specifically, the time stamp of the ClientUUID is used as a reference for judging the state of the client. When requesting the poll interface to carry an encrypted access token (accestoken), the private device will save the corresponding ClientUUID and timestamp. If the corresponding timestamp is > 1min, the client status at this time is considered to be offline by default. If the user actively disconnects, the timestamp will display a preset identification symbol, which also means offline at this time. After confirming that the client is offline, a preset time (such as 3s) will be used to detect whether there is a message in the push_notification_platform queue to avoid the possibility of missing messages.
其中,所述私有设备处理模块运行的具体步骤,见图2:Wherein, the specific steps of the operation of the private device processing module are shown in Figure 2:
1.所述客户端发出消息推送需求启动线程,所述私有设备业务模块接收来自所述客户端的需推送消息的业务请求,所述数据存储模块记录存储消息推送通知或查询消息通知生成消息队列,且将接收到的消息推送通知发送至消息推送模块。1. The client sends a message push request to start a thread, the private device business module receives a service request from the client that needs to push a message, and the data storage module records and stores a message push notification or a query message notification to generate a message queue, And send the received message push notification to the message push module.
2.消息推送模块接收后,基于消息队列和客户端ClientUUID的时间戳判断客户端的在线状态。若客户端在线时,将其对应发送至客户端ClientUUID的单独队列;若客户端离线时,发送push_notification_platform将其转发推送至所述平台;2. After the message push module receives it, it judges the online status of the client based on the message queue and the timestamp of the ClientUUID of the client. If the client is online, send it to the separate queue of the client ClientUUID; if the client is offline, send push_notification_platform to forward it to the platform;
3.所述客户端在线时,携带accesToken访问poll接口。非阻塞时,所述消息推送模块从所述数据存储模块中读取消息,从获取到的accesToken中获取ClientUUID。所述消息推送模块读取到消息会作为历史记录自动存入数据库,形成包含对称密钥加密信息的消息体返回至客户端。若所述消息推送模块没有收到消息,会采用阻塞式,当前线程被挂起,若在预设的时间范围内,仍然没有消息,则超时返回空消息体;若在预设的时间范围内有消息,则和上述步骤相同,读取后直接返回至客户端,同样存入数据库。3. When the client is online, it carries accesToken to access the poll interface. When not blocking, the message push module reads the message from the data storage module, and obtains the ClientUUID from the obtained accesToken. The message read by the message push module will be automatically stored in the database as a historical record, and a message body containing symmetric key encrypted information will be formed and returned to the client. If the message push module does not receive the message, it will adopt a blocking type, and the current thread will be suspended. If there is still no message within the preset time range, an empty message body will be returned overtime; if it is within the preset time range If there is a message, it is the same as the above steps. After reading it, it will be directly returned to the client and stored in the database.
4.所述客户端离线时,会设置时间段检测push_notification_platform队列中的消息。4. When the client is offline, it will set a time period to detect messages in the push_notification_platform queue.
尽管为说明目的公开了本发明的具体实施例和附图,其目的在于帮助理解本发明的内容并据以实施,但是本领域的技术人员可以理解:在不脱离本发明及所附的权利要求的精神和范围内,各种替换、变化和修改都是可能的。因此,本发明不应局限于最佳实施例和附图所公开的内容,本发明要求保护的范围以权利要求书界定的范围为准。Although specific embodiments and drawings of the present invention are disclosed for the purpose of illustration, the purpose is to help understand the content of the present invention and implement it accordingly, but those skilled in the art can understand that: without departing from the present invention and the appended claims Various substitutions, changes and modifications are possible within the spirit and scope of . Therefore, the present invention should not be limited to the content disclosed in the preferred embodiments and drawings, and the protection scope of the present invention should be defined by the claims.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310162710.3A CN116436887A (en) | 2023-02-24 | 2023-02-24 | Method and system for pushing messages |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310162710.3A CN116436887A (en) | 2023-02-24 | 2023-02-24 | Method and system for pushing messages |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN116436887A true CN116436887A (en) | 2023-07-14 |
Family
ID=87082170
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202310162710.3A Pending CN116436887A (en) | 2023-02-24 | 2023-02-24 | Method and system for pushing messages |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN116436887A (en) |
-
2023
- 2023-02-24 CN CN202310162710.3A patent/CN116436887A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| KR100924692B1 (en) | Data transmission system, apparatus and method for processing information, apparatus and method for relaying data, and storage medium | |
| EP1396987A2 (en) | Separation of presence determination and communication establishment | |
| JP2004531798A5 (en) | ||
| US20090030917A1 (en) | Multimedia messaging service-based database synchronization | |
| WO2007015726A1 (en) | Context based action through data aggregation | |
| CN101485173A (en) | Remotely update the user status stored on the server | |
| JP3434209B2 (en) | Communication tool use status transmission method, server device, client terminal device, and program recording medium thereof | |
| US8572263B1 (en) | Push gateway systems and methods | |
| JP2012512448A (en) | Method and configuration for creating a virtual relationship between communication devices to publish personal data | |
| JP4771744B2 (en) | IMPS client state information synchronization method | |
| US11575767B2 (en) | Targeted notification of content availability to a mobile device | |
| CN101156407B (en) | Method for providing content over a communication network | |
| CN1939035B (en) | Method and apparatus for communicating data between computer devices | |
| US7779115B2 (en) | Method and apparatus for processing client capability information over a network | |
| CN1859403B (en) | Method for Capability Negotiation in Client/Server Mode Service System | |
| JP4989713B2 (en) | Information distribution method in presence service system | |
| CN116436887A (en) | Method and system for pushing messages | |
| WO2016177222A1 (en) | Missed call reminding method and device | |
| KR20120052444A (en) | File transmission management system and file transmission mangement method for supporting file transmission in mobile messaging service | |
| CN1852111B (en) | Methods of Information Access in Instant Messenger | |
| JP5042910B2 (en) | Presence service system and presence display method | |
| CN114363408A (en) | Information pushing method and device, computer readable medium and computer equipment | |
| JP2006244100A (en) | Presence information distribution system | |
| US8285784B2 (en) | Service creation via presence messaging | |
| US7904506B2 (en) | Context information management system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |