CN113596147B - Message pushing method, device, equipment and storage medium - Google Patents

Message pushing method, device, equipment and storage medium Download PDF

Info

Publication number
CN113596147B
CN113596147B CN202110850114.5A CN202110850114A CN113596147B CN 113596147 B CN113596147 B CN 113596147B CN 202110850114 A CN202110850114 A CN 202110850114A CN 113596147 B CN113596147 B CN 113596147B
Authority
CN
China
Prior art keywords
session
message
service system
identifier
target message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110850114.5A
Other languages
Chinese (zh)
Other versions
CN113596147A (en
Inventor
袁桂敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qax Technology Group Inc
Secworld Information Technology Beijing Co Ltd
Original Assignee
Qax Technology Group Inc
Secworld Information Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qax Technology Group Inc, Secworld Information Technology Beijing Co Ltd filed Critical Qax Technology Group Inc
Priority to CN202110850114.5A priority Critical patent/CN113596147B/en
Publication of CN113596147A publication Critical patent/CN113596147A/en
Application granted granted Critical
Publication of CN113596147B publication Critical patent/CN113596147B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a message pushing method, a device, equipment and a storage medium, wherein the method is used for a message pushing service system, the message pushing service system is established with a user list for storing one or more message receivers, and the method comprises the following steps: determining a target message receiver of a target message to be pushed; if the user list is determined to comprise the target message receiver, determining session connection corresponding to the target message receiver; and if the session connection corresponding to the target message receiver is determined to be within the session effective time indicated by the authority authentication service system, pushing the target message to the target message receiver through the session connection corresponding to the target message receiver. The message pushing method, the device, the equipment and the storage medium provided by the invention realize automatic synchronization of conversation timeliness and promote the effectiveness of message pushing.

Description

Message pushing method, device, equipment and storage medium
Technical Field
The present invention relates to the field of network security technologies, and in particular, to a method, an apparatus, a device, and a storage medium for pushing a message.
Background
Message pushing is a technology for reducing information overload by periodically or aperiodically transmitting information required by a user over a network through a certain technical standard or protocol.
In the message pushing realized in the prior art, since all sessions have only one default session failure time, other service modules, platforms and terminals can send messages to an invalid user or the session connection of the invalid user, so that the user is easy to forge and information leakage is caused, and meanwhile, the bandwidth is occupied due to the fact that a large amount of invalid messages are pushed, and the effective message pushing fails.
Disclosure of Invention
Aiming at the problems existing in the prior art, the invention provides a message pushing method, a device, equipment and a storage medium.
The invention provides a message pushing method, which is used for a message pushing service system, wherein the message pushing service system is established with a user list for storing one or more message receivers, and the method comprises the following steps:
determining a target message receiver of a target message to be pushed;
if the user list is determined to comprise the target message receiver, determining session connection corresponding to the target message receiver;
And if the session connection corresponding to the target message receiver is determined to be in the session effective time indicated by the authority authentication service system, the authority authentication service system is independent of the message pushing service system and is used for verifying the authority of a user logging in the message pushing service system, and the target message is pushed to the target message receiver through the session connection corresponding to the target message receiver.
The message pushing method provided by the invention further comprises the following steps:
and if the user list is determined not to comprise the target message receiver, or if the session connection corresponding to the target message receiver is determined not to be in the session effective time indicated by the authority authentication service system, the target message is not pushed to the target message receiver through the session connection corresponding to the target message receiver.
According to the message pushing method provided by the invention, the message pushing service system comprises a client and a server;
the method further comprises the steps of:
and establishing a first session connection corresponding to a first message receiver through the client and the server, wherein the first message receiver is used for representing any message receiver in the one or more message receivers.
According to the message pushing method provided by the invention, the first session connection corresponding to the first message receiver is established through the client and the server, and the message pushing method comprises the following steps:
the client sends a network protocol Web-Socket connection establishment request to the server, wherein the Web-Socket connection request comprises a first user identification of the first message receiver and a session token indicated by the authority authentication service system;
and the server establishes the first session connection according to the first user identifier and the session token.
According to the message pushing method provided by the invention, the server establishes the first session connection according to the first user identifier and the session token, and the method comprises the following steps:
the server determines a first session identifier of the first session connection according to the first user identifier and the session token;
if the server determines that the session identifier list corresponding to the first user identifier includes the first session identifier, updating the session effective time corresponding to the first session connection to the session effective time indicated by the authority authentication service system;
if the server determines that the session identifier list corresponding to the first user identifier does not include the first session identifier, the server adds the first session identifier to the session identifier list, establishes a first mapping relationship between the session token and the first session identifier, establishes a second mapping relationship between the session token and the first user identifier, and updates the session effective time corresponding to the first session connection to the session effective time indicated by the permission authentication service system.
The message pushing method provided by the invention further comprises the following steps:
the client sends a Web-Socket connection closing request to the server, wherein the Web-Socket connection closing request comprises a second user identifier of a second message receiver, and the second message receiver is used for representing any message receiver in the one or more message receivers;
and deleting the session information in the session identification list corresponding to the second user identification by the server according to the Web-Socket connection closing request.
According to the message pushing method provided by the invention, after deleting the session information in the session identifier list corresponding to the second user identifier according to the Web-Socket connection closing request, the server side further comprises:
and if the session identifier list corresponding to the second user identifier is empty information, deleting the second user identifier from the user list.
The present invention also provides a message pushing device for a message pushing service system established with a user list for storing one or more message recipients, the device comprising:
the first determining module is used for determining a target message receiver of a target message to be pushed;
A second determining module, configured to determine a session connection corresponding to the target message receiver if it is determined that the user list includes the target message receiver;
and the message pushing module is used for pushing the target message to the target message receiver through the session connection corresponding to the target message receiver if the session connection corresponding to the target message receiver is determined to be in the session effective time indicated by the authority authentication service system, wherein the authority authentication service system is independent of the message pushing service system and is used for verifying the authority of a user logging in the message pushing service system.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the message pushing method as described in any one of the above when executing the program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of a message pushing method as described in any of the above.
The invention also provides a computer program product having a computer program stored thereon, which when executed by a processor, implements the steps of a message pushing method as described in any of the above.
According to the message pushing method, device, equipment and storage medium, the message is effectively pushed by determining the target message receiver of the target message to be pushed, so that fake users and information leakage are prevented. If the user list comprises the target message receiver, determining the session connection corresponding to the target message receiver, and improving the effectiveness of message pushing and the safety of user information. And if the session connection corresponding to the target message receiver is determined to be within the session effective time indicated by the authority authentication service system, pushing the target message to the target message receiver through the session connection corresponding to the target message receiver. And the validity of message pushing is improved by keeping the validity time of the session connection corresponding to the target message receiver synchronous with the session validity time indicated by the authority authentication service system.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a message pushing method provided by the invention;
fig. 2 is a schematic diagram of a scenario of a message pushing method provided by the present invention;
fig. 3 is a schematic flow chart (ii) of the message pushing method provided by the present invention;
fig. 4 is a schematic flow chart (iii) of the message pushing method provided by the present invention;
fig. 5 is a schematic flow chart (fourth) of the message pushing method provided by the present invention;
fig. 6 is a schematic flow chart (fifth) of the message pushing method provided by the present invention;
FIG. 7 is a schematic diagram of a message pushing device according to the present invention;
fig. 8 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The message pushing method, device, equipment and storage medium of the present invention are described below with reference to fig. 1 to 8.
Fig. 1 is a flow chart of a message pushing method provided by the present invention, as shown in fig. 1, the message pushing method of the present invention may be applied to a message pushing service system, where the message pushing service system is established with a user list for storing one or more message recipients, and the method includes:
step 101, determining a target message receiver of a target message to be pushed.
In particular, the message push service system builds a user list for storing one or more message recipients, and to ensure the validity of the message push, it is necessary to determine whether the target message recipient of the target message to be pushed is in the user list.
Step 102, if it is determined that the user list includes the target message receiver, determining a session connection corresponding to the target message receiver.
Specifically, if the target message receiver is in the user list, indicating that the target message receiver is an effective user, determining session connection corresponding to the target message receiver, and based on the target message receiver and the session connection thereof, enabling the target message receiver to receive the corresponding message; if the target message receiver is not included in the user list, indicating that the target message receiver is an invalid user, only the target message can be stored at the moment, and the target message is not pushed to the target message receiver, so that the message pushing to the invalid user is avoided.
Step 103, if it is determined that the session connection corresponding to the target message receiver is within the session effective time indicated by the authority authentication service system, the authority authentication service system is a system independent of the message pushing service system and used for verifying the authority of the user logging in the message pushing service system, and then the target message is pushed to the target message receiver through the session connection corresponding to the target message receiver.
Specifically, if the session connection corresponding to the target message receiver is within the session valid time indicated by the authority authentication service system (i.e., the session connection is in a valid state), the target message can be pushed to the target message receiver through the session connection; if the session connection corresponding to the target message receiver is not in the session valid time indicated by the authority authentication service system (i.e. the session connection is in an invalid state), only the target message can be stored at this time, and the target message is not pushed to the target message receiver, so that message pushing failure is avoided.
The session valid time indicated by the authority authentication service system may be a session valid time obtained by the message push service system from the authority authentication service system.
The message pushing method provided by the invention can be used for effectively pushing the message by determining the target message receiver of the target message to be pushed, so that fake users and information leakage are prevented. If the user list comprises the target message receiver, determining the session connection corresponding to the target message receiver, and improving the effectiveness of message pushing and the safety of user information. And if the session connection corresponding to the target message receiver is determined to be within the session effective time indicated by the authority authentication service system, pushing the target message to the target message receiver through the session connection corresponding to the target message receiver. And the validity of message pushing is improved by keeping the validity time of the session connection corresponding to the target message receiver synchronous with the session validity time indicated by the authority authentication service system.
Based on any of the above embodiments, in this embodiment, if it is determined that the user list does not include the target message receiver, or it is determined that the session connection corresponding to the target message receiver is not within the session valid time indicated by the authority authentication service system, the target message is not pushed to the target message receiver through the session connection corresponding to the target message receiver.
Specifically, the target message is received only if the target message recipient is in the user list of the message push service system and the session connection of the target message recipient is within the session validity time indicated by the rights authentication service system. And determining that the user list does not comprise the target message receiver, or determining that the session connection corresponding to the target message receiver is not in the session effective time indicated by the authority authentication service system, wherein the condition that the target message receiver does not reach the condition of receiving the target message is indicated, and the target message receiver does not receive the pushed target message through the corresponding session connection.
The message pushing method provided by the invention can improve the efficiency of pushing the target message by verifying the validity of the target message receiver and the session connection thereof.
Based on any one of the above embodiments, in this embodiment, the message push service system includes a client and a server; the method further comprises the steps of: a first session connection corresponding to a first message recipient is established through the client and the server, the first message recipient being operable to characterize any one of the one or more message recipients.
Specifically, as shown in fig. 2, fig. 2 is a schematic view of a scenario of the message pushing method provided by the present invention. The message push service system completes service construction through a client (e.g., the Web end in fig. 2) and a server (e.g., the server in fig. 2), that is, establishes a first session connection corresponding to a first message recipient through the client and the server. And the message push service system and the authority authentication service system are not directly connected, the authority authentication service system is independent of the message push service system, the message push service system is taken as a client (client) end by setting a calling mode (for example, a Feign mode), and the authority authentication service system is taken as a service (service) end to establish request connection, so that the message push service system can acquire the session failure time from the authority authentication service system.
After the first session connection is established, the message push service system determines whether to push the message to the target message recipient by determining whether the session connection corresponding to the target message recipient is within a session validity time indicated by the entitlement authentication service system.
The session valid time indicated by the authority authentication service system may be a session valid time obtained by the message push service system from the authority authentication service system. Such as: the server side (e.g., server side in fig. 2) of the message pushing service system obtains the session valid time of the token from the right authentication service system according to the session token (i.e., token) provided by the client side (e.g., web side in fig. 2) of the message pushing service system, and updates the valid time of the corresponding session in the message pushing service system according to the session valid time of the token.
The message pushing method provided by the invention can establish the session connection corresponding to the message receiver through the client and the server, thereby facilitating the message pushing of the message pushing service system.
Based on any of the foregoing embodiments, in this embodiment, establishing, by the client and the server, a first session connection corresponding to a first message recipient includes: the client sends a network protocol Web-Socket connection establishment request to the server, wherein the Web-Socket connection request comprises a first user identification of a first message receiver and a session token indicated by a permission authentication service system; the server establishes a first session connection according to the first user identification and the session token.
Specifically, web-Socket is a full duplex communication protocol based on transmission control protocol (Transmission Control Protocol, TCP). The client of the message pushing service system sends a connection request to the server through a network protocol Web-Socket, wherein the Web-Socket connection request comprises user identification (userID) information and session token (token) information of a target message receiver, and the token is generated by the authority authentication service system. The server establishes corresponding session connection information according to user identification information (userID) and session token information.
The message pushing method provided by the invention can be used for improving the validity of session connection by establishing the corresponding session connection information based on the user ID information and the session token (token) information.
Based on any of the foregoing embodiments, in this embodiment, the server establishes a first session connection according to the first user identifier and the session token, including:
the server determines a first session identifier of the first session connection according to the user identifier and the session token;
if the server determines that the session identifier list corresponding to the first user identifier includes the first session identifier, updating the session effective time corresponding to the first session connection to the session effective time indicated by the authority authentication service system;
If the server determines that the session identifier list corresponding to the first user identifier does not include the first session identifier, adding the first session identifier to the session identifier list, establishing a first mapping relation between the session token and the first session identifier, establishing a second mapping relation between the session token and the first user identifier, and updating the session effective time corresponding to the first session connection to the session effective time indicated by the authority authentication service system.
Specifically, the server side of the message push service system determines the first session identifier of the first session connection through the user identifier (i.e. userID) information and the session token (i.e. token) information, and if the server side determines that the session identifier list corresponding to the first user identifier includes the first session identifier, it indicates that the first session connection corresponding to the first session identifier is a reestablished session connection, at this time, the session valid time corresponding to the first session connection may be updated to the session valid time indicated by the permission authentication service system.
If the server determines that the session identifier list corresponding to the first user identifier does not include the first session identifier, it indicates that the first session connection corresponding to the first session identifier is a newly established session connection, at this time, the first session identifier may be added to the session identifier list, a first mapping relationship between the session token and the first session identifier is established, a second mapping relationship between the session token and the first user identifier is established, and the session valid time corresponding to the first session connection is updated to the session valid time indicated by the authority authentication service system, so as to complete synchronization between the session connection valid time of the target message receiver and the session valid time indicated by the authority authentication service system.
In this embodiment, as shown in fig. 3, the session connection establishment procedure may include:
(1) The client (e.g., the Web end in fig. 2) sends a Web-Socket connection establishment request to the server (e.g., the server in fig. 2), where the Web-Socket connection establishment request includes a user identification (i.e., userID)) and a session token (i.e., token).
(2) The server (e.g., the server in fig. 2) receives a Web-Socket connection establishment request that includes a user identification (i.e., userID) and a session token (i.e., token).
(3) The server (e.g., the server in fig. 2) generates a corresponding session identifier (i.e., sessionID) according to the user identifier (i.e., userID) and the session token (i.e., token). Each hypertext transfer protocol (http) session has a session unique identifier, web-Socket protocol communication is adopted in the data push service, and based on the long connection of the TCP, a session unique identifier, namely sessionID, is also needed. If the sessionID fails, the connection will also be broken.
(4) The server (e.g., the server in fig. 2) determines whether the user identifier (i.e., userID) exists in the user list: if so, the authority authentication service system can further judge whether a session token (namely token) exists in a session token list. If not, a user identification (i.e., userID) can be added to the user list; and then judging the session token (namely token).
(5) The server (e.g., the server in fig. 2) determines whether the session token (i.e., token) is in the session token list: if so, judging whether the session identifier (i.e. sessionID) exists in the session identifier list; if not, the session token (i.e., token) may be added to the session token list, and then it may be determined whether the session identifier (i.e., session id) exists in the session identifier list.
(6) The server (for example, the server in fig. 2) determines whether the session identifier (i.e., session id) exists in the session identifier list, and if so, the session valid time corresponding to the session connection can be directly updated to the session valid time indicated by the authority authentication service system; if not, the server (e.g., the server in FIG. 2) may:
a. the session identification (i.e., sessionID) is added to the session identification list.
b. A first mapping relationship of the session token (i.e., token) and the session identification (i.e., session id) is established. The first mapping relationship may be a token and sessionID association MAP. Where Map is a data set developed by java, map set classes are used to store element pairs (called "keys" and "values"), where each key maps to a value. And by establishing the first mapping relation, the session connection session failure time is conveniently updated according to the acquired token failure time. The MAP data set already stores the mapping relation between token and session. After the time of failure of the token is acquired, the token can find the session according to the mapping relation, and then update the time of failure of the session.
c. And establishing a second mapping relation between the session token (namely token) and the user identifier (namely userID), so that the subsequent session corresponding to the userId is conveniently cleared according to the expired token, and invalid message pushing is avoided.
d. And updating the session effective time corresponding to the session connection to the session effective time indicated by the authority authentication service system.
It can be seen that the session connection, whether a new session is established or an original session is re-established, requires updating the expiration time, i.e., the session validity time indicated by the rights authentication service system (e.g., the session expiration time of the default rights authentication service system). Namely, the session effective time corresponding to the session connection is updated to the session effective time indicated by the authority authentication service system, and the establishment of the session connection is completed.
After the session connection is established, the message pushing procedure is as shown in fig. 4, and the server side of the message pushing service system (e.g., the server side in fig. 2) actively listens for the message and pushes the message. The server can realize real-time monitoring through NatListener, which is a monitoring module developed for NATS distributed message queues and is mainly used for monitoring messages sent by other platforms, service modules and terminals. After receiving the message, decoding and analyzing the message, and matching the user list according to the receiver (i.e. userID) of the target message, if the matching is successful, pushing the message to all effective session connections under the user identifier (i.e. userID) through onMessage in real time, so that the Web end (e.g. the Web end in FIG. 2) receives the message. If the matching is not realized, only the message storage can be performed, and the message is marked as not pushed.
The message pushing method provided by the invention can update the session effective time corresponding to the connection established by the new session or the connection re-established by the original session to the session effective time indicated by the authority authentication service system, thereby realizing the synchronization of the session.
Based on any of the foregoing embodiments, in this embodiment, the message pushing method may further include:
the client sends a Web-Socket connection closing request to the server, wherein the Web-Socket connection closing request comprises a second user identifier of a second message receiver, and the second message receiver is used for representing any message receiver in one or more message receivers; and deleting the session information in the session identification list corresponding to the second user identification by the server according to the Web-Socket connection closing request.
Specifically, the client sends a Web-Socket connection closing request to the server, where the Web-Socket connection closing request includes a second user identifier (i.e., userID) of a second message receiver, where the second message receiver may be multiple, and the second message receiver is used to characterize any message receiver in the one or more message receivers. The server deletes the session information in the session identification list corresponding to the second user identification according to the Web-Socket connection closing request, thereby avoiding the forging and information leakage of the session information of the subsequent user.
Note that the session information in the present embodiment may include, but is not limited to, the following:
session identification, i.e., sessionID;
session timeOut, i.e., timeOut;
a session open/close state, i.e., status;
the session requests a uniform resource identifier (Uniform Resource Identifier, URI), i.e. URI.
According to the message pushing method provided by the invention, the server side deletes the session information in the session identification list corresponding to the second user identification according to the Web-Socket connection closing request, so that the protection of the security of the user information is improved.
Based on any of the foregoing embodiments, in this embodiment, after deleting the session information in the session identifier list corresponding to the second user identifier according to the Web-Socket connection closing request, the server further includes: and if the session identifier list corresponding to the second user identifier is empty information, deleting the second user identifier from the user list.
Specifically, as shown in fig. 5, fig. 5 shows a schematic diagram of a session connection time-efficient refresh and object cleaning process. According to the session expiration time of the authority authentication service system, periodically traversing the session tokens (i.e. token) in the session token list, verifying the validity of the session tokens (i.e. token) through the authority authentication system, refreshing the session connection expiration time according to the acquired session token (i.e. token), and when the session tokens (i.e. token) are monitored to be invalid, clearing invalid session connection (i.e. sessionID) and empty user (i.e. user) information of the corresponding session tokens (i.e. token) through the first mapping relation and the second mapping relation.
In this embodiment, as shown in fig. 6, fig. 6 shows a closing process of session connection, including: when a user closes a Web page, a session connection closing request (i.e., a Web-Socket connection closing request) needs to be initiated by a Web end (e.g., the Web end in fig. 2), and a server end (e.g., the server end in fig. 2) performs handshake closing and returns closing result data. After receiving a session connection closing request (i.e., a Web-Socket connection closing request), the server acquires a session identification list (i.e., a session list) corresponding to the current user, clears current session connection information from the session identification list (i.e., the session list), judges whether the session identification list (i.e., the session list) corresponding to the current user is empty, and if so, clears the current user information in the user list to avoid subsequent user session connection falsification and information leakage.
According to the message pushing method, invalid user and session connection information are timely cleared when connection is closed, meanwhile, the current session validity is periodically traversed according to the expiration time of the authority authentication service system, the valid session expiration time is timely refreshed, invalid user and session information are timely cleared, information leakage caused by the fact that the invalid user and session are forged is avoided, and meanwhile, bandwidth waste is avoided.
The message pushing device provided by the invention is described below, and the message pushing device described below and the message pushing method described above can be referred to correspondingly.
Fig. 7 is a schematic diagram of a message pushing device according to the present invention, which may be used in a message pushing service system, the message pushing service system being established with a user list for storing one or more message recipients, the message pushing device may include:
a first determining module 71, configured to determine a target message receiver of a target message to be pushed;
a second determining module 72, configured to determine a session connection corresponding to the target message receiver if it is determined that the user list includes the target message receiver;
and the message pushing module 73 is configured to push the target message to the target message receiver through the session connection corresponding to the target message receiver if it is determined that the session connection corresponding to the target message receiver is within the session valid time indicated by the authority authentication service system, where the authority authentication service system is a system independent from the message pushing service system and used for verifying the authority of the user to log in the message pushing service system.
The message pushing device provided by the invention can effectively push the message by determining the target message receiver of the target message to be pushed, and prevent fake users and information leakage. If the user list comprises the target message receiver, determining the session connection corresponding to the target message receiver, and improving the effectiveness of message pushing and the safety of user information. And if the session connection corresponding to the target message receiver is determined to be within the session effective time indicated by the authority authentication service system, pushing the target message to the target message receiver through the session connection corresponding to the target message receiver. And the validity of message pushing is improved by keeping the validity time of the session connection corresponding to the target message receiver synchronous with the session validity time indicated by the authority authentication service system.
Based on any of the foregoing embodiments, in this embodiment, the message pushing device further includes:
and the message authentication module is used for pushing the target message to the target message receiver without passing through the session connection corresponding to the target message receiver if the user list is determined not to comprise the target message receiver or if the session connection corresponding to the target message receiver is determined not to be in the session effective time indicated by the authority authentication service system.
The message pushing device provided by the invention can improve the efficiency of pushing the target message by verifying the validity of the target message receiver and the session connection thereof.
Based on any one of the above embodiments, in this embodiment, the message push service system includes a client and a server; the message pushing device further comprises:
the system comprises a setting module, a setting module and a communication module, wherein the setting module is used for setting up a first session connection corresponding to a first message receiver through a client and a server, and the first message receiver is used for representing any message receiver in one or more message receivers.
The message pushing device provided by the invention can establish the session connection corresponding to the message receiver through the client and the server, so that the message pushing service system can push messages conveniently.
Based on any of the foregoing embodiments, in this embodiment, the establishing module includes:
the sending submodule is used for sending a network protocol Web-Socket connection establishment request to the server by the client, wherein the Web-Socket connection request comprises a first user identifier of a first message receiver and a session token indicated by the authority authentication service system;
and the establishing sub-module is used for the server to establish the first session connection according to the first user identifier and the session token.
The message pushing device provided by the invention can establish corresponding session connection information based on the user identification information userID and the session token information, so that the validity of session connection is improved.
Based on any of the above embodiments, in this embodiment, establishing the submodule includes:
the determining unit is used for determining a first session identifier of the first session connection according to the user identifier and the session token by the server;
the updating unit is used for updating the session effective time corresponding to the first session connection into the session effective time indicated by the authority authentication service system if the server determines that the session identifier list corresponding to the first user identifier comprises the first session identifier;
the server side is used for determining that the session identifier list corresponding to the first user identifier does not comprise the first session identifier, adding the first session identifier into the session identifier list, establishing a first mapping relation between the session token and the first session identifier, establishing a second mapping relation between the session token and the first user identifier, and updating the session effective time corresponding to the first session connection into the session effective time indicated by the authority authentication service system.
The message pushing device provided by the invention can update the session effective time corresponding to the session connection of the target receiving user into the session effective time indicated by the authority authentication service system, thereby realizing the synchronization of the session.
Based on any of the foregoing embodiments, in this embodiment, the message pushing apparatus may further include:
the sending module is used for sending a Web-Socket connection closing request to the server by the client, wherein the Web-Socket connection closing request comprises a second user identifier of a second message receiver, and the second message receiver is used for representing any message receiver in one or more message receivers;
and the deleting module is used for deleting the session information in the session identification list corresponding to the second user identification according to the Web-Socket connection closing request by the server.
According to the message pushing device provided by the invention, the server side deletes the session information in the session identification list corresponding to the second user identification according to the Web-Socket connection closing request, so that the protection of the security of the user information is improved.
Based on any of the foregoing embodiments, in this embodiment, the deletion module is specifically further configured to:
and if the session identifier list corresponding to the second user identifier is empty information, deleting the second user identifier from the user list.
The message pushing device provided by the invention timely clears the invalid user and the session connection information when the connection is closed, periodically traverses the validity of the current session according to the expiration time of the authority authentication service system, timely refreshes the expiration time of the valid session and timely clears the invalid user and the session information. Information leakage caused by falsification of invalid users and sessions is avoided, and meanwhile, bandwidth waste is also avoided.
Fig. 8 is a schematic structural diagram of an electronic device provided by the present invention, as shown in fig. 8, where the electronic device may be used in a message pushing system, and includes: processor 810, communication interface (Communications Interface) 820, memory 830, and communication bus 840, wherein processor 810, communication interface 820, memory 830 accomplish communication with each other through communication bus 840. The processor 810 may invoke logic instructions in the memory 830 to perform a message pushing method comprising:
determining a target message receiver of a target message to be pushed;
if the user list is determined to comprise the target message receiver, determining session connection corresponding to the target message receiver;
if the session connection corresponding to the target message receiver is determined to be within the effective session time indicated by the authority authentication service system, the authority authentication service system is independent of the message pushing service system and is used for verifying the authority of the user logging in the message pushing service system, and then the target message is pushed to the target message receiver through the session connection corresponding to the target message receiver.
Further, the logic instructions in the memory 830 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method of the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, are capable of performing a message pushing method provided by the above methods, the method comprising:
Determining a target message receiver of a target message to be pushed;
if the user list is determined to comprise the target message receiver, determining session connection corresponding to the target message receiver;
if the session connection corresponding to the target message receiver is determined to be within the effective session time indicated by the authority authentication service system, the authority authentication service system is independent of the message pushing service system and is used for verifying the authority of the user logging in the message pushing service system, and then the target message is pushed to the target message receiver through the session connection corresponding to the target message receiver.
In yet another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the message pushing methods provided above, the method comprising:
determining a target message receiver of a target message to be pushed;
if the user list is determined to comprise the target message receiver, determining session connection corresponding to the target message receiver;
if the session connection corresponding to the target message receiver is determined to be within the effective session time indicated by the authority authentication service system, the authority authentication service system is independent of the message pushing service system and is used for verifying the authority of the user logging in the message pushing service system, and then the target message is pushed to the target message receiver through the session connection corresponding to the target message receiver.
The apparatus embodiments described above are merely illustrative, wherein elements illustrated as separate elements may or may not be physically separate, and elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on such understanding, the foregoing technical solutions may be embodied essentially or in part in the form of a software product, which may be stored in a computer-readable storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the various embodiments or methods of some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (7)

