Message pushing method and device, computer device and readable storage medium
By dynamically adjusting the device token to select the appropriate push channel, the problem of cross-border message push failures was solved, resulting in a more stable message push service.
Patent Information
- Application Number
- CN202411633737.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2044-11-14
AI Technical Summary
In cross-border usage scenarios, due to differences in networks and services in different regions, using a single message push channel can lead to message push failures and reduced stability.
By acquiring device tokens with execution order, the system prioritizes the target device token to generate message push requests, and switches to the next device token if the push fails, until success is achieved, dynamically adjusting the push channel.
It improves the stability and continuity of the push notification service, avoiding push failures.
Smart Images

Figure CN119766770B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of Internet, in particular to a message pushing method and device, computer equipment, readable storage medium and computer program product. BACKGROUND
[0002] With the accelerated development of the Internet, the content information generated on the network is not only huge in number, but also increases at a high speed every day. With the development of instant communication technology, communication between people becomes faster, for example, A user has a text chat with B user through a instant communication software and b instant communication software, in order to improve the security and privacy of information interaction, a message pushing channel is often used as a bridge for information interaction between A user and B user, and A user sends the message to be sent to B user's b instant communication software through the message pushing channel. However, in the cross-country use scene, for example, A user is in the United States and B user is in China, due to the network and service difference of different regions, using a single message pushing channel will cause message pushing failure and reduce the stability of message pushing. SUMMARY
[0003] Embodiments of the present application provide a message pushing method, device, computer equipment, readable storage medium and computer program product, which mainly aims to solve the problem that due to the network and service difference of different regions, using a single message pushing channel will cause message pushing failure and reduce the stability of message pushing.
[0004] According to the first aspect of the present application, a message pushing method is provided, comprising:
[0005] In response to a message sending signal, determining a to-be-pushed message and specific identification information of a message receiver, and obtaining at least one device token with execution order;
[0006] Selecting a device token ranked first from the at least one device token with execution order as a first target device token, and generating a first message pushing request based on the to-be-pushed message, the specific identification information and the first target device token, and sending the first message pushing request to the first target pushing service channel indicated by the first target device token, so that the first target pushing service channel extracts the to-be-pushed message and the specific identification information from the first message pushing request when receiving the first message pushing request, and pushes the to-be-pushed message to the message receiver indicated by the specific identification information, and generates first pushing result information based on the first response result when receiving the first response result returned by the message receiver, and returns the first pushing result information;
[0007] If the first push result information indicates that the message push fails, a device token ranked second is selected as a second target device token from the at least one device token with execution sequence, a second message push request is generated based on the to-be-pushed message, the specific identification information and the second target device token, the second message push request is sent to a second target push service channel indicated by the second target device token, so that the second target push service channel extracts the to-be-pushed message and the specific identification information from the second message push request when the second message push request is received, and pushes the to-be-pushed message to a message receiver indicated by the specific identification information, and when a second response result returned by the message receiver is received, first push result information is generated based on the second response result and is returned, and the above operation is repeated until the final push result information indicates that the message push succeeds.
[0008] Optionally, before the response to the message sending signal, determining the to-be-pushed message and the specific identification information of the message receiver, and obtaining the at least one device token with execution sequence, further include:
[0009] In response to the channel address acquisition signal, a plurality of push service channel addresses associated with the channel address acquisition signal are acquired, and a corresponding token acquisition request is generated based on each push service channel address, and the token acquisition request is sent to a push service channel indicated by the corresponding push service channel address, so that the push service channel generates and returns a corresponding device token in response to the token acquisition request;
[0010] Obtaining at least one device token, determining the priority of each device token in the at least one device token, marking each device token according to the priority, obtaining the at least one device token with execution sequence, and storing the at least one device token with execution sequence.
[0011] Optionally, after the at least one device token is obtained, further include:
[0012] Each device token in the at least one device token is encrypted by using an asymmetric encryption algorithm to obtain at least one encrypted device token.
[0013] Optionally, after the at least one device token is obtained, further include:
[0014] Determine the applicable area information of the push service channel indicated by each encrypted device token, and mark the corresponding encrypted device token by using the applicable area information to obtain the at least one marked device token;
[0015] store the labeled at least one device token;
[0016] in response to the message push request, obtaining the to-be-pushed message carried by the message push request, the specific identification information of the message receiver, and the labeled at least one device token;
[0017] obtaining the current location information of the message sender, and selecting a device token in the labeled at least one device token that matches the current location information and the applicable area information as a target device token;
[0018] generating a message push request based on the to-be-pushed message, the specific identification information, and the target device token, and sending the message push request to the target push service channel indicated by the target device token, so that the target push service channel extracts the to-be-pushed message and the specific identification information from the message push request when receiving the message push request, and pushes the to-be-pushed message to the message receiver indicated by the specific identification information.
[0019] Optionally, before the response to the message sending signal, determining the to-be-pushed message and the specific identification information of the message receiver, and obtaining the at least one device token with an execution order, further comprises:
[0020] obtaining a device token list, the device token list comprising a plurality of probe push service channel addresses and a device token corresponding to each probe push service channel address;
[0021] extracting a plurality of probe push service channel addresses from the device token list, and generating a plurality of probe requests based on the plurality of probe push service channel addresses, wherein each probe request corresponds to a probe push service channel address;
[0022] sending the corresponding probe request to the probe push service channel indicated by each probe push service channel address, so that each probe push service channel generates and returns the corresponding probe result in response to the probe request;
[0023] If no probe result returned by a probe push service channel is received within a preset time interval, it is determined that the device token corresponding to the probe push service channel has changed, and a token acquisition request is re-sent to the probe push service channel, so that the probe push service channel generates and returns an updated device token in response to the token acquisition request;
[0024] The corresponding device token in the device token list is replaced with the updated device token corresponding to the probe push service channel to obtain an updated device token list, and the updated device token list is stored.
[0025] Optionally, the method further comprises:
[0026] In response to the message sending signal, determining the to-be-pushed message, the region information to which the message sender belongs, and the specific identification information of the message receiver, and selecting a device token from the at least one device token with execution sequence as a target device token;
[0027] Obtaining a sensitive information blacklist associated with the region information, and determining that the sensitive information blacklist comprises a plurality of sensitive information;
[0028] Using a semantic matching algorithm to match the to-be-pushed message with each sensitive information in the plurality of sensitive information, obtaining a matching result, and when it is determined that the matching result indicates that the to-be-pushed message has target content matching a sensitive information in the plurality of sensitive information, using a preset color to cover the target content or using a preset symbol to replace the target content, to obtain a processed to-be-pushed message;
[0029] Based on the processed to-be-pushed message, the specific identification information, and the target device token, generating a message push request, and sending the message push request to a target push service channel indicated by the target device token, so that the target push service channel extracts the processed to-be-pushed message and the specific identification information from the message push request when receiving the message push request, and pushes the processed to-be-pushed message to the message receiver indicated by the specific identification information.
[0030] According to the second aspect of the present application, a message pushing device is provided, comprising:
[0031] A determining module is configured to, in response to a message sending signal, determine a to-be-pushed message carried by the message sending request, specific identification information of a message receiver, and obtain at least one device token with execution sequence;
[0032] A first pushing module is configured to select a device token ranked first from the at least one device token with execution sequence as a first target device token, and based on the to-be-pushed message, the specific identification information, and the first target device token, generate a first message push request, and send the first message push request to the first target push service channel indicated by the first target device token, so that the first target push service channel extracts the to-be-pushed message and the specific identification information from the first message push request when receiving the first message push request, and pushes the to-be-pushed message to the message receiver indicated by the specific identification information, and when receiving a first response result returned by the message receiver, generates first push result information based on the first response result and returns the first push result information;
[0033] The second pushing module is configured to: if the first pushing result information indicates that the message pushing fails, select a device token ranked second from the at least one device token with the execution sequence as a second target device token, and generate a second message pushing request based on the message to be pushed, the specific identification information and the second target device token; and send the second message pushing request to a second target pushing service channel indicated by the second target device token, so that the second target pushing service channel extracts the message to be pushed and the specific identification information from the second message pushing request when receiving the second message pushing request, pushes the message to be pushed to a message receiver indicated by the specific identification information, and generates first pushing result information based on a second response result returned by the message receiver when receiving the second response result, and returns the first pushing result information, and repeats the above operations until a final pushing result information indicates that the message pushing succeeds.
[0034] According to a third aspect of the present application, a computer device is provided, including a memory and a processor, the memory stores a computer program, and the processor implements the steps of the method in any one of the first aspect when executing the computer program.
[0035] According to a fourth aspect of the present application, a readable storage medium is provided, which stores a computer program, and the computer program implements the steps of the method in any one of the first aspect when executed by a processor.
[0036] According to a fifth aspect of the present application, a computer program product is provided, which includes a computer program, and the computer program implements the steps of the method in any one of the first aspect when executed by a processor.
[0037] By employing the above technical solutions, this application provides a message push method, apparatus, computer device, readable storage medium, and computer program product. Upon receiving a message sending signal, this application can acquire at least one device token with an execution order. From the at least one device token, the device token ranked first is selected as the target device token, and the message push request is preferentially sent to the target push service channel indicated by the target device token. The target push service channel sends the push message carried by the message push request to the corresponding message receiver. Simultaneously, a response result is received from the message receiver, indicating whether the message push was successful. Based on the response result, the target push service channel generates push result information and pushes this information to the consumer sender. The message sender determines whether the message push was successful based on the push result information. If unsuccessful, other target device tokens are selected sequentially, and the above operation is repeated until the final push result information indicates successful message push. Through this process, the message push channel can be dynamically adjusted to avoid message push failures, improving the stability and continuity of the message push service. Attached Figure Description
[0038] Figure 1 A flowchart of a message push method provided in an embodiment of this application is shown;
[0039] Figure 2 A flowchart of another message push method provided in an embodiment of this application is shown;
[0040] Figure 3A This paper shows a schematic diagram of the structure of a message push device provided in an embodiment of this application;
[0041] Figure 3B This paper shows a schematic diagram of the structure of a message push device provided in an embodiment of this application;
[0042] Figure 3C This paper shows a schematic diagram of the structure of a message push device provided in an embodiment of this application;
[0043] Figure 3D This paper shows a schematic diagram of the structure of a message push device provided in an embodiment of this application;
[0044] Figure 4 A schematic diagram of the device structure of a computer device provided in an embodiment of this application is shown. Detailed Implementation
[0045] Various embodiments and features of this application are described herein with reference to the accompanying drawings.
[0046] It is to be understood that various modifications can be made to the embodiments described herein. Thus, the description is not to be considered as limiting, but merely as a description of exemplary embodiments. Other modifications of the application will occur to those skilled in the art upon reading the description of the application.
[0047] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the application and, together with the general description of the application given above, and the detailed description of the embodiments given below, serve to explain the principles of the present application.
[0048] These and other characteristics of the present application will become apparent upon consideration of the following detailed description of preferred forms of the application, given by way of non-limiting example, with reference to the accompanying drawings.
[0049] It should also be understood that, although the present application has been described above with reference to particular means, materials and embodiments, the application is not limited to the particulars described and as such extends to all alternative constructions that are within the scope of the present application.
[0050] The above and other aspects, features and advantages of the present application will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings, in which:
[0051] Specific embodiments of the present application are described hereinafter, by way of non-limiting example; however, it should be understood that the claimed embodiments are merely examples of the present application, which can be implemented in numerous ways. Well-known and / or redundant functions and structures have not been described in detail to avoid obscuring the present application unnecessarily. Therefore, specific structural and functional details disclosed herein are not intended to limit the claimed embodiments, but merely as a representative basis for teaching one skilled in the art to employ the present application in virtually any appropriate detailed structure.
[0052] The specification can use phrases such as "in one embodiment", "in another embodiment", "in yet another embodiment", or "in other embodiments", which can refer to one or more of the same or different embodiments of the application.
[0053] The embodiments of the present application provide a message pushing method, as shown in the following Figure 1 The method comprises the following steps:
[0054] 101. In response to a message sending signal, determining a to-be-pushed message and specific identification information of a message receiver, and obtaining at least one device token with an execution sequence;
[0055] In the embodiments of the present application, the execution subject can be a message sender, the message sender can be an application program for sending messages, for example, instant messaging software, etc., and the message sender can also be a client. For example, when A user and B user chat through WeChat, A user sends relevant messages to B user's WeChat through WeChat. This message interaction process needs a push service channel to push messages. In a specific application scenario, A user inputs relevant messages into the chat interface of WeChat through an input method, and then user A triggers a sending button. At this time, for the message sender, it is equivalent to receiving a message sending signal. After determining the message to be sent and the specific identification information (for example, appID) of B user's WeChat, the message sender can obtain a pre-stored device token list from a database or locally, and extract at least one device token with execution order from the device token list.
[0056] 102、selecting a device token ranked first from the at least one device token with execution order as a first target device token, and generating a first message push request based on the message to be pushed, the specific identification information and the first target device token, and sending the first message push request to a first target push service channel indicated by the first target device token, so that the first target push service channel extracts the message to be pushed and the specific identification information from the first message push request when receiving the first message push request, and pushes the message to be pushed to a message receiver indicated by the specific identification information, and generates first push result information based on a first response result returned by the message receiver when receiving the first response result, and returns the first push result information.
[0057] 103、if the first push result information indicates that the message push fails, selecting a device token ranked second from the at least one device token with execution order as a second target device token, and generating a second message push request based on the message to be pushed, the specific identification information and the second target device token, and sending the second message push request to a second target push service channel indicated by the second target device token, so that the second target push service channel extracts the message to be pushed and the specific identification information from the second message push request when receiving the second message push request, and pushes the message to be pushed to a message receiver indicated by the specific identification information, and generates first push result information based on a second response result returned by the message receiver when receiving the second response result, and returns the first push result information, and repeating the above operations until the final push result information indicates that the message push succeeds.
[0058] In the embodiments of the present application, in order to ensure the continuity and stability of the push service, the present application can realize message push through multiple channels, that is, when push fails in one channel, other channels can be selected for message push, and the push failure situation will not occur. For example, two channels can be configured in advance to realize message push, Firebase Cloud Messaging (FCM, Firebase Cloud Messaging) and Umeng Push. Firebase Cloud Messaging is suitable for global range, but it depends on the application of Google service, while Umeng Push focuses on China region, and is particularly suitable for applications that need to work in domestic network environment. For user A from China, the preferred push service channel is Umeng Push, and Firebase Cloud Messaging can be used as a backup for user A. When user A goes abroad, the priority of the push service channel does not change, that is, Umeng Push is still preferred in other countries. At this time, due to the large difference between foreign network environment and Chinese network environment, using Umeng Push may cause message push failure problem, and user B who communicates with user A online cannot receive the message sent by user A. In this case, the backup Firebase Cloud Messaging can be selected for message push. In actual application, many kinds of push service channels can be configured, such as a country universal a message push channel, b country universal b message push channel, c country universal c message push channel, etc. In this way, no matter which country user A goes to, he can choose a suitable message push channel.
[0059] The method provided by the embodiments of the present application can obtain at least one device token with execution order when receiving a message sending signal, select a device token ranked first as a target device token from the at least one device token, and preferentially send a message push request to a target push service channel indicated by the target device token. The target push service channel will send a push message carried by the message push request to the corresponding message receiver. At the same time, a response result returned by the message receiver will also be received. The response result is used to indicate whether the message is successfully pushed. The target push service channel will generate push result information based on the response result and push the push result information to the consuming sender. The message sender will determine whether the message push is successful based on the push result information. If not, other target device tokens will be selected in order, and the above operation will be repeated until the final push result information indicates that the message push is successful. Through the above process, the message push channel can be dynamically adjusted to avoid message push failure, and the stability and continuity of the message push service are improved.
[0060] Further, as a refinement and extension of the specific implementation of the above embodiments, in order to completely describe the specific implementation of the present embodiment, the present embodiment provides another message push method, as follows:Figure 2 As shown, comprising:
[0061] 201, acquire at least one device token with execution order, and store at least one device token with execution order.
[0062] In the embodiment of the present application, the message sender acquires a plurality of push service channel addresses associated with the channel address acquisition signal in response to the channel address acquisition signal, and generates a corresponding token acquisition request based on each push service channel address, and sends the token acquisition request to the push service channel indicated by the corresponding push service channel address, so that the push service channel generates and returns the corresponding device token in response to the token acquisition request; in this way, at least one device token is obtained, at the same time, the priority of each device token in the at least one device token is determined, each device token is labeled according to the priority, at least one device token with execution order is obtained, and at least one device token with execution order is stored. It should be noted that the developer integrates the SDK (software development kit) of the push service such as Firebase or UMeng in the application program (which can be understood as the message sender), and the start of the application program can be understood as a channel address acquisition signal, and then the application program will automatically acquire a plurality of push service channel addresses.
[0063] It should be noted that if the push service channel is Firebase cloud message service, when the message sender tries to acquire the Firebase device token, the Firebase cloud message service will provide a callback interface, if the Firebase device token can be acquired, the callback function will return the Firebase device token, if the token acquisition fails, the callback function will return error information. Common failure reasons are: service unavailable: Firebase server failure or inaccessible in certain areas (such as some areas prohibit Google service). Permission problem: the user does not grant notification permission, resulting in failure to generate device token. Device environment problem: such as the device does not support Google Play service. At the same time, when the message sender receives the error information, it will record the error occurrence time, and within a preset time period after the error occurrence time, it will repeatedly execute the operation of acquiring the Firebase device token, if the Firebase device token is still not successfully acquired within the preset time period, generate failure information based on the Firebase cloud message service address, and send the failure information to the operation and maintenance personnel, so that the operation and maintenance personnel can determine the Firebase cloud message service address based on the Firebase cloud message service address when receiving the failure information, and perform troubleshooting. At the same time, based on the error occurrence time, location and error information, troubleshooting logs can also be generated for developers or operation and maintenance personnel to analyze problems in the future.
[0064] 202、obtain at least one encrypted device token.
[0065] In the embodiment of the present application, after obtaining the at least one device token, the asymmetric encryption algorithm can also be used to encrypt each device token in the at least one device token to obtain at least one encrypted device token. In another optional implementation of the embodiment of the present application, the symmetric encryption algorithm can also be used to encrypt each device token in the at least one device token. It should be noted that the asymmetric encryption algorithm or the symmetric encryption algorithm can be flexibly selected according to actual conditions. Through the encryption processing, it can be ensured that the device token cannot be stolen or modified by a third party in the transmission process.
[0066] It should be noted that after obtaining the at least one encrypted device token, the push service channel can be selected according to the priority, see step 203, or the push service channel can be dynamically selected according to the specific application scenario, see step 204.
[0067] 203、select a target message push channel according to the priority.
[0068] In the embodiment of the present application, the device token ranked first in the at least one device token with execution order can be selected as a first target device token, and a first message push request is generated based on the to-be-pushed message, the specific identification information and the first target device token, and the first message push request is sent to a first target push service channel indicated by the first target device token, so that the first target push service channel extracts the to-be-pushed message and the specific identification information from the first message push request when receiving the first message push request, and pushes the to-be-pushed message to a message receiver indicated by the specific identification information, and generates first push result information based on a first response result returned by the message receiver when receiving the first response result, and returns the first push result information; if the first push result information indicates that the message push fails, a device token ranked second in the at least one device token with execution order is selected as a second target device token, and a second message push request is generated based on the to-be-pushed message, the specific identification information and the second target device token, and the second message push request is sent to a second target push service channel indicated by the second target device token, so that the second target push service channel extracts the to-be-pushed message and the specific identification information from the second message push request when receiving the second message push request, and pushes the to-be-pushed message to a message receiver indicated by the specific identification information, and generates first push result information based on a second response result returned by the message receiver when receiving the second response result, and returns the first push result information, and the above operation is repeated until the final push result information indicates that the message push is successful.
[0069] 204、select a target message push channel according to the current location information.
[0070] In the embodiments of the present application, in addition to selecting the push service channel according to the priority, the push service channel can also be dynamically selected according to the specific application scene, that is, after obtaining the at least one encrypted device token, the applicable area information of the push service channel indicated by each encrypted device token is determined, the corresponding encrypted device token is marked by using the applicable area information, and the at least one marked device token is obtained; the at least one marked device token is stored; in response to a message push request, the to-be-pushed message carried by the message push request, the specific identification information of the message receiver, and the at least one marked device token are obtained; the current location information of the message sender is obtained, and one device token in the at least one marked device token whose current location information matches the applicable area information is selected as a target device token; a message push request is generated based on the to-be-pushed message, the specific identification information and the target device token, the message push request is sent to the target push service channel indicated by the target device token, so that when the target push service channel receives the message push request, the to-be-pushed message and the specific identification information are extracted from the message push request, and the to-be-pushed message is pushed to the message receiver indicated by the specific identification information. That is, the current location information of the message sender can be used to dynamically adjust the channel, for example, if the message sender is located abroad, the firebase channel is preferentially used, and if the message sender is located in China, the Youmeng channel is preferentially used. The message sender's historical push results can also be used to dynamically adjust the channel, for example, if the Firebase push fails twice in succession, the Youmeng push is preferentially selected in the next push.
[0071] 205、update the device token.
[0072] In the embodiments of the present application, the device token is not permanent, and the Firebase Cloud Message service updates the device token irregularly. This means that the message sender needs to listen to the change event of the device token and reacquire and upload to the message sender when the device token is updated, that is, first, a device token list is acquired, the device token list including a plurality of probe push service channel addresses and a device token corresponding to each probe push service channel address; then, a plurality of probe push service channel addresses are extracted from the device token list, and a plurality of probe requests are generated based on the plurality of probe push service channel addresses, wherein each probe request corresponds to a probe push service channel address; then, the corresponding probe request is sent to the probe push service channel indicated by each probe push service channel address, so that each probe push service channel generates and returns the corresponding probe result in response to the probe request; if the probe result returned by a probe push service channel is not received within a preset time interval, it is determined that the device token corresponding to the probe push service channel has changed, and a token acquisition request is re-sent to the probe push service channel, so that the probe push service channel generates and returns the updated device token in response to the token acquisition request; finally, the updated device token corresponding to the probe push service channel is used to replace the corresponding device token in the device token list to obtain an updated device token list, and the updated device token list is stored.
[0073] In addition to the message pushing method described above, the embodiment of the application further provides another message pushing method, that is, a message sender determines a to-be-pushed message, area information to which the message sender belongs, and specific identification information of a message receiver in response to a message sending signal, and selects a device token from at least one device token with an execution sequence as a target device token; acquires a sensitive information blacklist associated with the area information, and determines that the sensitive information blacklist includes a plurality of sensitive information; matches the to-be-pushed message with each sensitive information in the plurality of sensitive information by using a semantic matching algorithm to obtain a matching result, and when it is determined that the matching result indicates that the to-be-pushed message has target content matching a sensitive information in the plurality of sensitive information, covers the target content by using a preset color or replaces the target content by using a preset symbol to obtain processed to-be-pushed information; generates a message pushing request based on the processed to-be-pushed message, the specific identification information (an appID is usually bound to a specific application service, which can help a push service system to identify different application programs and ensure that a push message can be correctly sent to a specified application), and the target device token, and sends the message pushing request to a target push service channel indicated by the target device token, so that the target push service channel extracts the processed to-be-pushed message and the specific identification information from the message pushing request when the message pushing request is received, and pushes the processed to-be-pushed message to a message receiver indicated by the specific identification information. The sensitive information can be understood as drug trafficking, yellow industry, and gun information. Through the above process, the localization processing of sensitive information can be realized, cross-border data transmission can be avoided, the safe transmission of data can be ensured, and the local laws, regulations, and cultural habits can be met.
[0074] The method provided by the embodiment of the application can acquire at least one device token with an execution sequence when a message sending signal is received, preferentially select a device token ranked first from the at least one device token as a target device token, and preferentially send a message pushing request to a target push service channel indicated by the target device token. The target push service channel sends a to-be-pushed message carried by the message pushing request to a corresponding message receiver. At the same time, a response result returned by the message receiver is received. The response result is used to indicate whether the message is successfully pushed. The target push service channel generates push result information based on the response result and pushes the push result information to a consuming sender. The message sender determines whether the message is successfully pushed based on the push result information. If not, other target device tokens are selected in sequence, and the above operation is repeated until the final push result information indicates that the message is successfully pushed. Through the above process, the message pushing channel can be dynamically adjusted, the situation that the message is not successfully pushed can be avoided, and the stability and continuity of the message pushing service are improved.
[0075] Further, as Figure 1A specific implementation of the method is shown in Figure 3A As shown in FIG. 1, an embodiment of the present application provides a message pushing device, which comprises a determining module 301, a first pushing module 302 and a second pushing module 303.
[0076] The determining module 301 is configured to determine, in response to a message sending signal, a to-be-pushed message carried by the message sending request, specific identification information of a message receiver, and at least one device token with an execution sequence.
[0077] The first pushing module 302 is configured to select a device token ranked first from the at least one device token with the execution sequence as a first target device token, generate a first message pushing request based on the to-be-pushed message, the specific identification information and the first target device token, send the first message pushing request to the first target push service channel indicated by the first target device token, so that the first target push service channel extracts the to-be-pushed message and the specific identification information from the first message pushing request when receiving the first message pushing request, pushes the to-be-pushed message to the message receiver indicated by the specific identification information, and generates first pushing result information based on a first response result returned by the message receiver when receiving the first response result, and returns the first pushing result information.
[0078] The second pushing module 303 is configured to select a device token ranked second from the at least one device token with the execution sequence as a second target device token if the first pushing result information indicates that the message pushing fails, generate a second message pushing request based on the to-be-pushed message, the specific identification information and the second target device token, send the second message pushing request to a second target push service channel indicated by the second target device token, so that the second target push service channel extracts the to-be-pushed message and the specific identification information from the second message pushing request when receiving the second message pushing request, pushes the to-be-pushed message to the message receiver indicated by the specific identification information, and generates first pushing result information based on a second response result returned by the message receiver when receiving the second response result, and returns the first pushing result information, and repeats the above operations until the final pushing result information indicates that the message pushing succeeds.
[0079] In a specific application scenario, as shown in FIG. 2, the device further comprises an obtaining module 304. Figure 3B
[0080] The acquisition module 304 is configured to, in response to a channel address acquisition signal, acquire a plurality of push service channel addresses associated with the channel address acquisition signal, generate a corresponding token acquisition request based on each push service channel address, and send the token acquisition request to a push service channel indicated by the corresponding push service channel address, so that the push service channel generates and returns a corresponding device token in response to the token acquisition request; obtain at least one device token, determine the priority of each device token in the at least one device token, mark each device token according to the priority, obtain the at least one device token with an execution sequence, and store the at least one device token with the execution sequence.
[0081] In a specific application scenario, as shown in Figure 3B The device further includes an encryption module 305.
[0082] The encryption module 305 is configured to encrypt each device token in the at least one device token by using an asymmetric encryption algorithm to obtain at least one encrypted device token.
[0083] In a specific application scenario, as shown in Figure 3B The device further includes a marking module 306 and a third push module 307.
[0084] The marking module 306 is configured to determine the applicable area information of the push service channel indicated by each encrypted device token, mark the corresponding encrypted device token by using the applicable area information, and obtain the at least one marked device token; and store the at least one marked device token.
[0085] The third push module 307 is configured to, in response to a message push request, acquire a to-be-pushed message, specific identification information of a message receiver, and the at least one marked device token carried by the message push request; acquire current location information of the message sender, and select a device token matching the current location information and the applicable area information from the at least one marked device token as a target device token; generate a message push request based on the to-be-pushed message, the specific identification information, and the target device token, and send the message push request to the target push service channel indicated by the target device token, so that the target push service channel extracts the to-be-pushed message and the specific identification information from the message push request when receiving the message push request, and pushes the to-be-pushed message to the message receiver indicated by the specific identification information.
[0086] In a specific application scenario, as shown in Figure 3C The device further includes a detection module 308.
[0087] The detection module 308 is used to obtain a device token list, which includes multiple detection push service channel addresses and a device token corresponding to each detection push service channel address; extract multiple detection push service channel addresses from the device token list, generate multiple detection requests based on the multiple detection push service channel addresses, wherein each detection request corresponds to a detection push service channel address; send the corresponding detection request to the detection push service channel indicated by each detection push service channel address, so that each detection push service channel responds to the detection request and generates and returns the corresponding detection result; if no detection result is received from a detection push service channel within a preset time interval, it is determined that the device token corresponding to the detection push service channel has changed, and a token acquisition request is resent to the detection push service channel, so that the detection push service channel responds to the token acquisition request and generates and returns an updated device token; replace the corresponding device token in the device token list with the updated device token corresponding to the detection push service channel to obtain an updated device token list, and store the updated device token list.
[0088] In specific application scenarios, such as Figure 3D As shown, the device also includes: a selection module 309, a matching module 310, and a fourth push module 311.
[0089] The determining module 309 is configured to, in response to a message sending signal, determine the message to be pushed, the region information of the message sender, and the specific identification information of the message receiver, and select a device token as the target device token from at least one device token having an execution order.
[0090] The matching module 310 is used to obtain a blacklist of sensitive information associated with the information of the region to which it belongs, and to determine that the blacklist of sensitive information includes multiple sensitive information; to use a semantic matching algorithm to match the message to be pushed with each of the multiple sensitive information to obtain a matching result; when it is determined that the matching result indicates that the message to be pushed has target content that matches one of the multiple sensitive information, the target content is covered with a preset color or replaced with a preset symbol to obtain the processed message to be pushed;
[0091] The fourth pushing module 311 is configured to generate a message pushing request based on the processed to-be-pushed message, the specific identification information and the target device token, and send the message pushing request to a target pushing service channel indicated by the target device token, so that the target pushing service channel extracts the processed to-be-pushed message and the specific identification information from the message pushing request when receiving the message pushing request, and pushes the processed to-be-pushed message to the message receiver indicated by the specific identification information.
[0092] The device provided by the embodiment of the present application can acquire at least one device token with an execution sequence when receiving a message sending signal, preferentially select a device token ranked first from the at least one device token as a target device token, and preferentially send a message pushing request to a target pushing service channel indicated by the target device token. The target pushing service channel sends a pushing message carried by the message pushing request to a corresponding message receiver. Meanwhile, a response result returned by the message receiver is received. The response result is used to indicate whether the message is successfully pushed. The target pushing service channel generates pushing result information based on the response result and pushes the pushing result information to a consuming sender. The message sender determines whether the message is successfully pushed based on the pushing result information. If not, other target device tokens are selected in sequence, and the above operation is repeated until the final pushing result information indicates that the message is successfully pushed. Through the above process, the message pushing channel can be dynamically adjusted, and the situation that the message is not successfully pushed is avoided, thereby improving the stability and continuity of the message pushing service.
[0093] It should be noted that other corresponding descriptions of the functions of the message pushing device provided by the embodiment of the present application can be referred to the corresponding descriptions in Figure 1 and Figures 3A to 3D , which will not be described here.
[0094] In the example embodiment, referring to Figure 4 , a computer device is also provided, which includes a bus, a processor, a memory and a communication interface, and can further include an input / output interface and a display device. The bus can be used for communication between the various functional units. The memory stores a computer program. The processor is configured to execute the program stored in the memory and perform the message pushing method in the above embodiment.
[0095] Those skilled in the art can clearly understand the technical solutions of the present application from the above description of the embodiments that the present application can be implemented by hardware or by means of software and necessary universal hardware platform. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, U disk, mobile hard disk, etc.) and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present application.
[0096] The present application also provides a readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the steps of the electric message pushing method.
[0097] The present application also provides a computer program product comprising a computer program, wherein the computer program is executed by a processor to implement the steps of the message pushing method as described above.
[0098] Those skilled in the art can understand that the accompanying drawings are only schematic of a preferred embodiment, and the modules or flows in the drawings are not necessarily essential for implementing the present application.
[0099] Those skilled in the art can understand that the modules in the device in the embodiments can be distributed in the device in the embodiments as described in the embodiments, or can be changed and located in one or more devices different from the embodiments. The modules in the above embodiments can be combined as one module, or can be further split into a plurality of sub-modules.
[0100] The above application numbers are only for description, and do not represent the advantages or disadvantages of the embodiments.
[0101] The above embodiments are only exemplary embodiments of the present application, and are not used to limit the present application, and the protection scope of the present application is defined by the claims. Those skilled in the art can make various modifications or equivalent replacements to the present application within the spirit and protection scope of the present application, and such modifications or equivalent replacements are also regarded as falling within the protection scope of the present application.
Claims
1. A message pushing method, characterized by, The method comprises the steps of: in response to a message sending signal, determining a to-be-pushed message and specific identification information of a message receiver, and obtaining at least one device token with an execution sequence; selecting a device token ranked first from the at least one device token with the execution sequence as a first target device token, and generating a first message push request based on the to-be-pushed message, the specific identification information and the first target device token, and sending the first message push request to a first target push service channel indicated by the first target device token, so that the first target push service channel extracts the to-be-pushed message and the specific identification information from the first message push request when receiving the first message push request, and pushes the to-be-pushed message to a message receiver indicated by the specific identification information, and generates first push result information based on a first response result returned by the message receiver when receiving the first response result, and returns the first push result information; if the first push result information indicates that the message push fails, selecting a device token ranked second from the at least one device token with the execution sequence as a second target device token, and generating a second message push request based on the to-be-pushed message, the specific identification information and the second target device token, and sending the second message push request to a second target push service channel indicated by the second target device token, so that the second target push service channel extracts the to-be-pushed message and the specific identification information from the second message push request when receiving the second message push request, and pushes the to-be-pushed message to a message receiver indicated by the specific identification information, and generates first push result information based on a second response result returned by the message receiver when receiving the second response result, and returns the first push result information, and repeating the above operations until the final push result information indicates that the message push succeeds; Before the step of in response to a message sending signal, determining a to-be-pushed message and specific identification information of a message receiver, and obtaining at least one device token with an execution sequence, the method further comprises the steps of: obtaining a device token list, wherein the device token list comprises a plurality of probe push service channel addresses and a device token corresponding to each probe push service channel address; extracting a plurality of probe push service channel addresses from the device token list, and generating a plurality of probe requests based on the plurality of probe push service channel addresses, wherein each probe request corresponds to a probe push service channel address; sending a corresponding probe request to a probe push service channel indicated by each probe push service channel address, so that each probe push service channel generates and returns a corresponding probe result in response to the probe request; if no probe result returned by a probe push service channel is received within a preset time interval, it is determined that the device token corresponding to the probe push service channel is changed, and a token acquisition request is sent to the probe push service channel again, so that the probe push service channel generates and returns an updated device token in response to the token acquisition request; Replace the corresponding device token in the device token list with the update device token corresponding to the probe push service channel to obtain an update device token list, and store the update device token list.
2. The message pushing method of claim 1, wherein, Before the step of determining the to-be-pushed message and the specific identification information of the message receiver and obtaining the at least one device token with execution sequence in response to the message sending signal, the method further comprises: In response to the channel address acquisition signal, acquire a plurality of push service channel addresses associated with the channel address acquisition signal, and generate a corresponding token acquisition request based on each push service channel address, and send the token acquisition request to the push service channel indicated by the push service channel address, so that the push service channel generates and returns a corresponding device token in response to the token acquisition request; Obtain at least one device token, determine the priority of each device token in the at least one device token, and label each device token according to the priority to obtain the at least one device token with execution sequence, and store the at least one device token with execution sequence.
3. The message pushing method of claim 2, wherein, After the step of obtaining the at least one device token, the method further comprises: Encrypt each device token in the at least one device token using an asymmetric encryption algorithm to obtain at least one encrypted device token.
4. The message pushing method of claim 3, wherein, After the step of encrypting each device token in the at least one device token using an asymmetric encryption algorithm to obtain at least one encrypted device token, the method further comprises: Determine the applicable area information of the push service channel indicated by each encrypted device token, and label the corresponding encrypted device token using the applicable area information to obtain the at least one labeled device token; Store the at least one labeled device token; In response to the message push request, acquire the to-be-pushed message, the specific identification information of the message receiver, and the at least one labeled device token carried by the message push request; Acquire the current location information of the message sender, and select a device token in the at least one labeled device token that matches the current location information and the applicable area information as a target device token; Generate a message push request based on the to-be-pushed message, the specific identification information, and the target device token, and send the message push request to the target push service channel indicated by the target device token, so that the target push service channel extracts the to-be-pushed message and the specific identification information from the message push request when receiving the message push request, and pushes the to-be-pushed message to the message receiver indicated by the specific identification information.
5. The message pushing method of claim 1, wherein, Further comprising: In response to the message sending signal, determine the to-be-pushed message, the area information of the message sender, and the specific identification information of the message receiver, and select a device token from the at least one device token with execution sequence as a target device token; Acquire a sensitive information blacklist associated with the area information, and determine that the sensitive information blacklist includes a plurality of sensitive information; The semantic matching algorithm is used to match the to-be-pushed message with each sensitive information in the plurality of sensitive information, to obtain a matching result; when it is determined that the matching result indicates that the to-be-pushed message has target content matching a sensitive information in the plurality of sensitive information, a preset color is used to cover the target content, or a preset symbol is used to replace the target content, to obtain a processed to-be-pushed message; A message push request is generated based on the processed to-be-pushed message, the specific identification information, and the target device token, and the message push request is sent to a target push service channel indicated by the target device token, so that the target push service channel extracts the processed to-be-pushed message and the specific identification information from the message push request when the message push request is received, and pushes the processed to-be-pushed message to a message receiver indicated by the specific identification information.
6. A message pushing apparatus characterized by comprising: Comprise: A determination module is configured to determine a to-be-pushed message and specific identification information of a message receiver in response to a message sending signal, and to obtain at least one device token having an execution sequence; A first push module is configured to select a device token ranked first from the at least one device token having an execution sequence as a first target device token, to generate a first message push request based on the to-be-pushed message, the specific identification information, and the first target device token, to send the first message push request to a first target push service channel indicated by the first target device token, to cause the first target push service channel to extract the to-be-pushed message and the specific identification information from the first message push request when the first message push request is received, and to push the to-be-pushed message to a message receiver indicated by the specific identification information, and to generate first push result information based on a first response result returned by the message receiver when the first response result is received, and to return the first push result information; A second push module is configured to select a device token ranked second from the at least one device token having an execution sequence as a second target device token if the first push result information indicates that message pushing fails, to generate a second message push request based on the to-be-pushed message, the specific identification information, and the second target device token, to send the second message push request to a second target push service channel indicated by the second target device token, to cause the second target push service channel to extract the to-be-pushed message and the specific identification information from the second message push request when the second message push request is received, and to push the to-be-pushed message to a message receiver indicated by the specific identification information, and to generate first push result information based on a second response result returned by the message receiver when the second response result is received, and to return the first push result information, and to repeat the above operations until final push result information indicates that message pushing succeeds; The device further comprises a detection module; The detection module is configured to acquire a device token list, the device token list comprising a plurality of detection push service channel addresses and a device token corresponding to each detection push service channel address; The detection module is further configured to extract a plurality of detection push service channel addresses from the device token list, generate a plurality of detection requests based on the plurality of detection push service channel addresses, wherein each detection request corresponds to a detection push service channel address; The detection module is further configured to send a corresponding detection request to a detection push service channel indicated by each detection push service channel address, so that each detection push service channel generates and returns a corresponding detection result in response to the detection request; The detection module is further configured to determine that a device token corresponding to a detection push service channel has changed if a detection result returned by the detection push service channel is not received within a preset time interval, and to re-send a token acquisition request to the detection push service channel, so that the detection push service channel generates and returns an updated device token in response to the token acquisition request; The detection module is further configured to replace a corresponding device token in the device token list with an updated device token corresponding to the detection push service channel to obtain an updated device token list, and to store the updated device token list. 7.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-6 when the computer program is executed by the processor. The processor executes the computer program to implement the steps of the method of any one of claims 1 to 5.
8. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 5.
9. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 5.
Citation Information
Patent Citations
Data processing method, server equipment and computer readable storage medium
CN112367345A
Efficient routing between a mobile node and a correspondent node in a proxy mobile IP network
US20100067446A1