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

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

Info

Publication number
CN113596147A
CN113596147A CN202110850114.5A CN202110850114A CN113596147A CN 113596147 A CN113596147 A CN 113596147A CN 202110850114 A CN202110850114 A CN 202110850114A CN 113596147 A CN113596147 A CN 113596147A
Authority
CN
China
Prior art keywords
session
message
service system
target message
user
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.)
Granted
Application number
CN202110850114.5A
Other languages
Chinese (zh)
Other versions
CN113596147B (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.)
Qianxin Technology Group Co Ltd
Secworld Information Technology Beijing Co Ltd
Original Assignee
Qianxin Technology Group Co Ltd
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 Qianxin Technology Group Co Ltd, Secworld Information Technology Beijing Co Ltd filed Critical Qianxin Technology Group Co Ltd
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

Images

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

Abstract

The invention provides a message pushing method, a message pushing device, message pushing 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 used 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 comprises the target message receiver, determining the 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 valid 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 message pushing device, the message pushing equipment and the message pushing storage medium realize automatic synchronization of session timeliness and improve 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 technique 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 implemented 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 an invalid user session connection, so that the user is easily forged to cause information leakage, and meanwhile, bandwidth is occupied due to the pushing of a large number of invalid messages to cause the pushing of valid messages to fail.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a message pushing method, a message pushing device, message pushing equipment and a message pushing 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 used 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 comprises the target message receiver, determining the 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 valid time indicated by the authority authentication service system, and the authority authentication service system is a system which is independent of the message push service system and is used for verifying the authority of the user for logging in the message push 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 provided by the invention further comprises the following steps:
and if the user list does not comprise the target message receiver or the session connection corresponding to the target message receiver is determined not to be in 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.
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 following steps:
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 characterizing any message receiver in the one or more message receivers.
According to a message pushing method provided by the present invention, the establishing of the first session connection corresponding to the first message recipient by 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 identifier 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 identification and the session token.
According to a message pushing method provided by the present invention, the server establishes the first session connection according to the first user identifier and the session token, including:
the server side determines a first session identifier of the first session connection according to the first user identifier and the session token;
if the server side determines that the session identification list corresponding to the first user identification comprises the first session identification, the server side updates the session valid time corresponding to the first session connection to the session valid time indicated by the authority authentication service system;
and if the server side determines that the session identification list corresponding to the first user identification does not comprise the first session identification, the server side adds the first session identification into the session identification list, establishes a first mapping relation between the session token and the first session identification, establishes a second mapping relation between the session token and the first user identification, and updates 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 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 one of the one or more message receivers;
and 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.
According to the message pushing method provided by the present invention, after the server deletes the session information in the session identifier list corresponding to the second user identifier according to the Web-Socket connection close request, the method further includes:
and if the session identification list corresponding to the second user identification is empty information, deleting the second user identification from the user list.
The present invention also provides a message push apparatus for a message push 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 recipient if it is determined that the user list includes the target message recipient;
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 valid time indicated by the authority authentication service system, and the authority authentication service system is a system which is independent of the message pushing service system and is used for verifying the authority of the user for logging in the message pushing service system.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the steps of the message pushing method.
The invention also provides 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 push method as described in any of the above.
The invention also provides a computer program product having a computer program stored thereon, which, when being executed by a processor, carries out the steps of the message push method as defined in any of the above.
The message pushing method, the message pushing device, the message pushing equipment and the storage medium provided by the invention can effectively push the message by determining the target message receiver of the target message to be pushed, thereby preventing forged users and information leakage. And 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 valid 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 validity of message pushing is improved by keeping the validity time of the session connection corresponding to the target message receiver synchronous with the validity time of the session indicated by the authority authentication service system.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a message pushing method provided by the present invention;
fig. 2 is a schematic view of a scenario of a message pushing method provided by the present invention;
fig. 3 is a flow chart of a message pushing method provided by the present invention (two);
fig. 4 is a flow chart schematic diagram (three) of a message pushing method provided by the present invention;
fig. 5 is a flow chart schematic diagram (four) of a message pushing method provided by the present invention;
fig. 6 is a schematic flow chart (five) of a message pushing method provided by the present invention;
fig. 7 is a schematic structural diagram of a message pushing apparatus provided in the present invention;
fig. 8 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The message pushing method, apparatus, device and storage medium of the present invention are described below with reference to fig. 1 to 8.
Fig. 1 is a schematic flow chart of a message pushing method provided by the present invention, and 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.
Specifically, the message pushing service system is established with a user list for storing one or more message receivers, and in order to ensure the effectiveness of message pushing, it is required to determine whether a target message receiver of a target message to be pushed is in the user list.
And 102, if the user list comprises the target message receiver, determining the session connection corresponding to the target message receiver.
Specifically, if the target message receiver is in the user list and indicates that the target message receiver is a valid user, determining the session connection corresponding to the target message receiver, and based on the target message receiver and the session connection thereof, the target message receiver can receive the corresponding message; if the user list does not include the target message receiver, indicating that the target message receiver is an invalid user, only the target message may be stored, and the target message is not pushed to the target message receiver, thereby avoiding pushing the message to the invalid user.
And 103, if the session connection corresponding to the target message receiver is determined to be within the session valid time indicated by the authority authentication service system, and the authority authentication service system is a system which is independent of the message push service system and is used for verifying the authority of the user for logging in the message push service system, pushing the target message 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 may be pushed to the target message receiver through the session connection at this time; 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, thereby avoiding message push failure.
The session valid time indicated by the authority authentication service system may be the session valid time acquired by the message push service system from the authority authentication service system.
The message pushing method provided by the invention can effectively push the message by determining the target message receiver of the target message to be pushed, thereby preventing forged users and information leakage. And if the user list is determined to include 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 valid 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 validity of message pushing is improved by keeping the validity time of the session connection corresponding to the target message receiver synchronous with the validity time of the session indicated by the authority authentication service system.
Based on any of the above embodiments, in this embodiment, if it is determined that the target message recipient is not included in the user list, or it is determined that the session connection corresponding to the target message recipient is not within the session valid time indicated by the authority authentication service system, the target message is not pushed to the target message recipient through the session connection corresponding to the target message recipient.
Specifically, the target message is received only if the target message receiver is in the user list of the message push service system and the session connection of the target message receiver is within the session valid time indicated by the authority authentication service system. And determining that the user list does not include the target message receiver, or determining that the session connection corresponding to the target message receiver is not in the session valid time indicated by the authority authentication service system, which indicates that the target message receiver does not reach the condition of receiving the target message, 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 validity 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 following steps: 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 characterizing any message receiver in one or more message receivers.
Specifically, as shown in fig. 2, fig. 2 is a scene schematic diagram of the message pushing method provided by the present invention. The message push service system completes service construction through a client (for example, a Web end in fig. 2) and a server (for example, a server in fig. 2), that is, a first session connection corresponding to a first message receiver is established 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, and the message push service system and the authority authentication service system can establish request connection by setting a calling mode (for example, a Feign mode) to use the message push service system as a client (client) end and the authority authentication service system as a service (service) end, so that the message push service system can acquire session failure time from the authority authentication service system.
After establishing the first session connection, the message push service system determines whether to push the message to the target message receiver by determining whether the session connection corresponding to the target message receiver is within the session valid time indicated by the authority authentication service system.
The session valid time indicated by the authority authentication service system may be the session valid time acquired by the message push service system from the authority authentication service system. Such as: a server (e.g., the server in fig. 2) of the message push service system obtains the session valid time of the token from the right authentication service system according to a session token (i.e., token) provided by a client (e.g., the Web in fig. 2) of the message push service system, and updates the valid time of the corresponding session in the message push 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, and is convenient for the message pushing service system to push the message.
Based on any of the above embodiments, in this embodiment, establishing, by a client and a 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 identifier of a first message receiver and a session token indicated by an authority authentication service system; and the server establishes a first session connection according to the first user identification and the session token.
Specifically, the Web-Socket is a full duplex communication Protocol based on a Transmission Control Protocol (TCP). The method comprises the steps that a client side of a message pushing service system sends a connection request to a server side 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 an authority authentication service system. And the server establishes corresponding session connection information according to the user identification information (userID) and the session token information.
The message pushing method provided by the invention can establish the corresponding session connection information based on the user identification (userID information and token) information, thereby improving the effectiveness of session connection.
Based on any of the foregoing embodiments, in this embodiment, the establishing, by the server, the first session connection according to the first user identifier and the session token includes:
the server side determines a first session identifier of the first session connection according to the user identifier and the session token;
if the server side determines that the session identification list corresponding to the first user identification comprises the first session identification, the session valid time corresponding to the first session connection is updated to the session valid time indicated by the authority authentication service system;
If the server side determines that the session identification list corresponding to the first user identification does not include the first session identification, the server side adds the first session identification into the session identification list, establishes a first mapping relation between the session token and the first session identification, establishes a second mapping relation between the session token and the first user identification, and updates the session effective time corresponding to the first session connection into the session effective time indicated by the authority authentication service system.
Specifically, a server of the message push service system determines a first session identifier of the first session connection through user identifier (i.e., userID) information and session token (i.e., token) information, and if the server determines that a 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 re-established session connection, and at this time, a session valid time corresponding to the first session connection may be updated to a 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 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, thereby completing 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) a client (e.g., the Web server in fig. 2) sends a Web-Socket connection establishment request to a server (e.g., the server in fig. 2), where the Web-Socket connection establishment request includes a user identifier (i.e., userID) and a session token (i.e., token).
(2) A server (e.g., the server in fig. 2) receives a Web-Socket connection establishment request, which includes a user identifier (i.e., userID) and a session token (i.e., token).
(3) A 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 TCP long connection, a session unique identifier, namely sessionID, is also required. If 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, whether a session token (i.e., token) exists in a session token list in the authority authentication service system may be further determined. If not, the user identification (i.e., userID) may be added to the user list; then, the judgment of the session token (i.e. token) is carried out.
(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 yes, judging whether the session identifier (namely 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 is determined whether the session identifier (i.e., sessionID) exists in the session identifier list.
(6) The server (for example, the server in fig. 2) determines whether the session identifier (i.e., the sessionID) exists in the session identifier list, and if the session identifier (i.e., the sessionID) exists in the session identifier list, the session valid time corresponding to the session connection may 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 of the session token (i.e., token) to the session identification (i.e., sessionID) is established. The first mapping relationship may be that token associates MAP with sessionID. Where Map is a java developed data set, the Map set class is used to store element pairs (called "keys" and "values"), where each key maps to a value. By establishing the first mapping relation, the session connection session failure time can be updated conveniently according to the acquired token failure time. The MAP data set already stores the mapping relationship between token and session. After the failure time of the token is acquired subsequently, the token can find the session according to the mapping relation, and then the session failure time is updated.
c. And establishing a second mapping relation between the session token (i.e. token) and the user identifier (i.e. userID), so that the session corresponding to the userId can be removed conveniently according to the expired token, and invalid message pushing is avoided.
d. And updating the session valid time corresponding to the session connection to the session valid 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 reestablished, needs to update the expiration time, i.e. the session validity time indicated by the authorization authentication service system (e.g. the session expiration time of the default authorization authentication service system). Namely, the session valid time corresponding to the session connection is updated to the session valid time indicated by the authority authentication service system, and the establishment of the session connection is completed.
After the session connection is established, a message pushing process is shown in fig. 4, where a server of the message push service system (e.g., the server in fig. 2) actively listens for and pushes a 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, matching the user list according to the receiver (i.e. userID) of the target message, and if the matching is successful, pushing the message to all the effective session connections under the user identifier (i.e. userID) in real time through the onMessage, so that the Web end (e.g. the Web end in fig. 2) receives the message. If matching is not achieved, only message storage can be carried out, and message non-push is marked.
The message pushing method provided by the invention can update the session valid time corresponding to the connection established by the new session or the connection reestablished by the original session into the session valid 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 one of one or more message receivers; and 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.
Specifically, the client sends a Web-Socket connection close request to the server, where the Web-Socket connection close request includes a second user identifier (i.e., userID) of a second message recipient, where the number of the message recipients may be multiple, and the second message recipient is used to characterize any one of the one or more message recipients. And 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 forgery and information leakage of the subsequent user session information.
It is worth pointing out that the session information in this embodiment may include, but is not limited to, the following:
session identification, namely sessionID;
session timeOut time, i.e., timeOut;
session open or closed (open/close) state, i.e., status;
a session requests a Uniform Resource Identifier (URI), i.e. a URI.
According to the message pushing method provided by the invention, 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, so that the protection degree of the security of the user information is improved.
Based on any of the foregoing embodiments, in this embodiment, after the server deletes the session information in the session identifier list corresponding to the second user identifier according to the Web-Socket connection close request, the method further includes: and if the session identification list corresponding to the second user identification is empty information, deleting the second user identification from the user list.
Specifically, as shown in fig. 5, fig. 5 is a schematic diagram illustrating a session connection time-based refresh and object cleaning process. According to the session invalidation time of the authority authentication service system, the session token (token) in the session token list is periodically traversed, the validity of the session token (token) is verified through the authority authentication system, meanwhile, the session connection invalidation time is refreshed according to the obtained session token (token) invalidation time, and in addition, when the session token (token) is monitored to be invalid, the invalid session connection (sessionID) and the empty user (user) information of the corresponding session token (token) are cleared 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 a session connection, which includes: when a user closes a Web page, a Web side (e.g., the Web side in fig. 2) needs to initiate a session connection close request (i.e., a Web-Socket connection close request), and a server side (e.g., the server side in fig. 2) performs handshake close and returns close result data. After receiving a session connection closing request (i.e., a Web-Socket connection closing request), the server acquires a session identifier list (i.e., sessionList) corresponding to a current user, removes current session connection information from the session identifier list (i.e., sessionList), determines whether the session identifier list (i.e., sessionList) corresponding to the current user is empty, and if the session identifier list is empty, removes current user information from the user list, thereby avoiding subsequent session connection falsification and information leakage.
According to the message pushing method provided by the invention, invalid user and session connection information are removed in time when the connection is closed, meanwhile, the validity of the current session is periodically traversed according to the failure time of the authority authentication service system, the valid session failure time is timely refreshed, the invalid user and session information are removed in time, the information leakage caused by the fact that the invalid user and the session are forged is avoided, and meanwhile, the bandwidth waste is also avoided.
The following describes the message pushing apparatus provided by the present invention, and the message pushing apparatus described below and the message pushing method described above may be referred to correspondingly.
Fig. 7 is a schematic structural diagram of a message pushing apparatus provided by the present invention, where the message pushing apparatus 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, and the message pushing apparatus may include:
a first determining module 71, configured to determine a target message recipient of a target message to be pushed;
a second determining module 72, configured to determine, if it is determined that the user list includes the target message recipient, a session connection corresponding to the target message recipient;
and the message pushing module 73 is configured to, 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, and the authority authentication service system is a system which is independent of the message pushing service system and is used for verifying the authority of the 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.
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, thereby preventing forged users and information leakage. And if the user list is determined to include 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 valid 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 validity of message pushing is improved by keeping the validity time of the session connection corresponding to the target message receiver synchronous with the validity time of the session indicated by the authority authentication service system.
Based on any one of the above embodiments, in this embodiment, the message pushing apparatus further includes:
and the message authentication module is used for pushing the target message to the target message receiver without passing the session connection corresponding to the target message receiver if the target message receiver is not included in the user list or the session connection corresponding to the target message receiver is determined not to be in the session valid 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 validity 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 establishing module is used for establishing a first session connection corresponding to a first message receiver through the client and the server, and the first message receiver is used for representing any one of 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, and is convenient for the message pushing service system to push messages.
Based on any one of the above 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 side by the client side, wherein the Web-Socket connection request comprises a first user identification of a first message receiver and a session token indicated by the authority authentication service system;
and the establishing submodule is used for establishing a first session connection by the server according to the first user identification and the session token.
The message pushing device provided by the invention can establish the corresponding session connection information based on the user identification information userID and the session token information, thereby improving the effectiveness of session connection.
Based on any one of the above embodiments, in this embodiment, establishing the sub-module includes:
the determining unit is used for determining a first session identifier connected with a first session according to the user identifier and the session token by the server;
the updating unit is used for updating the session valid time corresponding to the first session connection into 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 comprises the first session identifier;
and the establishing unit is used for 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 if the server determines that the session identifier list corresponding to the first user identifier does not comprise the first session identifier.
The message pushing device provided by the invention can update the session valid time corresponding to the session connection of the target receiving user to the session valid time indicated by the authority authentication service system, thereby realizing the synchronization of the session.
Based on any one of the above 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 side by the client side, 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 one of 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 by the server according to the Web-Socket connection closing request.
The message pushing device provided by the invention deletes the session information in the session identification list corresponding to the second user identification through the server according to the Web-Socket connection closing request, thereby improving the protection degree on the security of the user information.
Based on any of the above embodiments, in this embodiment, the deletion module is further specifically configured to:
and if the session identification list corresponding to the second user identification is empty information, deleting the second user identification from the user list.
The message pushing device provided by the invention can timely clear invalid user and session connection information when closing the connection, and meanwhile, periodically traverse the validity of the current session according to the failure time of the authority authentication service system, timely refresh the failure time of the valid session, and timely clear the invalid user and session information. Information leakage caused by forging 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 in the present invention, and as shown in fig. 8, the electronic device may be used in a message push system, and includes: a processor (processor)810, a communication Interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication Interface 820 and the memory 830 communicate with each other via the communication bus 840. The processor 810 may invoke logic instructions in the memory 830 to perform a message push method comprising:
determining a target message receiver of a target message to be pushed;
if the user list comprises the target message receiver, determining the 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 valid time indicated by the authority authentication service system, and the authority authentication service system is a system which is independent of the message push service system and is used for verifying the authority of the user for logging in the message push service system, pushing the target message to the target message receiver through the session connection corresponding to the target message receiver.
In addition, the logic instructions in the memory 830 may be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to 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), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, the computer program product includes a computer program stored on a non-transitory computer readable storage medium, the computer program includes program instructions, when the program instructions are executed by a computer, the computer can execute the message pushing method provided by the above methods, the method includes:
Determining a target message receiver of a target message to be pushed;
if the user list comprises the target message receiver, determining the 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 valid time indicated by the authority authentication service system, and the authority authentication service system is a system which is independent of the message push service system and is used for verifying the authority of the user for logging in the message push service system, pushing the target message 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, on which a computer program is stored, the computer program being implemented by a processor to perform the message pushing methods provided in the above aspects, the method including:
determining a target message receiver of a target message to be pushed;
if the user list comprises the target message receiver, determining the 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 valid time indicated by the authority authentication service system, and the authority authentication service system is a system which is independent of the message push service system and is used for verifying the authority of the user for logging in the message push service system, pushing the target message to the target message receiver through the session connection corresponding to the target message receiver.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods of the various embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present 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 solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (11)

1. A message push method for a message push 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 comprises the target message receiver, determining the 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 valid time indicated by the authority authentication service system, and the authority authentication service system is a system which is independent of the message push service system and is used for verifying the authority of the user for logging in the message push service system, pushing the target message to the target message receiver through the session connection corresponding to the target message receiver.
2. The message pushing method according to claim 1, further comprising:
and if the user list does not comprise the target message receiver or the session connection corresponding to the target message receiver is determined not to be in 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.
3. The message pushing method according to claim 1 or 2, wherein the message pushing service system comprises a client and a server;
the method further comprises the following steps:
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 characterizing any message receiver in the one or more message receivers.
4. The message pushing method according to claim 3, wherein the establishing, by the client and the server, the first session connection corresponding to the first message recipient comprises:
the client sends a network protocol Web-Socket connection establishment request to the server, wherein the Web-Socket connection request comprises a first user identifier 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 identification and the session token.
5. The message pushing method according to claim 4, wherein the server establishes the first session connection according to the first user identifier and the session token, and comprises:
the server side determines a first session identifier of the first session connection according to the first user identifier and the session token;
if the server side determines that the session identification list corresponding to the first user identification comprises the first session identification, the server side updates the session valid time corresponding to the first session connection to the session valid time indicated by the authority authentication service system;
and if the server side determines that the session identification list corresponding to the first user identification does not comprise the first session identification, the server side adds the first session identification into the session identification list, establishes a first mapping relation between the session token and the first session identification, establishes a second mapping relation between the session token and the first user identification, and updates the session effective time corresponding to the first session connection into the session effective time indicated by the authority authentication service system.
6. The message pushing method according to claim 4, 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 one of the one or more message receivers;
and 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.
7. The message pushing method according to claim 6, wherein after the server deletes the session information in the session identifier list corresponding to the second user identifier according to the Web-Socket connection close request, the method further comprises:
and if the session identification list corresponding to the second user identification is empty information, deleting the second user identification from the user list.
8. A message push apparatus for a message push 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 recipient if it is determined that the user list includes the target message recipient;
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 valid time indicated by the authority authentication service system, and the authority authentication service system is a system which is independent of the message pushing service system and is used for verifying the authority of the user for logging in the message pushing service system.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the message push method according to any one of claims 1 to 7 when executing the program.
10. A non-transitory computer-readable storage medium, on which a computer program is stored, the computer program, when being executed by a processor, implementing the steps of the message pushing method according to any one of claims 1 to 7.
11. A computer program product having stored thereon executable instructions, characterized in that the instructions, when executed by a processor, cause the processor to carry out the steps of the message push method according to any one of claims 1 to 7.
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 true CN113596147A (en) 2021-11-02
CN113596147B 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)

