CN116346899A - Message pushing processing method and device - Google Patents

Message pushing processing method and device Download PDF

Info

Publication number
CN116346899A
CN116346899A CN202310003209.2A CN202310003209A CN116346899A CN 116346899 A CN116346899 A CN 116346899A CN 202310003209 A CN202310003209 A CN 202310003209A CN 116346899 A CN116346899 A CN 116346899A
Authority
CN
China
Prior art keywords
client
subscription
server
message
point
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310003209.2A
Other languages
Chinese (zh)
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.)
Everbright Technology Co ltd
Original Assignee
Everbright Technology 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 Everbright Technology Co ltd filed Critical Everbright Technology Co ltd
Priority to CN202310003209.2A priority Critical patent/CN116346899A/en
Publication of CN116346899A publication Critical patent/CN116346899A/en
Pending legal-status Critical Current

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/14Session management
    • H04L67/141Setup of application sessions

Abstract

The invention provides a message pushing processing method and a device, wherein the method comprises the following steps: establishing a point-to-point communication link with a server; subscribing to a topic via the peer-to-peer communication link; according to the subscribed topic, the push message of the server is received, so that the problems that in the related technology, the message is pushed through a message middleware, a client cannot obtain a data source and the safety is low can be solved, the client is linked with the point-to-point communication of the server, and the data communication efficiency and the safety are improved through subscribing the topic push message.

Description

Message pushing processing method and device
Technical Field
The invention relates to the field of data processing, in particular to a message pushing processing method and device.
Background
The client subscribes to the topic from the message middleware (e.g., rubbitmq), the message sender sends the message and the topic to the message middleware, and the message middleware pushes the message conforming to the client subscription topic to the client. Depending on the message middleware, not all message middleware supports the message queue transport protocol (Message Queuing Telemetry Transport, abbreviated MQTT) protocol. The client cannot obtain the data source, and the security is not high.
Aiming at the problems that a client cannot obtain a data source and the safety is not high in the related art by pushing a message through a message middleware, a solution is not proposed.
Disclosure of Invention
The embodiment of the invention provides a message pushing processing method and device, which at least solve the problems that a client cannot obtain a data source and the safety is not high in the related art by pushing a message through a message middleware.
According to one embodiment of the present invention, there is provided a message push processing method, applied to a client, the method including:
establishing a point-to-point communication link with a server;
subscribing to a topic via the point-to-point communication link;
and receiving the push message of the server according to the subscribed theme.
Optionally, subscribing to the topic through the point-to-point communication link includes:
setting one or more topics to be subscribed through a subscription topic format negotiated with the server in advance, wherein the subscription topic format comprises a subscription number, a subscription topic name, a subscription content type and a subscription realization class name;
the one or more topics to be subscribed are subscribed through a subscription interface provided by the server, wherein the server is used for recording identification information of the client, identification information of a system operation user of the client and correspondence of the one or more topics.
Optionally, the method further comprises:
setting a limiting condition of the one or more topics, wherein the server is used for associating the limiting condition into the corresponding relation of the corresponding topics.
Optionally, the method further comprises:
sending a subscription cancellation request to the server through the subscription cancellation interface, wherein the subscription cancellation request carries a target theme name to be cancelled;
and receiving an unsubscribe response returned by the server after deleting the topic corresponding to the target topic name.
Optionally, the method further comprises:
sending a heartbeat message to the server in a first preset time period;
disconnecting the point-to-point communication link with the server when the reply message of the server is not received for a continuous preset number of times;
and reestablishing the point-to-point communication link with the server in a second time period.
According to another embodiment of the present invention, there is also provided a message push processing method, applied to a server, the method including:
establishing a point-to-point communication link with a client;
acquiring a theme subscribed by the client through the point-to-point communication link;
and sending push information to the client according to the subscribed theme.
Optionally, acquiring the topic subscribed by the client through the peer-to-peer communication link includes:
providing a subscription interface to the client;
acquiring one or more topics subscribed by the client through the subscription interface, wherein the subscription topic format of the one or more topics comprises a subscription number, a subscription topic name, a subscription content type and a subscription realization class name;
recording the identification information of the client, the identification information of the system operation user of the client and the corresponding relation of the one or more topics.
Optionally, sending a push message to the client according to the subscribed topic includes:
determining a target theme corresponding to the push message;
determining the identification information of the client corresponding to the target theme and the identification information of a system operation user of the client according to the corresponding relation;
and calling a data pushing interface, and sending the pushing message to the client according to the identification information of the client corresponding to the target theme and the identification information of a system operation user of the client.
Optionally, invoking a data push interface, and sending the push message to the client according to the identification information of the client corresponding to the target theme and the identification information of the system operation user of the client includes:
under the condition that the limiting conditions are associated in the corresponding relation, judging whether the push message accords with the limiting conditions or not;
and under the condition that the judgment result is yes, a data pushing interface is called, and the pushing message is sent to the client according to the identification information of the client corresponding to the target theme and the identification information of a system operation user of the client.
Optionally, the method further comprises:
and under the condition that the servers are deployed for the cluster, sending a push task to other servers in the cluster through the message middleware so that the other servers can determine whether to send the push message to the corresponding clients.
Optionally, the method further comprises:
receiving a subscription cancellation request sent by the client through the subscription cancellation interface, wherein the subscription cancellation request carries a target theme name to be cancelled;
and after deleting the topic corresponding to the target topic name, returning an unsubscribe response to the client.
Optionally, the method further comprises:
and deleting all topics subscribed by the client under the condition that the point-to-point communication link is disconnected with the client is detected.
According to another embodiment of the present invention, there is also provided a message push processing apparatus, applied to a client, the apparatus including:
the first establishing module is used for establishing point-to-point communication links with the server;
the subscription module is used for subscribing the theme through the point-to-point communication link;
and the first receiving module is used for receiving the push message of the server according to the subscribed theme.
Optionally, the subscription module is further configured to set one or more topics to be subscribed through a subscription topic format negotiated with the server in advance, where the subscription topic format includes a subscription number, a subscription topic name, a subscription content type, and a subscription implementation class name; the one or more topics to be subscribed are subscribed through a subscription interface provided by the server, wherein the server is used for recording identification information of the client, identification information of a system operation user of the client and correspondence of the one or more topics.
Optionally, the apparatus further comprises:
the setting module is used for setting the limiting conditions of the one or more topics, and the server is used for associating the limiting conditions into the corresponding relations of the corresponding topics.
Optionally, the apparatus further comprises:
the first sending module is used for sending a subscription canceling request to the server through the subscription canceling interface, wherein the subscription canceling request carries a target theme name to be canceled;
and the second receiving module is used for receiving an unsubscribe response returned after the server deletes the theme corresponding to the target theme name.
Optionally, the apparatus further comprises:
the second sending module is used for sending a heartbeat message to the server in a first preset time period;
the disconnection module is used for disconnecting the point-to-point communication link with the server when the reply message of the server is not received for a continuous preset number of times;
and the second establishing module is used for reestablishing the point-to-point communication link with the server in a second time period.
According to another embodiment of the present invention, there is also provided a message push processing apparatus applied to a server, the apparatus including:
the third establishing module is used for establishing point-to-point communication links with the client;
the acquisition module is used for acquiring the topic subscribed by the client through the point-to-point communication link;
and the third sending module is used for sending push information to the client according to the subscribed theme.
Optionally, the acquiring module is further configured to provide a subscription interface to the client; acquiring one or more topics subscribed by the client through the subscription interface, wherein the subscription topic format of the one or more topics comprises a subscription number, a subscription topic name, a subscription content type and a subscription realization class name; recording the identification information of the client, the identification information of the system operation user of the client and the corresponding relation of the one or more topics.
Optionally, the third sending module includes:
the determining submodule is used for determining a target theme corresponding to the push message;
the determining submodule is used for determining the identification information of the client corresponding to the target theme and the identification information of a system operation user of the client according to the corresponding relation;
and the sending sub-module is used for calling a data pushing interface and sending the pushing message to the client according to the identification information of the client corresponding to the target theme and the identification information of the system operation user of the client.
Optionally, the sending submodule is further configured to determine, when a constraint condition is associated in the corresponding relationship, whether the push message meets the constraint condition; and under the condition that the judgment result is yes, a data pushing interface is called, and the pushing message is sent to the client according to the identification information of the client corresponding to the target theme and the identification information of a system operation user of the client.
Optionally, the apparatus further comprises:
and the issuing module is used for issuing a pushing task to other servers in the cluster through the message middleware under the condition that the servers are deployed in the cluster, so that the other servers can determine whether to send the pushing message to the corresponding clients.
Optionally, the apparatus further comprises:
the third receiving module is used for receiving a subscription canceling request sent by the client through the subscription canceling interface, wherein the subscription canceling request carries a target theme name to be canceled;
and the return module is used for returning an unsubscribe response to the client after deleting the topic corresponding to the target topic name.
Optionally, the apparatus further comprises:
and the deleting module is used for deleting all topics subscribed by the client under the condition that the point-to-point communication link is disconnected with the client is detected.
According to a further embodiment of the present invention, there is also provided a computer-readable storage medium having stored therein a computer program, wherein the computer program, when executed by a processor, performs the steps of any of the method embodiments described above.
According to a further embodiment of the invention, there is also provided an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
By the invention, a point-to-point communication link is established with the server; subscribing to a topic via the point-to-point communication link; according to the subscribed subject, the push message of the server is received, so that the problems that in the related art, the message is pushed through a message middleware, a client cannot obtain a data source and the safety is low can be solved, the client is linked with the point-to-point communication of the server, and the data communication efficiency and the safety are improved through subscribing the subject push message.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiments of the invention and together with the description serve to explain the invention and do not constitute a limitation on the invention. In the drawings:
fig. 1 is a block diagram of a hardware structure of a mobile terminal of a message push processing method according to an embodiment of the present invention;
FIG. 2 is a flow chart of a message push processing method according to an embodiment of the present invention;
FIG. 3 is a second flowchart of a message push processing method according to an embodiment of the present invention;
FIG. 4 is a block diagram I of a message push processing device according to an embodiment of the present invention;
fig. 5 is a block diagram two of a message push processing device according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the drawings in conjunction with embodiments. It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
The method embodiment provided in the first embodiment of the present application may be executed in a mobile terminal, a computer terminal or a similar computing device. Taking a mobile terminal as an example, fig. 1 is a block diagram of a hardware structure of a mobile terminal according to an embodiment of the present invention, where, as shown in fig. 1, the mobile terminal may include one or more (only one is shown in fig. 1) processors 102 (the processors 102 may include, but are not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data, and optionally, the mobile terminal may further include a transmission device 106 for a communication function and an input/output device 108. It will be appreciated by those skilled in the art that the structure shown in fig. 1 is merely illustrative and not limiting of the structure of the mobile terminal described above. For example, the mobile terminal may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1.
The memory 104 may be used to store a computer program, for example, a software program of application software and a module, such as a computer program corresponding to a message pushing processing method in an embodiment of the present invention, and the processor 102 executes the computer program stored in the memory 104 to perform various functional applications and data processing, that is, implement the method described above. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located relative to the processor 102, which may be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission means 106 is arranged to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet wirelessly.
In this embodiment, a message push processing method running on the mobile terminal or the network architecture is provided, fig. 2 is a flowchart of a message push processing method according to an embodiment of the present invention, as shown in fig. 2, applied to a client, where the flowchart includes the following steps:
step S202, establishing a point-to-point communication link with a server;
step S204, subscribing the theme through the point-to-point communication link;
step S206, receiving the push message of the server according to the subscribed theme.
In the embodiment of the present invention, the step S204 may specifically include: setting one or more topics to be subscribed through a subscription topic format negotiated with the server in advance, wherein the subscription topic format comprises a subscription number, a subscription topic name, a subscription content type and a subscription realization class name; the one or more topics to be subscribed are subscribed through a subscription interface provided by the server, wherein the server is used for recording identification information of the client, identification information of a system operation user of the client and correspondence of the one or more topics.
Through the steps S202 to S206, the problem that the client cannot obtain the data source and has low security in the related art by pushing the message through the message middleware can be solved, and the data communication efficiency and security are improved by subscribing the subject to push the message through the peer-to-peer communication link with the server.
In an alternative embodiment, the method further comprises: setting a limiting condition of the one or more topics, wherein the server is used for associating the limiting condition into the corresponding relation of the corresponding topics.
In another alternative embodiment, the method further comprises: sending a subscription cancellation request to the server through the subscription cancellation interface, wherein the subscription cancellation request carries a target theme name to be cancelled; and receiving an unsubscribe response returned by the server after deleting the topic corresponding to the target topic name.
In another alternative embodiment, the method further comprises: sending a heartbeat message to the server in a first preset time period; disconnecting the point-to-point communication link with the server when the reply message of the server is not received for a continuous preset number of times; and reestablishing the point-to-point communication link with the server in a second time period.
According to another embodiment of the present invention, there is further provided a message pushing processing method, and fig. 3 is a flowchart two of the message pushing processing method according to an embodiment of the present invention, as shown in fig. 3, applied to a server, where the method includes:
step S302, establishing a point-to-point communication link with a client;
the point-to-point communication link may be established by a transmission control protocol (Transmission Control Protocol, abbreviated TCP).
Step S304, obtaining the topic subscribed by the client through the point-to-point communication link;
and step S306, sending a push message to the client according to the subscribed theme.
In the embodiment of the present invention, the step S304 may specifically include: providing a subscription interface to the client; acquiring one or more topics subscribed by the client through the subscription interface, wherein the subscription topic format of the one or more topics comprises a subscription number, a subscription topic name, a subscription content type and a subscription realization class name; recording the identification information of the client, the identification information of the system operation user of the client and the corresponding relation of the one or more topics.
In the embodiment of the present invention, the step S306 may specifically include: determining a target theme corresponding to the push message; determining the identification information of the client corresponding to the target theme and the identification information of a system operation user of the client according to the corresponding relation; invoking a data push interface, sending the push message to the client according to the identification information of the client corresponding to the target theme and the identification information of a system operation user of the client, and in an optional embodiment, judging whether the push message accords with the limiting condition under the condition of associating the limiting condition in the corresponding relation; and under the condition that the judgment result is yes, a data pushing interface is called, and the pushing message is sent to the client according to the identification information of the client corresponding to the target theme and the identification information of a system operation user of the client.
Through the steps S302 to S306, the problem that the client cannot obtain the data source and has low security in the related art by pushing the message through the message middleware can be solved, and the data communication efficiency and security are improved by subscribing the subject to push the message through the peer-to-peer communication link with the server.
In an alternative embodiment, the method further comprises: and under the condition that the servers are deployed for the cluster, sending a push task to other servers in the cluster through the message middleware so that the other servers can determine whether to send the push message to the corresponding clients.
In another alternative embodiment, the method further comprises: receiving a subscription cancellation request sent by the client through the subscription cancellation interface, wherein the subscription cancellation request carries a target theme name to be cancelled; and after deleting the topic corresponding to the target topic name, returning an unsubscribe response to the client.
In another alternative embodiment, the method further comprises: and deleting all topics subscribed by the client under the condition that the point-to-point communication link is disconnected with the client is detected.
In this embodiment, the client negotiates with the server and formulates a corresponding relationship between the topic and the subscription content, and after persistence, starts the service to be cached, where the corresponding relationship includes: subscription numbers, subscription topic names, subscription content types, subscription realization class names (realization of each independent service customization, such as screening and pushing of a pushing page according to the current screening condition).
The client establishes a long link with the server, and the client login is triggered. The establishment of a long TCP-based link to a server is initiated by a client. And recording the corresponding relation between the link information of the client and the system operation user, and writing the corresponding relation into the cache. Default if no user exists. The link information of the client and the server is a unique ID, and the operating user is a user login name. TCP communication between the client and the service interval is to follow the established protocol:
data transmission mode of long link: byte arrays;
the protocol header includes:
version: 2 bytes, short type;
subject matter: 2 bytes, short type;
size of: 4 bytes, int type;
format: 1 byte, byte type;
and (3) reserving: 4 bytes, int type.
The protocol body comprises: a data entity.
The server provides an http request interface (subscribe/unsubscribe), including:
subscription interface: the notification server needs real-time updated data, and is initiated by the client, and subscription topic numbers (corresponding to topic numbers in the subscription topic format) need to be provided, so as to subscribe to content screening conditions. When the server receives a subscription request of the client, supplementing the topic number subscribed by the current user to the corresponding relation;
unsubscribe interface: the notification server cancels the data updated in real time, and is initiated by the client, and the subscription theme name is required to be provided. When the server receives the subscription canceling request of the client, the subscription theme under the user is deleted from the corresponding relation.
Triggering data updating, calling a data pushing interface when data is changed or notification needs to be generated, and transmitting updated data and subscription topic numbers as parameters. And writing subscription realization classes according to service requirements, and realizing a unified interface provided by the software.
And subscribing the distributed scheduling of tasks (only required by cluster deployment), and when the server generates the content which needs to be pushed to the client in real time, sending the push task to all servers in the cluster through the message middleware. Each server first finds out which clients of the current server subscribe to the topic according to the subscription topic. Traversing all the client link information subscribed to the subject to be pushed, and calling a subscription realization class to send subscription data to the client according to the screening condition.
The client disconnects the link with the server, and when the link is disconnected, all subscription topic information under the link information of the client is deleted.
Heartbeat monitoring, namely, when a client establishes a TCP link with a server and is idle (no data communication between the client and the server), sending a heartbeat packet (default once for 30 seconds) to the server. If the client continuously sends heartbeat packets for 3 times and does not receive the reply of the server, the link with the server is considered abnormal, the link with the server is disconnected, and the connection is repeated at regular time (the link request is tried once in 3 minutes by default until the success). Heartbeat monitoring is also a subscription topic.
The user logs in the login client, establishes a TCP long link and forms a corresponding relation. The client accesses a page needing to push data in real time, calls a subscription interface, and supplements the subscription number of the user to the corresponding relation. When a certain server generates data, a push request needs to be distributed to all push servers (request parameters include subscription numbers, senders and push information). Each server traverses the corresponding relation established by the server and searches whether user information containing the same subscription number exists. If so, the service subscription realization class is searched according to the subscription number, and the push data is executed.
The embodiment of the invention solves the problem that the client can selectively designate the data blocks needing to be updated in real time through the subscription mechanism of the client and the server and the establishment of the TCP transmission protocol. The method can realize real-time update of multi-screen data, designate data list update accurate to the line, and cancel data update subscription not displayed on the current screen. Therefore, the client experience is improved, the data transmission efficiency is improved, and the pressure of the server is reduced.
According to another embodiment of the present invention, there is further provided a message pushing device, fig. 4 is a block diagram of a message pushing device according to an embodiment of the present invention, as shown in fig. 4, applied to a client, where the device includes:
a first establishing module 42, configured to establish a point-to-point communication link with a server;
a subscription module 44 for subscribing to topics via the point-to-point communication link;
a first receiving module 46, configured to receive a push message of the server according to the subscribed topic.
Optionally, the subscription module 44 is further configured to set one or more topics to be subscribed through a subscription topic format negotiated with the server in advance, where the subscription topic format includes a subscription number, a subscription topic name, a subscription content type, and a subscription implementation class name; the one or more topics to be subscribed are subscribed through a subscription interface provided by the server, wherein the server is used for recording identification information of the client, identification information of a system operation user of the client and correspondence of the one or more topics.
Optionally, the apparatus further comprises:
the setting module is used for setting the limiting conditions of the one or more topics, and the server is used for associating the limiting conditions into the corresponding relations of the corresponding topics.
Optionally, the apparatus further comprises:
the first sending module is used for sending a subscription canceling request to the server through the subscription canceling interface, wherein the subscription canceling request carries a target theme name to be canceled;
and the second receiving module is used for receiving an unsubscribe response returned after the server deletes the theme corresponding to the target theme name.
Optionally, the apparatus further comprises:
the second sending module is used for sending a heartbeat message to the server in a first preset time period;
the disconnection module is used for disconnecting the point-to-point communication link with the server when the reply message of the server is not received for a continuous preset number of times;
and the second establishing module is used for reestablishing the point-to-point communication link with the server in a second time period.
According to another embodiment of the present invention, there is further provided a message pushing device, fig. 5 is a block diagram two of the message pushing device according to an embodiment of the present invention, as shown in fig. 5, applied to a server, where the device includes:
a third establishing module 52, configured to establish a point-to-point communication link with the client;
an obtaining module 54, configured to obtain a topic subscribed by the client through the peer-to-peer communication link;
a third sending module 56, configured to send a push message to the client according to the subscribed topic.
Optionally, the obtaining module 54 is further configured to provide a subscription interface to the client; acquiring one or more topics subscribed by the client through the subscription interface, wherein the subscription topic format of the one or more topics comprises a subscription number, a subscription topic name, a subscription content type and a subscription realization class name; recording the identification information of the client, the identification information of the system operation user of the client and the corresponding relation of the one or more topics.
Optionally, the third sending module 56 includes:
the determining submodule is used for determining a target theme corresponding to the push message;
the determining submodule is used for determining the identification information of the client corresponding to the target theme and the identification information of a system operation user of the client according to the corresponding relation;
and the sending sub-module is used for calling a data pushing interface and sending the pushing message to the client according to the identification information of the client corresponding to the target theme and the identification information of the system operation user of the client.
Optionally, the sending submodule is further configured to determine, when a constraint condition is associated in the corresponding relationship, whether the push message meets the constraint condition; and under the condition that the judgment result is yes, a data pushing interface is called, and the pushing message is sent to the client according to the identification information of the client corresponding to the target theme and the identification information of a system operation user of the client.
Optionally, the apparatus further comprises:
and the issuing module is used for issuing a pushing task to other servers in the cluster through the message middleware under the condition that the servers are deployed in the cluster, so that the other servers can determine whether to send the pushing message to the corresponding clients.
Optionally, the apparatus further comprises:
the third receiving module is used for receiving a subscription canceling request sent by the client through the subscription canceling interface, wherein the subscription canceling request carries a target theme name to be canceled;
and the return module is used for returning an unsubscribe response to the client after deleting the topic corresponding to the target topic name.
Optionally, the apparatus further comprises:
and the deleting module is used for deleting all topics subscribed by the client under the condition that the point-to-point communication link is disconnected with the client is detected.
It should be noted that each of the above modules may be implemented by software or hardware, and for the latter, it may be implemented by, but not limited to: the modules are all located in the same processor; alternatively, the above modules may be located in different processors in any combination.
Embodiments of the present invention also provide a computer-readable storage medium having a computer program stored therein, wherein the computer program, when executed by a processor, performs the steps of any of the method embodiments described above.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store a computer program for performing the steps of:
s11, establishing a point-to-point communication link with a server;
s12, subscribing to the theme through the point-to-point communication link;
s13, receiving push messages of the server according to the subscribed topics.
Alternatively, in the present embodiment, the above-described storage medium may be further configured to store a computer program for performing the steps of:
s21, establishing a point-to-point communication link with the client;
s22, acquiring a theme subscribed by the client through the point-to-point communication link;
s23, sending push information to the client according to the subscribed theme.
Alternatively, in the present embodiment, the storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
An embodiment of the invention also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s11, establishing a point-to-point communication link with a server;
s12, subscribing to the theme through the point-to-point communication link;
s13, receiving push messages of the server according to the subscribed topics.
Optionally, in this embodiment, the above processor may be further configured to execute the following steps by a computer program:
s21, establishing a point-to-point communication link with the client;
s22, acquiring a theme subscribed by the client through the point-to-point communication link;
s23, sending push information to the client according to the subscribed theme.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments and optional implementations, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a memory device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps within them may be fabricated into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (14)

1. A message pushing processing method, applied to a client, characterized in that the method comprises:
establishing a point-to-point communication link with a server;
subscribing to a topic via the point-to-point communication link;
and receiving the push message of the server according to the subscribed theme.
2. The method of claim 1, wherein subscribing to the topic via the point-to-point communication link comprises:
setting one or more topics to be subscribed through a subscription topic format negotiated with the server in advance, wherein the subscription topic format comprises a subscription number, a subscription topic name, a subscription content type and a subscription realization class name;
the one or more topics to be subscribed are subscribed through a subscription interface provided by the server, wherein the server is used for recording identification information of the client, identification information of a system operation user of the client and correspondence of the one or more topics.
3. The method according to claim 2, wherein the method further comprises:
setting a limiting condition of the one or more topics, wherein the server is used for associating the limiting condition into the corresponding relation of the corresponding topics.
4. The method according to claim 1, wherein the method further comprises:
sending a subscription cancellation request to the server through the subscription cancellation interface, wherein the subscription cancellation request carries a target theme name to be cancelled;
and receiving an unsubscribe response returned by the server after deleting the topic corresponding to the target topic name.
5. The method according to claim 1, wherein the method further comprises:
sending a heartbeat message to the server in a first preset time period;
disconnecting the point-to-point communication link with the server when the reply message of the server is not received for a continuous preset number of times;
and reestablishing the point-to-point communication link with the server in a second time period.
6. A message pushing processing method, applied to a server, characterized in that the method comprises:
establishing a point-to-point communication link with a client;
acquiring a theme subscribed by the client through the point-to-point communication link;
and sending push information to the client according to the subscribed theme.
7. The method of claim 6, wherein obtaining the topic subscribed to by the client via the peer-to-peer communication link comprises:
providing a subscription interface to the client;
acquiring one or more topics subscribed by the client through the subscription interface, wherein the subscription topic format of the one or more topics comprises a subscription number, a subscription topic name, a subscription content type and a subscription realization class name;
recording the identification information of the client, the identification information of the system operation user of the client and the corresponding relation of the one or more topics.
8. The method of claim 7, wherein sending a push message to the client according to the topic of subscription comprises:
determining a target theme corresponding to the push message;
determining the identification information of the client corresponding to the target theme and the identification information of a system operation user of the client according to the corresponding relation;
and calling a data pushing interface, and sending the pushing message to the client according to the identification information of the client corresponding to the target theme and the identification information of a system operation user of the client.
9. The method of claim 8, wherein invoking a data push interface to send the push message to the client according to the identification information of the client corresponding to the target topic and the identification information of a system operation user of the client comprises:
under the condition that the limiting conditions are associated in the corresponding relation, judging whether the push message accords with the limiting conditions or not;
and under the condition that the judgment result is yes, a data pushing interface is called, and the pushing message is sent to the client according to the identification information of the client corresponding to the target theme and the identification information of a system operation user of the client.
10. The method of claim 6, wherein the method further comprises:
and under the condition that the servers are deployed for the cluster, sending a push task to other servers in the cluster through the message middleware so that the other servers can determine whether to send the push message to the corresponding clients.
11. The method of claim 6, wherein the method further comprises:
receiving a subscription cancellation request sent by the client through the subscription cancellation interface, wherein the subscription cancellation request carries a target theme name to be cancelled;
and after deleting the topic corresponding to the target topic name, returning an unsubscribe response to the client.
12. The method of claim 6, wherein the method further comprises:
and deleting all topics subscribed by the client under the condition that the point-to-point communication link is disconnected with the client is detected.
13. A message push processing apparatus for use with a client, the apparatus comprising:
the first establishing module is used for establishing point-to-point communication links with the server;
the subscription module is used for subscribing the theme through the point-to-point communication link;
and the first receiving module is used for receiving the push message of the server according to the subscribed theme.
14. A message push processing device for use with a server, the device comprising:
the third establishing module is used for establishing point-to-point communication links with the client;
the acquisition module is used for acquiring the topic subscribed by the client through the point-to-point communication link;
and the third sending module is used for sending push information to the client according to the subscribed theme.
CN202310003209.2A 2023-01-03 2023-01-03 Message pushing processing method and device Pending CN116346899A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310003209.2A CN116346899A (en) 2023-01-03 2023-01-03 Message pushing processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310003209.2A CN116346899A (en) 2023-01-03 2023-01-03 Message pushing processing method and device

Publications (1)

Publication Number Publication Date
CN116346899A true CN116346899A (en) 2023-06-27

Family

ID=86888298

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310003209.2A Pending CN116346899A (en) 2023-01-03 2023-01-03 Message pushing processing method and device

Country Status (1)

Country Link
CN (1) CN116346899A (en)

Similar Documents

Publication Publication Date Title
CN1960516B (en) Duplicate notification message processing method in terminal
CN100512285C (en) A method of and a network for handling wireless session protocol (WSP) sessions
WO2018214865A1 (en) Processing method for message acknowledgement, related apparatus, storage medium and processor
CN103916442A (en) Message pushing achieving method, mobile terminal and message pushing system
EP1655915A1 (en) Method for managing duplicated arrival notification messages in multimedia messaging services
US8209423B2 (en) Mobile server with multiple service connections
US9442925B2 (en) Regulated texting solution for mobile devices
CN110808948B (en) Remote procedure calling method, device and system
EP2218211A1 (en) Processing of network content and services for mobile or fixed devices
US20060064307A1 (en) Method and system for session management wherein a client session identifier is used
US20090030917A1 (en) Multimedia messaging service-based database synchronization
CN101631127A (en) File transfer method and clients
US9456325B2 (en) Transmission of a multimedia message doubled with the transmission of a text message
US8495167B2 (en) Data communications networks, systems, methods and apparatus
CN107786607B (en) Message retransmission method, message retransmission server and user equipment
US10063648B2 (en) Relaying mobile communications
CN108718274A (en) A kind of anti-loss method of instant communication information
CN112714159A (en) Message forwarding method and device, storage medium and electronic device
KR100811882B1 (en) Method and apparatus for multimedia messaging service using Parlay X Web service
CN116346899A (en) Message pushing processing method and device
US20050256959A1 (en) Method of and system for multimedia messaging system interoperability
CN111064674B (en) Data transmission method, device and system
US11425632B2 (en) Mechanism to provide updates to NB-IoT devices
CN114422573A (en) Message sending method and device, storage medium and electronic device
JP2003115795A (en) Communication system, server for use therein, agent control method, agent control program

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