1. A message pushing method for a message pushing service system established with a user list for storing one or more message recipients, the method comprising:
determining a target message receiver of a target message to be pushed;
if the user list is determined to comprise the target message receiver, determining session connection corresponding to the target message receiver;
if the session connection corresponding to the target message receiver is determined to be within the session effective time indicated by the authority authentication service system, wherein the authority authentication service system is independent of the message pushing service system and is used for verifying the authority of a user logging in the message pushing service system, pushing the target message to the target message receiver through the session connection corresponding to the target message receiver, and the message pushing service system comprises a client and a server; the method further comprises the steps of:
Establishing a first session connection corresponding to a first message recipient through the client and the server, wherein the first message recipient is used for characterizing any message recipient in the one or more message recipients, and the establishing the first session connection corresponding to the first message recipient through the client and the server includes:
the client sends a network protocol Web-Socket connection establishment request to the server, wherein the Web-Socket connection request comprises a first user identification of the first message receiver and a session token indicated by the authority authentication service system;
the server establishes the first session connection according to the first user identifier and the session token, wherein the server establishes the first session connection according to the first user identifier and the session token, and the method comprises the following steps:
the server determines a first session identifier of the first session connection according to the first user identifier and the session token;
if the server determines that the session identifier list corresponding to the first user identifier includes the first session identifier, updating the session effective time corresponding to the first session connection to the session effective time indicated by the authority authentication service system;
If the server determines that the session identifier list corresponding to the first user identifier does not include the first session identifier, the server adds the first session identifier to the session identifier list, establishes a first mapping relationship between the session token and the first session identifier, establishes a second mapping relationship between the session token and the first user identifier, and updates the session effective time corresponding to the first session connection to the session effective time indicated by the permission authentication service system.
2. The message pushing method of claim 1, further comprising:
and if the user list is determined not to comprise the target message receiver, or if the session connection corresponding to the target message receiver is determined not to be in the session effective time indicated by the authority authentication service system, the target message is not pushed to the target message receiver through the session connection corresponding to the target message receiver.
3. The message pushing method of claim 1, further comprising:
the client sends a Web-Socket connection closing request to the server, wherein the Web-Socket connection closing request comprises a second user identifier of a second message receiver, and the second message receiver is used for representing any message receiver in the one or more message receivers;
And deleting the session information in the session identification list corresponding to the second user identification by the server according to the Web-Socket connection closing request.
4. The message pushing method according to claim 3, wherein after deleting the session information in the session identifier list corresponding to the second user identifier according to the Web-Socket connection closing request, the method further includes:
and if the session identifier list corresponding to the second user identifier is empty information, deleting the second user identifier from the user list.
5. A message pushing apparatus for use in a message pushing service system established with a user list for storing one or more message recipients, the apparatus comprising:
the first determining module is used for determining a target message receiver of a target message to be pushed;
a second determining module, configured to determine a session connection corresponding to the target message receiver if it is determined that the user list includes the target message receiver;
a message pushing module, configured to, if it is determined that a session connection corresponding to the target message receiver is within a session valid time indicated by an authority authentication service system, where the authority authentication service system is a system independent of the message pushing service system and is used to verify authority of a user to log in the message pushing service system, push the target message to the target message receiver through the session connection corresponding to the target message receiver, where the message pushing service system includes a client and a server; the message pushing device further comprises:
An establishing module, configured to establish, by using the client and the server, a first session connection corresponding to a first message receiver, where the first message receiver is used to characterize any one of the one or more message receivers, and the establishing module includes:
a sending sub-module, configured to send a network protocol Web-Socket connection establishment request to the server by using the client, where the Web-Socket connection request includes a first user identifier of the first message receiver and a session token indicated by the authority authentication service system;
the establishing submodule is configured to establish the first session connection according to the first user identifier and the session token by using the server, where the establishing submodule includes:
a determining unit, configured to determine, by the server, a first session identifier of the first session connection according to the first user identifier and the session token;
the updating unit is configured to update the session valid time corresponding to the first session connection to the session valid time indicated by the authority authentication service system if the server determines that the session identifier list corresponding to the first user identifier includes the first session identifier;
The establishing unit is configured to, if it is determined that the session identifier list corresponding to the first user identifier does not include the first session identifier, add the first session identifier to the session identifier list, establish a first mapping relationship between the session token and the first session identifier, establish a second mapping relationship between the session token and the first user identifier, and update a session valid time corresponding to the first session connection to a session valid time indicated by the permission authentication service system.
6. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the message pushing method according to any of claims 1 to 4 when the program is executed by the processor.
7. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor performs the steps of the message pushing method according to any of claims 1 to 4.
CN202110850114.5A 2021-07-27 2021-07-27 Message pushing method, device, equipment and storage medium Active CN113596147B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110850114.5A CN113596147B (en) 2021-07-27 2021-07-27 Message pushing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110850114.5A CN113596147B (en) 2021-07-27 2021-07-27 Message pushing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113596147A CN113596147A (en) 2021-11-02
CN113596147B true CN113596147B (en) 2023-10-24

Family

ID=78250655

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110850114.5A Active CN113596147B (en) 2021-07-27 2021-07-27 Message pushing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113596147B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114301971A (en) * 2021-12-28 2022-04-08 北京天融信网络安全技术有限公司 Operation and maintenance method and device based on batch sending of instructions, computer equipment and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104767775A (en) * 2014-01-06 2015-07-08 腾讯科技(深圳)有限公司 Webpage application information push method and webpage application information push system
CN105337973A (en) * 2015-10-27 2016-02-17 上海钢富电子商务有限公司 Message exchange method and system
CN108337296A (en) * 2018-01-12 2018-07-27 深圳壹账通智能科技有限公司 Message push processing method, device, computer equipment and storage medium
CN108460115A (en) * 2018-02-10 2018-08-28 深圳壹账通智能科技有限公司 Information push method, device, computer equipment and storage medium
CN108833521A (en) * 2018-06-06 2018-11-16 广州视源电子科技股份有限公司 Message pushing method, device, system, computer equipment and storage medium
CN109525620A (en) * 2017-09-20 2019-03-26 中移(杭州)信息技术有限公司 A kind of message push system, method and device
CN110493308A (en) * 2019-07-08 2019-11-22 中国平安人寿保险股份有限公司 Distributed consensus system session method, apparatus and storage medium, server
CN111970315A (en) * 2019-05-20 2020-11-20 北京车和家信息技术有限公司 Method, device and system for pushing message
CN112202663A (en) * 2020-09-28 2021-01-08 厦门美柚股份有限公司 Message pushing method, device, terminal and medium
CN112632375A (en) * 2020-12-18 2021-04-09 深圳市和讯华谷信息技术有限公司 Session information processing method, server and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8649768B1 (en) * 2011-08-24 2014-02-11 Cellco Partnership Method of device authentication and application registration in a push communication framework

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104767775A (en) * 2014-01-06 2015-07-08 腾讯科技(深圳)有限公司 Webpage application information push method and webpage application information push system
CN105337973A (en) * 2015-10-27 2016-02-17 上海钢富电子商务有限公司 Message exchange method and system
CN109525620A (en) * 2017-09-20 2019-03-26 中移(杭州)信息技术有限公司 A kind of message push system, method and device
CN108337296A (en) * 2018-01-12 2018-07-27 深圳壹账通智能科技有限公司 Message push processing method, device, computer equipment and storage medium
CN108460115A (en) * 2018-02-10 2018-08-28 深圳壹账通智能科技有限公司 Information push method, device, computer equipment and storage medium
CN108833521A (en) * 2018-06-06 2018-11-16 广州视源电子科技股份有限公司 Message pushing method, device, system, computer equipment and storage medium
CN111970315A (en) * 2019-05-20 2020-11-20 北京车和家信息技术有限公司 Method, device and system for pushing message
CN110493308A (en) * 2019-07-08 2019-11-22 中国平安人寿保险股份有限公司 Distributed consensus system session method, apparatus and storage medium, server
CN112202663A (en) * 2020-09-28 2021-01-08 厦门美柚股份有限公司 Message pushing method, device, terminal and medium
CN112632375A (en) * 2020-12-18 2021-04-09 深圳市和讯华谷信息技术有限公司 Session information processing method, server and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
PushNotify:Push server application;Mohammad Danish;2013 3rd IEEE international Advance Computing Conference(IACC);全文 *
基于WebSocket的校园招聘信息推送系统的研究;丁易难;中国优秀硕士学位论文全文数据库 信息科技辑;全文 *