Cited By (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 (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140194097A1 (en) * 2011-08-24 2014-07-10 Cellco Partnership D/B/A Verizon Wireless Method of device authentication and application registration in a push communication framework
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 广州视源电子科技股份有限公司 Information push 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

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140194097A1 (en) * 2011-08-24 2014-07-10 Cellco Partnership D/B/A Verizon Wireless Method of device authentication and application registration in a push communication framework
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 广州视源电子科技股份有限公司 Information push 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
MOHAMMAD DANISH: "PushNotify:Push server application", 2013 3RD IEEE INTERNATIONAL ADVANCE COMPUTING CONFERENCE(IACC) *
丁易难: "基于WebSocket的校园招聘信息推送系统的研究", 中国优秀硕士学位论文全文数据库 信息科技辑 *

Cited By (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

Also Published As

Publication number Publication date
CN113596147B (en) 2023-10-24

Similar Documents

Publication Publication Date Title
RU2500079C2 (en) Method, system and apparatus for transmitting video data
CN102333100B (en) Authentication method and terminal
CN109639712B (en) Method and system for preventing DDOS attack
EP3297243B1 (en) Trusted login method and device
US20190342327A1 (en) Front-end protocol for server protection
CN103503408A (en) System and method for providing access credentials
JP2006279636A (en) Consistency guarantee management system for inter-client communication log
CN109729000B (en) Instant messaging method and device
CN109936515B (en) Access configuration method, information providing method and device
CN113852483B (en) Network slice connection management method, terminal and computer readable storage medium
CN109525620B (en) Message pushing system, method and device
CN110290176B (en) Point-to-point information pushing method based on MQTT
CN113596147B (en) Message pushing method, device, equipment and storage medium
CN110602111A (en) Interface anti-brushing method and system based on long connection
US7218714B2 (en) Method of calling service among devices in home network
CN111510302A (en) Method and system for improving certificate verification efficiency in secure communication protocol
JP2012064007A (en) Information processor, communication relay method and program
CN112291248A (en) Method and equipment for protecting HTTPS DDoS attack
CN113872949B (en) Address resolution protocol response method and related device
CN111786783B (en) Public key certificate acquisition method and related equipment
CN115037537A (en) Abnormal traffic interception and abnormal domain name identification method, device, equipment and medium
US20160381147A1 (en) Information transmission method and apparatus
CN113162922A (en) Client data acquisition method and device, storage medium and electronic equipment
CN112118284A (en) Gateway device-oriented http data request method, device and medium
CN109995760A (en) The defence method and system of HTTP flood attack

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

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

Applicant after: Qianxin Technology Group Co.,Ltd.

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: Qianxin Technology Group Co.,Ltd.

Applicant before: LEGENDSEC INFORMATION TECHNOLOGY (BEIJING) Inc.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant