Method, device and server for sending push messages
By establishing a long link in the user terminal and transmitting pre-stored push messages in real time, the problem of delayed application push message sending is solved and the real-time nature of the notification service is improved.
Patent Information
- Application Number
- CN202210191836.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-28
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2042-02-28
AI Technical Summary
Existing applications have lag issues in the process of sending push messages, resulting in reduced real-time performance of the notification service.
By obtaining the running information of the target application on the user terminal, it determines its login status and foreground operation status, establishes a long link, and transmits pre-stored push messages in real time through the long link to ensure the timely arrival of the message.
It improves the real-time nature of push messages and improves the timeliness and accuracy of notifications received by user terminals.
Smart Images

Figure CN114666404B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of Internet technology, and specifically relates to a method, device and server for sending a push message. Background Art
[0002] With the rapid development of electronic technology, user terminals such as smart phones and tablet computers are becoming more and more popular and gradually become indispensable tools in people's daily lives. Among them, user terminals can realize a variety of functions by installing various applications, such as instant messaging, shopping, payment, and travel, etc.
[0003] While users are using various applications, the operators or merchants corresponding to the applications can send push messages to the user terminals to provide notification services to the users through push messages. For example, the merchant sends a coupon push message to the application of the user terminal to remind the user that the coupon has been received, or the operator sends an update push message to the application function program of the user terminal to remind the user that the application version has been updated, etc. However, in the current process of sending push messages of applications, there is usually a problem of delay in sending push messages, which reduces the real-time performance of providing notification services to users through push messages. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a method, device and server for sending a push message, which can solve the problem of reduced real-time performance of providing notification services to users through push messages.
[0005] In a first aspect, an embodiment of the present application provides a method for sending a push message, which is applied to a first server and includes:
[0006] Obtaining the running related information of the target application in the user terminal;
[0007] When it is determined based on the operation association information that the target application is in a logged-in state and is running in the foreground of the user terminal, establishing a long link between the first server and the user terminal;
[0008] sending a target push message to the user terminal through the long link, so that the target application of the user terminal outputs the target push message, or displays a target identifier associated with the target push message,
[0009] The target push message is pre-stored in the first server and sent by a second server associated with the target application.
[0010] In a second aspect, an embodiment of the present application provides a device for sending a push message.
[0011] Applied to the first server, comprising:
[0012] The associated information acquisition module is used to acquire the running associated information of the target application in the user terminal;
[0013] a long link establishing module, configured to establish a long link between the first server and the user terminal when it is determined based on the operation association information that the target application is in a logged-in state and is running in the foreground of the user terminal;
[0014] a push message sending module, configured to send a target push message to the user terminal through the long link, so that the target application of the user terminal outputs the target push message, or displays a target identifier associated with the target push message,
[0015] The target push message is pre-stored in the first server and sent by a second server associated with the target application.
[0016] In a third aspect, an embodiment of the present application provides a server, which includes a processor and a memory, wherein the memory stores programs or instructions that can be executed on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0017] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0018] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0019] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.
[0020] In an embodiment of the present application, the target push message is sent to the first server for storage in advance by the second server. When the first server determines that the target application is in a logged-in state and running in the foreground of the user terminal based on the associated running information of the target application in the user terminal, a long link is established between the first server and the user terminal, and the pre-stored target push message is sent to the user terminal through the long link. In this way, when the first server determines that the target application of the user terminal is in a logged-in state and running in the foreground, the push message pre-stored in the first server can be continuously transmitted to the user terminal in real time through the long link, thereby improving the real-time nature of the notification service provided to the user through the push message. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 This is one of the flowcharts of an embodiment of the method for sending a push message provided by the present application;
[0022] Figure 2 This is one of the schematic diagrams of the display interface of the user terminal in the embodiment of the method for sending a push message provided by the present application;
[0023] Figure 3 This is the second flow chart of an embodiment of the method for sending a push message provided by the present application;
[0024] Figure 4 This is a second schematic diagram of a display interface of a user terminal in an embodiment of a method for sending a push message provided by the present application;
[0025] Figure 5 It is a structural diagram of an embodiment of a device for sending push messages provided by the present application;
[0026] Figure 6 It is a schematic diagram of the structure of an embodiment of the server provided in this application. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0028] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0029] The following is a detailed description of the method for sending a push message provided in the embodiment of the present application through specific embodiments and application scenarios in conjunction with the accompanying drawings.
[0030] See also Figure 1 , is a flow chart of a method for sending a push message provided in an embodiment of the present application, and the method for sending a push message is applied to a first server. Figure 1 As shown, the above-mentioned method for sending a push message at least includes the following steps 101 to 103.
[0031] Step 101: Obtain operation-related information of a target application in a user terminal.
[0032] Step 102: When it is determined based on the running association information that the target application is in a logged-in state and is running in the foreground of the user terminal, a long link is established between the first server and the user terminal.
[0033] Step 103: Send the target push message to the user terminal through the long link, so that the user terminal outputs the target push message or displays the target identifier associated with the target push message.
[0034] The target push message is pre-stored in the first server and sent by the second server associated with the target application.
[0035] Based on this, the target push message is sent to the first server for storage in advance through the second server. When the first server determines that the target application is in a logged-in state and running in the foreground of the user terminal based on the associated running information of the target application in the user terminal, a long link is established between the first server and the user terminal, and the pre-stored target push message is sent to the user terminal through the long link. In this way, when the first server determines that the target application of the user terminal is in a logged-in state and running in the foreground, the push message pre-stored in the first server can be continuously transmitted to the user terminal in real time through the long link, thereby improving the real-time nature of the notification service provided to the user through the push message.
[0036] In the above step 101, the first server may obtain the running-related information of the target application in the user terminal.
[0037] In the embodiment of the present application, the above-mentioned acquisition of the operation-related information of the target application in the user terminal may be that the first server sends a request to the above-mentioned user terminal, and the target user terminal feeds back the above-mentioned operation-related information to the first server in response to the request; or, the above-mentioned user terminal may actively send the above-mentioned operation-related information to the above-mentioned first server.
[0038] The target application may be any application that has a push message receiving function, such as an instant messaging application, a browser, or an audio and video playback application, etc. Specifically, the target application may be an application that can provide a financial service function.
[0039] For example, Figure 2 As shown, this is the display interface of a financial services application, and the display interface of the financial services application may include multiple functional modules, such as "Home", "Life", "Message", "Financial Services" and "My", and each functional module can receive associated push messages. For example, when a user receives reward activity information, the "My" module can receive a push message associated with the reward activity information.
[0040] The operation-related information may be any information that can indicate whether the target application is in a logged-in state and whether it is running in the foreground of the user terminal. Specifically, the operation-related information may include a user login status indication and an operation status indication, and the operation-related information may also include at least one of the application version information and the system information and version information of the user terminal.
[0041] It should be noted that the first server obtains the operation-related information of the target application in the user terminal by a preset frequency. For example, the first server may send the request to the user terminal once at a preset time interval (such as 10 seconds, 30 seconds or 1 minute, etc.) to request the user terminal to feedback the operation-related information.
[0042] Alternatively, the first server obtains the running-related information of the target application in the user terminal, or when the first server receives a push request sent by the second server, the first server obtains the running-related information of the target application in the user terminal in response to the push request.
[0043] The push request may be a request for the second server to send a push message to the first server. In addition, the second server may be a server associated with the target application, and the second server may generate a push message.
[0044] For example, Figure 3 As shown, the target application is a Figure 2 In the financial service application of the display interface shown, when the financial service system (i.e., the second server) associated with the financial service application generates a push message (i.e., a target push message) associated with the reward activity information, the financial service system can send an information acquisition request to the cloud server front-end system (also called "ARIS server"), and the cloud server front-end system sends an information acquisition request to the financial service application of the user terminal through the public cloud server (i.e., the above-mentioned first server includes the cloud server front-end system and the public cloud server), and the financial service application feeds back its operation-related information to the cloud server front-end system through the public cloud server.
[0045] It should be noted that the user terminal may be one terminal or multiple terminals. In the case where the user terminal is multiple terminals, the first server may simultaneously obtain the operation-related information of the target application in multiple user terminals.
[0046] In the above step 102, after the first server obtains the above operation association information, the above first server can determine whether the above target application is in a logged-in state and running in the foreground through the above operation association information, and establish a long link between the first server and the user terminal when it is determined that the target application is in a logged-in state and running in the foreground.
[0047] It should be noted that the above long link means that multiple data packets can be sent continuously on one connection, and if no data packet is sent during the connection, both parties need to send a link detection packet. Since the implementation process of establishing a long link is well known to those skilled in the art, it will not be repeated here.
[0048] For example, Figure 3 As shown, when the cloud server front-end system receives the operation association information sent by the financial service application, if the cloud server front-end system determines that the financial service application is logged in and running in the foreground in the user device based on the operation association information, the cloud server front-end system can instruct the public cloud server to establish a long link with the user terminal.
[0049] In the above step 103, after the above first server establishes a long link with the above user terminal, the first server may send a pre-stored target push message to the user terminal.
[0050] In an embodiment of the present application, after the user terminal receives the target push message sent by the first server, the user terminal may output the target push message in the target application, or display the target identifier associated with the target push message in the target application.
[0051] The user terminal outputs the target push message in the target application, and may output the target push message in the target application through at least one of a pop-up window, a carousel bar, and a message notification.
[0052] The target identifier associated with the target push message is displayed in the target application. Any identifier that can indicate the target push message can be displayed in the target application. The shape, size, color and position of the identifier can be set according to actual needs.
[0053] For example, in the above target application, Figure 2 In the financial service application with the display interface shown, if the first server sends a push message associated with the reward activity information (i.e., the target push message) to the above-mentioned user terminal, the user terminal can display a red dot (represented by a black solid dot in the figure) in the "Reward" function column in the "My" function section to prompt the user through the red dot that the push message associated with the reward activity information has been received.
[0054] It should be noted that the display position of the target logo may be a pre-fixed setting, or the display position of the target logo may also be sent and changed. Specifically, the operation association information may also include logo display information, which is used to indicate the display position of the target logo, and after the user terminal receives the target push message, the user terminal may display the target push message according to the logo display information associated with the target push message.
[0055] In the embodiment of the present application, after the user terminal receives the target push message, the user terminal may cache the target push message, and after the user views the target push message, the user terminal may clear the target push message.
[0056] In the case where the user terminal displays the target identifier associated with the target push message, if the user terminal receives an operation on the target identifier, the user terminal confirms that the user views the target push message.
[0057] For example, Figure 4As shown, when the user terminal receives a push message associated with the reward activity information, the user terminal can cache the push message and display a red dot in the above-mentioned "Reward" function column to prompt that the push message associated with the reward activity information has been received. If the user terminal receives a click operation of the user on the "Reward" function column, the user terminal displays the push message associated with the reward activity information, and after the user exits the "Reward" function column, the red dot displayed in the "Reward" function column is cleared, and the cached push message associated with the reward activity information is cleared.
[0058] It should be noted that the above-mentioned target push message is a push message pre-stored in the first server, which may be a push message received and stored before the first server establishes a long link with the user terminal; or, it may be a push message received and stored after the first server establishes a long link with the user terminal, which is not limited here.
[0059] The second server sends the push message to the first server, which may be that after the second server generates the push message, the second server directly sends the push message to the first server, and the first server stores the push message after receiving it.
[0060] In addition, after the user terminal receives the target push message, the user terminal may return push message delivery information to the first server, and the first server may feed back the push completion result to the second server based on the push message delivery information.
[0061] In some implementations, the step of obtaining the target application program's running-related information in the user terminal includes:
[0062] When a push request sent by the second server is received, the operation-related information of the target application in the user terminal is obtained in response to the push request.
[0063] Step 102 may include:
[0064] When it is determined based on the running association information that the target application is in a logged-in state and running in the foreground of the user terminal, a target push message corresponding to the push request is obtained from the second server and stored, and a long link is established between the first server and the user terminal.
[0065] Based on this, the above-mentioned first server obtains the running-related information of the target application in the user terminal only when it receives the push request sent by the second server, stores the target push message corresponding to the push request, and establishes a long link between the first server and the user terminal, thereby avoiding the waste of the computing resources of the first server and improving the utilization rate of the computing resources of the first server.
[0066] It should be noted that, when the first server determines based on the operation-related information that the target application is not in a logged-in state and / or is running in the background of the user terminal, the first server may not perform any operation.
[0067] In some implementations, after receiving the push request sent by the second server, in response to the push request, obtaining the running-related information of the target application in the user terminal, further includes:
[0068] When it is determined based on the operation association information that the target application is not in a logged-in state and / or is running in the background of the user terminal, sending a query request to the second server;
[0069] The target push message fed back by the second server in response to the query request is received, and the target push message is stored.
[0070] Based on this, when the above-mentioned first server determines based on the running association information that the target application is not in a logged-in state and / or is running in the background of the user terminal, the first server can actively initiate a query request to the second server to obtain and store the target push message, so that the target push message can be obtained from the second server in time for storage, further improving the timeliness of notifying users through push messages.
[0071] It should be noted that, when the first server establishes a long link with the user terminal, if the first server receives the push request, the first server can respond to the push request and obtain and store the target push message corresponding to the push request from the second server.
[0072] In some implementations, obtaining and storing a target push message corresponding to the push request from the second server includes:
[0073] Get the server identity information in the push request;
[0074] Verify the server identity information and obtain the verification result;
[0075] When the verification result is that the verification is passed, the target push message corresponding to the push request is obtained from the second server and stored.
[0076] Based on this, when the first server obtains the corresponding push message based on the push request, it can verify the second server based on the server identity information of the second server, and if the verification passes, obtain the above-mentioned target push message from the second server, thereby avoiding unauthorized servers from sending push messages to the first server, reducing the redundancy of messages stored in the first server, and avoiding waste of storage resources of the first server.
[0077] In this embodiment, the above-mentioned verification of the server identity information obtains a verification result, which can be to match the server identity information with the preset identity information in the first server, and when the preset identity information matching the server identity information is found in the first server, the verification result is that the verification passed, otherwise, the verification result is that the verification failed.
[0078] For example, Figure 3 As shown, after the cloud server front-end system receives the above push request, the cloud server front-end system can check the interface current limiting judgment, and query the institution whitelist from the local cache combined with the data server; verify whether the identity information of the financial service system (i.e., the server identity information) is in the institution whitelist (i.e., obtain the verification result); when the identity information of the financial service system is in the institution whitelist, obtain the cid (i.e., the target push message) from the pipeline thread in the data server according to the identity information of the financial service system and store it.
[0079] It should be noted that the first server sends the target push message to the user terminal via the long link, and the first server may send part or all of the push messages stored therein to the user terminal.
[0080] In some implementations, before sending the target push message to the user terminal via the long link, the method further includes:
[0081] Based on the operation-related information, a target push message matching the operation-related information is determined from at least one push message pre-stored in the first server.
[0082] Based on this, the first server can determine the target push message matching the operation association information from at least one push message stored therein based on the operation association information, so as to send the push message matching the user terminal to the user terminal.
[0083] In this implementation, based on the operation association information, the target push message that matches the operation association information is determined from at least one push message pre-stored on the first server. The above-mentioned operation association information may include the system version information of the user terminal, etc., and each push message carries the system version information. The first user terminal determines the push message that carries the same system version information as the system version information of the user terminal as the target push message.
[0084] In some implementations, the operation-related information includes version information of the target application in the user terminal; and the at least one push message includes a version update push message.
[0085] The above-mentioned determining, based on the operation association information, a target push message matching the operation association information from at least one push message pre-stored on the first server may include:
[0086] The version information in the operation-related information is matched with the preset version information, and when it is determined that the version information in the operation-related information matches the preset version information, the version update push message is determined as the target push message.
[0087] Based on this, the first server may determine a suitable target push message to send to the user terminal according to the version information of the target application.
[0088] For example, when the push messages stored in the first server include push messages of version 1.0 and push messages of version 2.0, if the version of the above-mentioned financial service application is version 1.0, the first server only sends the push messages of version 1.0 to the financial service application.
[0089] In some implementations, after sending the target push message to the user terminal via the long link, the method further includes:
[0090] Receiving a target request sent by a user terminal, where the target request is a request sent by the user terminal when receiving a target push message for viewing by the user;
[0091] In response to the target request, marking information corresponding to the target push message is generated, and the marking information is used to prohibit the first server from sending the target push message to the user terminal.
[0092] Based on this, after viewing the target push message, the user terminal can send a target request to the first server, and the first server generates tag information corresponding to the target push message based on the target request to avoid the first server repeatedly sending push messages to the user terminal.
[0093] For example, after the user terminal receives a click operation on the "reward" function bar, the user terminal can send the above-mentioned target request to the cloud server front-end system through the cloud server. After receiving the target request, the cloud server front-end system marks the push message associated with the reward activity information stored therein.
[0094] In some implementations, after sending the target push message to the user terminal via the long link, the method further includes:
[0095] When the preset time is reached, if the target request is not received, the target push message is sent to the user terminal through the long link again.
[0096] Based on this, if the user of the user terminal does not view the above push message when the preset time is reached, that is, the first server does not receive the above target request when the preset time is reached, the first server can resend the target push message to the user terminal so that the user terminal can notify the user to view the push message.
[0097] In some implementations, the above step 103 includes:
[0098] Create and store a push event log associated with the target push message;
[0099] After the push event log is established, the target push message is encoded and sent to the user terminal via a long link.
[0100] Based on this, in the process of sending the target push message to the user terminal, a push event log associated with the target push message can be established and stored to facilitate subsequent query of the event of sending the target push message.
[0101] For example, Figure 3 As shown, the cloud server front-end system can query the public cloud task identity identification code (Identity Document, ID) in the data server according to the MD5 value of the new message content (i.e., the target push message), and send the cloud task ID to the cloud server for storage. The cloud server returns the cloud task ID to the cloud server front-end system. The cloud server front-end system can store the MD5 of the new message content as the key (key) of the key-value pair and the cloud task ID as the value of the key-value pair in the data server to establish and store the push event log; finally, the new message message is encoded and processed and set to be sent as the push message content. For example, through the single-user push mode, the public cloud server can send the encoded push message content to the financial service application of the user terminal according to the task arrangement of the cloud server front-end system.
[0102] In some implementations, before sending the target push message to the user terminal via the long link, the method further includes:
[0103] Determining display information based on the operation-related information;
[0104] Sending a target push message to the user terminal via a long link includes:
[0105] The target push message and display information are sent to the user terminal through the long link, so that the user terminal displays the target identifier associated with the target push message based on the display information.
[0106] Based on this, the first server can determine the display information based on the operation association information, and send it to the user terminal together with the target push message, so that the user terminal displays the above target identification according to the display information, thereby improving the display effect of the target terminal.
[0107] It should be noted that the above-mentioned display information may be information for indicating at least one of the display position, size, shape, color, etc. of the above-mentioned target mark.
[0108] For example, in the case where the target push message is the push message associated with the reward activity information, the display information may be location information indicating the display area corresponding to the “reward” function column, and so on.
[0109] In some embodiments, the user terminal includes a plurality of terminals.
[0110] The above-mentioned sending of the target push message to the user terminal via the long link includes:
[0111] Establish an asynchronous thread pool task for long connections;
[0112] Based on the long-link asynchronous thread pool task, the target push message is sent to the user terminal through the asynchronous thread pool corresponding to the asynchronous thread pool task.
[0113] Based on this, the first server can send target push messages to multiple terminals at the same time through asynchronous thread pool tasks, thereby improving the efficiency of sending target push messages.
[0114] It should be noted that the asynchronous thread pool task of establishing the long link may be that the first server establishes multiple threads associated with the long link to send target push messages to multiple user terminals through the multiple threads.
[0115] For example, Figure 3 As shown, in the case where the above-mentioned user terminal includes multiple user terminals, through the multi-threaded multi-user push mode, the public cloud server can send encoded push message content to the financial service applications of multiple user terminals according to the cloud server front-end system task arrangement.
[0116] See also Figure 5 , is a schematic diagram of the structure of a device for sending a push message provided in an embodiment of the present application, and the device for sending a push message is applied to the first server mentioned above. Figure 5 As shown, the above push message sending device 500 includes:
[0117] The associated information acquisition module 501 is used to acquire the running associated information of the target application in the user terminal;
[0118] A long link establishing module 502, configured to establish a long link between the first server and the user terminal when it is determined based on the running association information that the target application is in a logged-in state and is running in the foreground of the user terminal;
[0119] The push message sending module 503 is used to send a target push message to the user terminal through a long link, so that the target application of the user terminal outputs the target push message, or displays a target identifier associated with the target push message.
[0120] The target push message is pre-stored in the first server and sent by the second server associated with the target application.
[0121] In some implementations, the information acquisition module is specifically used to:
[0122] When receiving the push request sent by the second server, in response to the push request, obtaining the operation-related information of the target application in the user terminal;
[0123] The long link establishment module 502 is specifically used for:
[0124] When it is determined based on the running association information that the target application is in a logged-in state and running in the foreground of the user terminal, a target push message corresponding to the push request is obtained from the second server and stored, and a long link is established between the first server and the user terminal.
[0125] In some embodiments, it further comprises:
[0126] A query request sending module, configured to send a query request to a second server when it is determined based on the operation association information that the target application is not in a logged-in state and / or is running in the background of the user terminal;
[0127] The push message receiving module is used to receive the target push message fed back by the second server in response to the query request, and store the target push message.
[0128] In some implementations, the long link establishment module 502 includes:
[0129] An identity information acquisition unit, used to acquire the server identity information of the second server in the push request;
[0130] A verification unit, used to verify the server identity information and obtain a verification result;
[0131] The first push message acquisition unit is used to acquire and store the target push message corresponding to the push request from the second server when the verification result is that the verification is passed.
[0132] In some embodiments, it further comprises:
[0133] The push message matching module is used to determine, based on the operation-related information, a target push message that matches the operation-related information from at least one push message pre-stored in the first server.
[0134] In some implementations, the operation-related information includes version information of the target application in the user terminal; and the at least one push message includes a version update push message.
[0135] Push message matching module, which can be used for:
[0136] The version information in the operation-related information is matched with the preset version information, and when it is determined that the version information in the operation-related information matches the preset version information, the version update push message is determined as the target push message.
[0137] In some embodiments, it further comprises:
[0138] A target request receiving module, used to receive a target request sent by a user terminal, wherein the target request is a request sent by the user terminal when receiving a target push message for viewing by the user;
[0139] The marking information generating module is used to generate marking information corresponding to the target push message in response to the target request, and the marking information is used to prohibit the first server from sending the target push message to the user terminal.
[0140] In some embodiments, it further comprises:
[0141] The re-execution module is used to re-execute the sending of the target push message to the user terminal through the long link if the target request is not received when the preset time is reached.
[0142] In some embodiments, it further comprises:
[0143] The display information determination module is used to determine the display information based on the operation-related information.
[0144] The push message sending module 503 can be specifically used for:
[0145] The target push message and display information are sent to the user terminal through the long link, so that the user terminal displays the target identifier associated with the target push message based on the display information.
[0146] In some embodiments, the user terminal includes a plurality of terminals.
[0147] The push message sending module 503 may include:
[0148] Task creation unit, used to create long-linked asynchronous thread pool tasks;
[0149] The second push message sending unit is used to send a target push message to a user terminal through an asynchronous thread pool corresponding to the asynchronous thread pool task based on a long link.
[0150] Regarding the device in the above embodiment, the specific manner in which each module performs operations and the beneficial effects have been described in detail in the embodiment of the method, and will not be elaborated here.
[0151] Based on the same inventive concept, the embodiment of the present application further provides a server, specifically combined with Figure 6 Provide detailed explanation.
[0152] Figure 6 It is a structural block diagram of the server provided in an embodiment of the present application.
[0153] like Figure 6 As shown, the server 600 can implement the structural diagram of the exemplary hardware architecture of the method for sending a push message and the device for sending a push message according to the embodiment of the present application. The server 600 may include a processor 601 and a memory 602 storing computer program instructions. Specifically, each of the above processors may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiment of the present application.
[0154] Each of the above-mentioned memories may include a large capacity memory for information or instructions. By way of example and not limitation, the memory may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory may include a removable or non-removable (or fixed) medium. Where appropriate, the memory may be inside or outside the integrated gateway device. In a specific embodiment, the memory is a non-volatile solid-state memory. In a specific embodiment, the memory includes a read-only memory (ROK). Where appropriate, the ROK may be a mask-programmed ROK, a programmable ROK (PROK), an erasable PROK (EPROK), an electrically erasable PROK (EEPROK), an electrically rewritable ROK (EAROK) or a flash memory, or a combination of two or more of these.
[0155] The processor 601 reads and executes the computer program instructions stored in the memory 602 to perform the following steps:
[0156] Processor 601 executes to obtain the running related information of the target application in the user terminal;
[0157] When it is determined based on the operation association information that the target application is in a logged-in state and is running in the foreground of the user terminal, establishing a long link between the first server and the user terminal;
[0158] Sending a target push message to a user terminal via a long link so that a target application of the user terminal outputs the target push message, or displays a target identifier associated with the target push message.
[0159] The target push message is pre-stored in the first server and sent by the second server associated with the target application.
[0160] In some implementations, the processor 601 executes, upon receiving a push request sent by the second server, obtaining, in response to the push request, running-related information of the target application in the user terminal;
[0161] When it is determined based on the running association information that the target application is in a logged-in state and running in the foreground of the user terminal, a target push message corresponding to the push request is obtained from the second server and stored, and a long link is established between the first server and the user terminal.
[0162] In some implementations, the processor 601 executes, when it is determined based on the running association information that the target application is not in a logged-in state and / or is running in the background of the user terminal, sending a query request to the second server;
[0163] The target push message fed back by the second server in response to the query request is received, and the target push message is stored.
[0164] In some implementations, the processor 601 executes obtaining server identity information of the second server in the push request;
[0165] Verify the server identity information and obtain the verification result;
[0166] When the verification result is that the verification is passed, the target push message corresponding to the push request is obtained from the second server and stored.
[0167] In some implementations, the processor 601 determines, based on the execution association information, a target push message that matches the execution association information from at least one push message pre-stored on the first server.
[0168] In some implementations, the operation-related information includes version information of the target application in the user terminal; and the at least one push message includes a version update push message.
[0169] The processor 601 may match the version information in the running association information with the preset version information, and when it is determined that the version information in the running association information matches the preset version information, determine that the version update push message is the target push message.
[0170] In some implementations, the processor 601 executes receiving a target request sent by a user terminal, where the target request is a request sent by the user terminal when receiving a target push message for viewing by the user thereof;
[0171] In response to the target request, marking information corresponding to the target push message is generated, and the marking information is used to prohibit the first server from sending the target push message to the user terminal.
[0172] In some implementations, the processor 601 executes, when the preset time has expired, if no target request is received, to re-execute sending the target push message to the user terminal through the long link.
[0173] In some implementations, the processor 601 executes determining display information based on the operation association information;
[0174] The target push message and display information are sent to the user terminal through the long link, so that the user terminal displays the target identifier associated with the target push message based on the display information.
[0175] In some embodiments, the user terminal includes a plurality of terminals.
[0176] Processor 601 may execute an asynchronous thread pool task for establishing a long connection;
[0177] Based on the long-link asynchronous thread pool task, the target push message is sent to the user terminal through the asynchronous thread pool corresponding to the asynchronous thread pool task.
[0178] Regarding the server 600 in the above embodiment, the specific manner in which the processor 601 performs operations and the beneficial effects have been described in detail in the embodiment of the method, and will not be elaborated here.
[0179] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned push message sending method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0180] The processor is the processor in the server described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk, and other non-transitory computer readable storage media.
[0181] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned push message sending method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0182] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0183] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned push message sending method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0184] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0185] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0186] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A method for sending a push message, characterized in that: Applied to the first server, comprising: Upon receiving a push request sent by a second server, acquiring, in response to the push request, operation-related information of a target application in a user terminal, wherein the second server is a server associated with the target application; When it is determined based on the operation association information that the target application is in a logged-in state and is running in the foreground of the user terminal, obtaining and storing a target push message corresponding to the push request from the second server, and establishing a long link between the first server and the user terminal; determining display information based on the operation-related information; Sending the target push message and the display information to the user terminal through the long link, so that the user terminal displays the target identifier associated with the target push message based on the display information, the display information including the display position of the target identifier, and the target identifier is a red dot; Wherein, in the case of receiving the push request sent by the second server, after obtaining the running-related information of the target application in the user terminal in response to the push request, the method further includes: When it is determined based on the operation association information that the target application is not in a logged-in state and / or is running in the background of the user terminal, sending a query request to the second server; The target push message fed back by the second server in response to the query request is received, and the target push message is stored.
2. The method according to claim 1, characterized in that The step of acquiring and storing the target push message corresponding to the push request from the second server includes: Obtaining server identity information of the second server in the push request; Verifying the server identity information to obtain a verification result; When the verification result is that the verification is passed, the target push message corresponding to the push request is obtained from the second server and stored.
3. The method according to claim 1, characterized in that Before sending the target push message to the user terminal through the long link, the method further includes: Based on the operation-related information, a target push message matching the operation-related information is determined from at least one push message pre-stored in the first server.
4. The method according to claim 3, characterized in that The operation-related information includes version information of the target application in the user terminal; the at least one push message includes a version update push message; The determining, based on the operation-related information, a target push message matching the operation-related information from at least one push message pre-stored by the first server, comprises: The version information in the operation-related information is matched with the preset version information, and when it is determined that the version information in the operation-related information matches the preset version information, the version update push message is determined to be the target push message.
5. The method according to claim 1, characterized in that: After sending the target push message to the user terminal through the long link, the method further includes: receiving a target request sent by the user terminal, wherein the target request is a request sent by the user terminal when receiving a request from a user to view the target push message; In response to the target request, generating marking information corresponding to the target push message, wherein the marking information is used to prohibit the first server from sending the target push message to the user terminal.
6. The method according to claim 1, characterized in that After sending the target push message to the user terminal through the long link, the method further includes: When the preset time is reached, if the target request is not received, the target push message is sent to the user terminal through the long link again.
7. The method according to claim 1, characterized in that The user terminal includes a plurality of terminals. Sending a target push message to the user terminal through the long link includes: Establishing the asynchronous thread pool task of the long link; Based on the long-linked asynchronous thread pool task, a target push message is sent to the user terminal through the asynchronous thread pool corresponding to the asynchronous thread pool task.
8. A device for sending a push message, characterized in that: Applied to the first server, comprising: an associated information acquisition module, configured to, upon receiving a push request sent by a second server, acquire, in response to the push request, the running associated information of the target application in the user terminal, wherein the second server is a server associated with the target application; a long link establishment module, configured to, when it is determined based on the operation association information that the target application is in a logged-in state and is running in the foreground of the user terminal, obtain and store the target push message corresponding to the push request from the second server, and establish a long link between the first server and the user terminal; A display information determination module, used to determine display information based on the operation-related information; a push message sending module, configured to send the target push message and the display information to the user terminal through the long link, so that the user terminal displays a target identifier associated with the target push message based on the display information, wherein the display information includes a display position of the target identifier, and the target identifier is a red dot; Also includes: a query request sending module, configured to send a query request to the second server when it is determined based on the operation association information that the target application is not in a logged-in state and / or is running in the background of the user terminal; The push message receiving module is used to receive the target push message fed back by the second server in response to the query request, and store the target push message.
9. The device according to claim 8, characterized in that The long link establishment module includes: an identity information obtaining unit, configured to obtain the server identity information of the second server in the push request; A verification unit, used to verify the server identity information and obtain a verification result; The first push message acquiring unit is configured to acquire and store the target push message corresponding to the push request from the second server when the verification result is verification passed.
10. The device according to claim 8, characterized in that Also includes: The push message matching module is used to determine, based on the operation association information, a target push message that matches the operation association information from at least one push message pre-stored in the first server.
11. The device according to claim 10, characterized in that The operation-related information includes version information of the target application in the user terminal; the at least one push message includes a version update push message; The push message matching module is specifically used for: The version information in the operation-related information is matched with the preset version information, and when it is determined that the version information in the operation-related information matches the preset version information, the version update push message is determined to be the target push message.
12. The device according to claim 8, characterized in that Also includes: A target request receiving module, used for receiving a target request sent by the user terminal, wherein the target request is a request sent by the user terminal when receiving a request from the user to view the target push message; The marking information generating module is used to generate marking information corresponding to the target push message in response to the target request, and the marking information is used to prohibit the first server from sending the target push message to the user terminal.
13. The device according to claim 8, characterized in that Also includes: The re-execution module is used for re-executing the sending of the target push message to the user terminal through the long link if the target request is not received when the preset time is reached.
14. The device according to claim 8, characterized in that The user terminal includes a plurality of terminals. The push message sending module includes: A task establishment unit, used to establish the asynchronous thread pool task of the long link; The second push message sending unit is used to send a target push message to the user terminal through an asynchronous thread pool corresponding to the asynchronous thread pool task based on a long link.
15. A server, characterized in that: It includes a processor and a memory, the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method for sending a push message as described in any one of claims 1 to 7 are implemented.
16. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the method for sending a push message according to any one of claims 1 to 7 are implemented.