Also Published As

Publication number Publication date
CN113596147A (en) 2021-11-02

Similar Documents

Publication Publication Date Title
EP3297243B1 (en) Trusted login method and device
WO2020143095A1 (en) Method for establishing communication connection and proxy server
US10333970B2 (en) Front-end protocol for server protection
CN103503408A (en) System and method for providing access credentials
CN101771564B (en) Method, device and system for processing session context
JP2006279636A (en) Consistency guarantee management system for inter-client communication log
CN105721412A (en) Method and device for authenticating identity between multiple systems
CN109104432B (en) Information transmission safety method based on JWT protocol
CN109729000B (en) Instant messaging method and device
CN112600674A (en) User security authentication method and device for front-end and back-end separation system and storage medium
CN109936515B (en) Access configuration method, information providing method and device
CN111786783B (en) Public key certificate acquisition method and related equipment
CN113596147B (en) Message pushing method, device, equipment and storage medium
CN109525620B (en) Message pushing system, method and device
CN110290176B (en) Point-to-point information pushing method based on MQTT
CN110602111A (en) Interface anti-brushing method and system based on long connection
CN111510302A (en) Method and system for improving certificate verification efficiency in secure communication protocol
CN115811428B (en) Defense method, system, equipment and storage medium for resisting DDoS attack
CN109120578B (en) Method and device for realizing link connection processing
CN113872949B (en) Address resolution protocol response method and related device
CN115801347A (en) Method and system for enhancing network security based on single packet authorization technology
CN115766069A (en) Network security protection method and equipment based on Internet of things communication protocol
CN115037537A (en) Abnormal traffic interception and abnormal domain name identification method, device, equipment and medium
CN113498058A (en) Client privacy protection session recovery
CN107579984B (en) Network layer oriented secure communication link establishing method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Room 332, 3 / F, Building 102, 28 xinjiekouwei street, Xicheng District, Beijing 100088

Applicant after: QAX Technology Group Inc.

Applicant after: Qianxin Wangshen information technology (Beijing) Co.,Ltd.

Address before: Room 332, 3 / F, Building 102, 28 xinjiekouwei street, Xicheng District, Beijing 100088

Applicant before: QAX Technology Group Inc.

Applicant before: LEGENDSEC INFORMATION TECHNOLOGY (BEIJING) Inc.

GR01 Patent grant
GR01 Patent grant