Movatterモバイル変換


[0]ホーム

URL:


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

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

Info

Publication number
CN112511580B
CN112511580BCN201910872882.3ACN201910872882ACN112511580BCN 112511580 BCN112511580 BCN 112511580BCN 201910872882 ACN201910872882 ACN 201910872882ACN 112511580 BCN112511580 BCN 112511580B
Authority
CN
China
Prior art keywords
message
pushed
type
display terminal
websocket
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910872882.3A
Other languages
Chinese (zh)
Other versions
CN112511580A (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.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum 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 Beijing Gridsum Technology Co LtdfiledCriticalBeijing Gridsum Technology Co Ltd
Priority to CN201910872882.3ApriorityCriticalpatent/CN112511580B/en
Publication of CN112511580ApublicationCriticalpatent/CN112511580A/en
Application grantedgrantedCritical
Publication of CN112511580BpublicationCriticalpatent/CN112511580B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The disclosure relates to a method, a device, a storage medium and equipment for pushing a message, and relates to the technical field of information processing, wherein the method comprises the following steps: obtaining a message to be pushed, determining the type of the message to be pushed, determining a target WebSocket channel corresponding to the message to be pushed from the pre-created WebSocket channels according to the corresponding relation between the type of the message to be pushed and the WebSocket channels, and pushing the message to be pushed to a display terminal through the target WebSocket channels so that the display terminal displays the message to be pushed. According to the message pushing method and device, the message to be pushed can be actively pushed to the display terminal through the corresponding WebSocket channel according to the type of the message to be pushed, the display terminal is not required to initiate a query request, the resource consumption is reduced, and the flexibility and pushing efficiency of message pushing can be improved.

Description

Message pushing method, device, storage medium and equipment
Technical Field
The present disclosure relates to the field of information processing technologies, and in particular, to a method, an apparatus, a storage medium, and a device for pushing a message.
Background
With the continuous development of information technology, in the modern management process of enterprises, management personnel of the enterprises often issue various notification, announcement and other messages, and meanwhile, if data information generated by the enterprises in the operation process changes (such as leakage, deletion and the like), corresponding messages are generated, and the messages are required to be displayed through a large screen so as to quickly and effectively notify related personnel. The large screen, based on HTTP (english: hyper Text Transfer Protocol, chinese: hypertext transfer protocol), will periodically initiate a query request to the server to query whether a new message exists. If the new message exists, the new message is acquired and displayed, and if the new message does not exist, the processing is not performed. The new message does not appear continuously but appears randomly, so that a large number of ineffective queries exist in a large number of query requests initiated by the large screen to the server, and a large amount of network resources and hardware resources are occupied.
Disclosure of Invention
The purpose of the present disclosure is to provide a method, an apparatus, a storage medium and a device for pushing a message, so as to solve the problem in the prior art that a display terminal initiates too many invalid query requests and wastes resources.
To achieve the above object, according to a first aspect of embodiments of the present disclosure, there is provided a method for message pushing, the method including:
Obtaining a message to be pushed, and determining the type of the message to be pushed;
Determining a target WebSocket channel corresponding to the message to be pushed from the pre-created WebSocket channels according to the corresponding relation between the type of the message to be pushed and the WebSocket channels;
Pushing the message to be pushed to a display terminal through the target WebSocket channel, so that the display terminal displays the message to be pushed.
According to a second aspect of embodiments of the present disclosure, there is provided a message pushing apparatus, the apparatus comprising:
the acquisition module is used for acquiring the message to be pushed and determining the type of the message to be pushed;
The determining module is used for determining a target WebSocket channel corresponding to the message to be pushed from the pre-created WebSocket channels according to the corresponding relation between the type of the message to be pushed and the WebSocket channels;
And the pushing module is used for pushing the message to be pushed to a display terminal through the target WebSocket channel so that the display terminal displays the message to be pushed.
According to a third aspect of embodiments of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method of message pushing provided by the first aspect.
According to a fourth aspect of embodiments of the present disclosure, there is provided an apparatus comprising:
at least one processor, and at least one memory, bus, connected to the processor;
The processor and the memory complete communication with each other through the bus;
the processor is configured to invoke program instructions in the memory to perform the steps of the method for message pushing provided in the first aspect.
Through the technical scheme, the message to be pushed is firstly obtained, the type of the message to be pushed is further determined, the type of the message to be pushed is determined, then a target WebSocket channel corresponding to the message to be pushed is determined in the pre-established WebSocket channel according to the corresponding relation between the type of the message to be pushed and the WebSocket channel, the message to be pushed is finally pushed to the display terminal through the target WebSocket channel, and the message to be pushed is received by the display terminal through the target WebSocket channel, so that the message to be pushed is displayed. According to the message pushing method and device, the message to be pushed can be actively pushed to the display terminal through the corresponding WebSocket channel according to the type of the message to be pushed, the display terminal is not required to initiate a query request, the resource consumption is reduced, and the flexibility and pushing efficiency of message pushing can be improved.
Additional features and advantages of the present disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings are included to provide a further understanding of the disclosure, and are incorporated in and constitute a part of this specification, illustrate the disclosure and together with the description serve to explain, but do not limit the disclosure. In the drawings:
FIG. 1 is a flow chart illustrating a method of message pushing according to an exemplary embodiment;
FIG. 2 is a flow chart illustrating another method of message pushing according to an example embodiment;
FIG. 3 is a flow chart illustrating another method of message pushing according to an example embodiment;
FIG. 4 is a flowchart illustrating another method of message pushing, according to an example embodiment;
FIG. 5 is a flowchart illustrating another method of message pushing, according to an example embodiment;
FIG. 6 is a flowchart illustrating another method of message pushing in accordance with an exemplary embodiment;
FIG. 7 is a flowchart illustrating another method of message pushing in accordance with an exemplary embodiment;
FIG. 8 is a block diagram illustrating a message pushing apparatus according to an example embodiment;
FIG. 9 is a block diagram of another message pushing apparatus according to an example embodiment;
FIG. 10 is a block diagram of another message pushing apparatus, according to an example embodiment;
FIG. 11 is a block diagram of another message pushing apparatus according to an example embodiment;
Fig. 12 is a block diagram of an apparatus according to an example embodiment.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
Before introducing the method, the device, the storage medium and the equipment for pushing the message provided by the disclosure, application scenes related to various embodiments of the disclosure are first described. The message pushing method in the application scene can be applied to a server (for example, a local server or a cloud server), and can also be applied to a control terminal, a control platform and the like which can access the server through a network. The display terminal may be any terminal with a display screen, for example: terminals such as a large screen, a smart phone, a tablet Personal computer, a PDA (English: personal DIGITAL ASSISTANT, chinese: personal digital assistant), a smart television, a smart watch, a computer and the like, and the display terminal is connected with the server through a network and can be in data communication with the server. In this embodiment, the method of pushing the message is applied to a server for illustration.
Fig. 1 is a flow chart illustrating a method of message pushing, as shown in fig. 1, according to an exemplary embodiment, the method comprising the steps of:
step 101, obtaining the message to be pushed, and determining the type of the message to be pushed.
For example, the server may obtain the message to be pushed through a different channel. For example, a manager can log in a server through a pre-registered user account, then log in a message to be pushed through a pre-set manual operation interface, and the server obtains the message to be pushed through the manual operation interface. Or the server can acquire the message to be pushed through a preset third party interface when the abnormal situation is found out in the process of monitoring the data information generated in the enterprise operation process by the third party monitoring software (such as firewall software, anti-leakage management software and the like). The message to be pushed can be one or a plurality of messages.
The server analyzes the message to be pushed to determine the type of the message to be pushed. The types of the messages to be pushed can be classified into: important type, medium type, general type. Further, in the process of enterprise modernization management, various types of messages are generated, and the messages can be classified into two types according to the pushing scene of the messages: burst type and leakage type. Burst type is understood to be a message that needs to be notified to all employees, such as a public notice, announcement, etc., the generation of which is random and may be a message sent by a manager according to specific needs. The leakage type can be understood as a message for monitoring data information generated by an enterprise in the operation process, and the information needs to be informed to the inside of the enterprise, and if the state of the data information is changed (such as leakage, deletion, etc.), the leakage type message is sent. For example, the printer No. 2 prints "the enterprise management regulation", the third party monitoring software monitors the data of the printer and can send out a message of "printer02 01 0005", where printer02 indicates the printer No. 2, 01 indicates that printing is performed, and 0005 indicates "the enterprise management regulation".
Step 102, determining a target WebSocket channel corresponding to the message to be pushed from the pre-created WebSocket channels according to the corresponding relation between the type of the message to be pushed and the WebSocket channels.
And step 103, pushing the message to be pushed to the display terminal through the target WebSocket channel so as to enable the display terminal to display the message to be pushed.
For example, one or more WebSocket channels may be created in advance between the server and the display terminal, and further, the server may also be preset with a correspondence between the type of the message to be pushed and the WebSocket channel. And selecting a target WebSocket channel corresponding to the message to be pushed from one or more WebSocket channels according to the type of the message to be pushed determined in the step 101. And finally, the server pushes the message to be pushed to the display terminal through the target WebSocket channel. The target WebSocket channel enables the server to actively push the message to be pushed to the display terminal when the server discovers the message to be pushed, the display terminal can acquire the message to be pushed in real time through the target WebSocket channel without sending a query request to the server regularly, the message to be pushed is displayed, a large amount of network resources and hardware resources are not consumed, and accordingly the pushing efficiency of message pushing is improved. The manner in which the display terminal displays the message to be pushed may include various manners: the modes of scrolling display, blinking display, fixed display and the like can be selected according to specific requirements.
Specifically, in order to avoid confusion of different types of messages to be pushed, a corresponding WebSocket channel can be set for each type of message to be pushed, and when the server pushes the type of message to be pushed, the server pushes the message to be pushed through the corresponding WebSocket channel. For example, for burst type and leak type, two WebSocket channels may be established for pushing messages to be pushed for burst type and leak type, respectively. Aiming at a scene of a large number of messages to be pushed, in order to improve the real-time performance of message pushing, delay is avoided, a plurality of WebSocket channels can be further arranged, when different types of messages to be pushed are pushed by a server, if the types of the messages to be pushed are important types, idle WebSocket channels can be selected from the plurality of WebSocket channels to push so as to ensure that the messages to be pushed can be timely pushed to a display terminal, if the types of the messages to be pushed are general types, certain delay is allowed, whether the current WebSocket channels are idle or not is not required to be judged, and the current WebSocket channels are directly selected for pushing.
In summary, in the disclosure, a message to be pushed is obtained first, a type of the message to be pushed is further determined, the type of the message to be pushed is determined, then a target WebSocket channel corresponding to the message to be pushed is determined in a pre-created WebSocket channel according to a corresponding relation between the type of the message to be pushed and the WebSocket channel, and finally the message to be pushed is pushed to a display terminal through the target WebSocket channel, and the display terminal receives the message to be pushed through the target WebSocket channel, so that the message to be pushed is displayed. According to the message pushing method and device, the message to be pushed can be actively pushed to the display terminal through the corresponding WebSocket channel according to the type of the message to be pushed, the display terminal is not required to initiate a query request, the resource consumption is reduced, and the flexibility and pushing efficiency of message pushing can be improved.
FIG. 2 is a flow chart of another method of message pushing, according to an exemplary embodiment, as shown in FIG. 2, the WebSocket channel includes at least: the step 102 may include:
In step 1021, if the type of the message to be pushed is burst type, the first WebSocket channel is determined to be the target WebSocket channel.
Step 1022, if the type of the message to be pushed is a leakage type, determining the second WebSocket channel as the target WebSocket channel.
For example, the message to be pushed is divided into a burst type and a leakage type, and a first WebSocket channel for pushing the message to be pushed of the burst type and a second WebSocket channel for pushing the message to be pushed of the leakage type are preset. When the type of the message to be pushed is burst type, the first WebSocket channel is determined to be the target WebSocket channel, and the message to be pushed is correspondingly pushed to the display terminal through the first WebSocket channel, so that the display terminal can push the message to be pushed through the first WebSocket. When the type of the message to be pushed is a leakage type, determining the second WebSocket channel as a target WebSocket channel, and correspondingly pushing the message to be pushed to the display terminal through the second WebSocket channel, so that the display terminal can push the message to be pushed through the second WebSocket.
Fig. 3 is a flowchart illustrating another method for message pushing according to an exemplary embodiment, as shown in fig. 3, if the type of the message to be pushed is a leakage type, before step 103, the method further includes:
step 104, determining an event state corresponding to the message to be pushed, and if the event state is not a new state and the event state is not a false alarm state, jumping to step 103. The new state indicates that the data information contained in the message to be pushed is generated for the first time, and the false report state indicates that the data information is not leaked.
For example, if the type of the message to be pushed is a leakage type, the event state of the message to be pushed may be determined before the message to be pushed is sent to the display terminal. Wherein the event state may include: new states, false alarm states, other types of states, etc., where the new states indicate that data information included in a message to be pushed is generated for the first time, the false alarm states indicate that the data information is not leaked, and other types of states may indicate that the states of the data information are changed, for example, leakage occurs (it may be understood that the data information is sent outside an enterprise, or the data information is deleted, etc.). When the event state is neither a new state nor a false alarm state, the data information contained in the message to be pushed is leaked, and the enterprise needs to be informed of the leakage, and then the message to be pushed is pushed to the display terminal through the target WebSocket channel (namely the second WebSocket channel), and the corresponding display terminal receives the message to be pushed through the target WebSocket channel. That is, after the server acquires the message to be pushed, the message to be pushed in the new state and the false alarm state need to be filtered, and the two event states indicate that the message to be pushed does not need to be concerned, so that the accuracy of message pushing can be improved, and the resource consumption can be further reduced.
Furthermore, in order to further ensure the security of the message to be pushed, the leak type message to be pushed can be further classified into event levels such as "national secret", "confidential", "secret", "core secret", "commercial secret 3 star", "commercial secret 2 star", "commercial secret 1 star", "internal data", and the like, and the server can further screen the event level of the message to be pushed before pushing the message to be pushed to the display terminal through the target WebSocket channel. For example, if a certain display terminal can display messages with a 'commercial density 3 star' level or below, the server can filter out the messages to be pushed with a 'commercial density 3 star' level or above when pushing the messages to be pushed to the display terminal.
The obtaining manner of the event state of the message to be pushed in step 104 may include:
a) A data leakage protection DLP mechanism for a message to be pushed is determined.
B) The event state is obtained according to a DLP mechanism.
For example, in the process of generating the message to be pushed of the leakage type, different DLP (english: DATA LEAKAGE pre, chinese: data leakage protection) mechanisms may be selected, and the manner of acquiring the event state is different according to the different DLP mechanisms. If NDLP (english: network DATA LEAKAGE presence, chinese: network-based data leakage protection) mechanisms are adopted for the message to be pushed, then the event state may be obtained from the flag of the message to be pushed. The flag is used to indicate which parameters in the message to be pushed are changed (modified), and for example, 6 kinds of tags may be included: 1 event status, 2 severity, 3 edit notes, 4 event composite score, 5 attachment name notes, 6 attachment tags. If the flag of the message to be pushed does not carry the '1 event state' tag, filtering the message to be pushed, namely not processing the message to be pushed, if the flag of the message to be pushed carries the 'event state' tag, indicating that the event state in the message to be pushed is changed, reading the content of the tag, and judging whether the event state is a new state, a false alarm state or other types of states. If HDLP (english: host DATA LEAKAGE presence, chinese: host-based data leakage protection) mechanisms are adopted for the message to be pushed, then the event state may be directly obtained from the message to be pushed.
Fig. 4 is a flowchart illustrating another method of message pushing, as shown in fig. 4, according to an exemplary embodiment, the method further comprising, prior to step 101:
step 105, the message to be pushed is issued to the message queue, so that when the message to be pushed is not acquired for the first time, the message to be pushed is acquired from the message queue. And
And 106, storing the message to be pushed into a preset database, and adding a state identifier for the message to be pushed in the preset database, wherein the state identifier is used for representing whether the message to be pushed is pushed or not.
In another implementation, the method may further include the steps of:
and step 107, receiving a setup request sent by the display terminal.
Step 108, creating a WebSocket channel according to the establishment request.
And step 109, selecting a preset number of messages to be pushed from the database according to the time sequence.
Step 110, determining a preset number of messages to be pushed as the messages to be pushed acquired for the first time after the WebSocket channel is created.
For example, the Message to be pushed may be published to a preset Message Queue (english: message Queue, abbreviated: MQ) by using a pre-deployed publishing process, so that when the Message to be pushed is not acquired for the first time, the server queries whether the Message to be pushed exists in the Message Queue by using a pre-deployed subscribing process, and if the Message to be pushed exists, acquires the Message to be pushed from the Message Queue. The message to be pushed can be one or a plurality of messages, and the server can issue the message to be pushed to the message queue in sequence according to the receiving time. The message queue may be ActiveMQ, kafka, zeroMQ, for example, which is a real-time stream data pipeline capable of performing data interaction between each execution body (i.e. the server and the display terminal), and is independent of each execution body, and the message queue is used as a transfer of the message to be pushed, so that congestion of the message to be pushed can be reduced, loss of the message to be pushed is avoided, and thus reliability of message pushing is improved.
When the message to be pushed is released to the message queue, the message to be pushed can be sequentially stored in a preset database according to the time stamp. The database may be local to the server or may be a database shared over a network. I.e. the database stores all messages to be pushed, arranged in the order of the time stamps. So that the manager inquires the message to be pushed, the message to be pushed is not lost, and the reliability of message pushing is ensured. Further, when the message to be pushed is stored in the preset database, the state identifier eveUuid, eveUuid may be added to the message to be pushed, where the initial value of the state identifier is 0, which indicates that the message is not pushed.
When the WebSocket channel between the server and the display terminal is established for the first time, the display terminal initiates an establishment request to the server, after receiving the establishment request, the server agrees to establish the WebSocket channel (including the first WebSocket channel and/or the second WebSocket channel), feeds back an establishment response to the display terminal, and feeds back an establishment success response to the server after receiving the establishment response, so as to inform the server that the WebSocket channel is successfully established. After the WebSocket channel is successfully established, the server queries the front of the front row of time stamps in the database according to the time sequence, and pushes a preset number (for example, 10) of messages to be pushed to the display terminal through the WebSocket channel after the WebSocket channel is established. After pushing the preset number of messages to be pushed to the display terminal, eveUuid of each message to be pushed in the preset number of messages to be pushed may be modified to 1, which indicates that the message to be pushed has been pushed.
Furthermore, if the type of the message to be pushed is a leakage type, screening can be performed according to the event level of the message to be pushed, that is, a preset number of messages to be pushed, which are in front of the time sequence and meet the event level, in the database are selected as the first acquired message to be pushed after the WebSocket channel is created. For example, after the second WebSocket channel for pushing the leak type to-be-pushed message is successfully established, the server may search the first 5 to-be-pushed messages with the event level of "commercial 3 star" in the time sequence in the database as the to-be-pushed message acquired for the first time after the second WebSocket channel is created.
Fig. 5 is a flowchart of another method for message pushing according to an exemplary embodiment, as shown in fig. 5, if the type of the message to be pushed is a leakage type, before step 103, the method further includes:
step 111, look up the status identifier of the message to be pushed in the database to determine whether the message to be pushed has been pushed, and if the message to be pushed has not been pushed, go to step 103.
For example, if the type of the message to be pushed is a leakage type, the server may also query the database whether the message to be pushed has been pushed (i.e. whether the message to be pushed has been determined to be the first message to be pushed acquired after creating the WebSocket channel in step 110), and if the message to be pushed has not been pushed, push the message to be pushed to the display terminal through the target WebSocket channel (i.e. the second WebSocket channel). Wherein, determining whether the message to be pushed has been pushed may be determined by the flag bit eveUuid. eveUuid has an initial value of 0, indicating that no push is performed, eveUuid may be modified to 1 if the message to be pushed has already been pushed. Then in executing step 111, it is only necessary to search the database for eveUuid of the message to be pushed, so as to determine whether the message to be pushed has been pushed.
Fig. 6 is a flowchart illustrating another method of message pushing, as shown in fig. 6, where the message queue is a Kafka queue, and the Kafka queue includes at least a first Topic and a second Topic. The implementation of step 105 may include:
In step 1051, if the type of the message to be pushed is burst type, the message to be pushed is issued to the first Topic in the Kafka queue.
In step 1052, if the type of the message to be pushed is a leak type, the message to be pushed is published to the second Topic in the Kafka queue.
For example, the message queue is a Kafka queue, and one or more topics may be included in the Kafka queue, each of which may be understood as a separate partition in the Kafka queue. Different types of messages to be pushed can be stored in different topics. For burst type and leak type messages to be pushed, the Kafka queue includes a first Topic and a second Topic. When the type of the message to be pushed is burst type, the message to be pushed is issued to the first Topic in the Kafka queue. When the type of the message to be pushed is the leakage type, the message to be pushed is issued to the second Topic in the Kafka queue. The server may query whether a message to be pushed exists in each Topic of the Kafka queue, and if a message to be pushed exists in a certain Topic, acquire the message to be pushed from the Topic.
Fig. 7 is a flowchart illustrating another method for message pushing according to an exemplary embodiment, where, as shown in fig. 7, there are a plurality of display terminals, each having a unique terminal identifier, and before step 103, the method may further include: determining the type of the message to be pushed, which needs to be displayed, of each display terminal, and binding the type of the message to be pushed with the corresponding display terminal identifier.
In another embodiment, after determining the type of message to be pushed, the method further comprises:
And step 112, determining a target display terminal from the plurality of display terminals according to the binding relation between the type of the message to be pushed and the terminal identifier.
Accordingly, the implementation manner of step 103 may be:
Pushing the message to be pushed to the target display terminal through the target WebSocket channel so that the target display terminal displays the message to be pushed.
For example, when there are multiple display terminals, a binding relationship between the terminal identifier of the display terminal and the type of the message to be pushed may be established in advance, and each display terminal subscribes to the type to be displayed. For example, there are 20 large screens in an enterprise, each large screen is provided with a terminal identifier capable of uniquely identifying the large screen, and the large screens can be divided into 10 large screens (including 10 terminal identifiers) of a first group capable of viewing burst type messages to be pushed and 10 large screens (including 10 terminal identifiers) of a second group capable of viewing leakage type messages to be pushed.
And after determining the type of the message to be pushed, selecting a target display terminal from a plurality of display terminals according to the type of the message to be pushed, namely one or more terminals capable of displaying the message to be pushed, and pushing the message to be pushed to the target display terminal through a target WebSocket channel so as to enable the target display terminal to display the message to be pushed. For example, when the type of the message to be pushed is a burst type, the first group of large screens is determined as target display terminals, and when the type of the message to be pushed is a leak type, the second group of large screens is determined as target display terminals. Therefore, different messages to be pushed can be displayed on different groups of display terminals, and the flexibility of message pushing is further improved.
In summary, in the disclosure, a message to be pushed is obtained first, a type of the message to be pushed is further determined, the type of the message to be pushed is determined, then a target WebSocket channel corresponding to the message to be pushed is determined in a pre-created WebSocket channel according to a corresponding relation between the type of the message to be pushed and the WebSocket channel, and finally the message to be pushed is pushed to a display terminal through the target WebSocket channel, and the display terminal receives the message to be pushed through the target WebSocket channel, so that the message to be pushed is displayed. According to the message pushing method and device, the message to be pushed can be actively pushed to the display terminal through the corresponding WebSocket channel according to the type of the message to be pushed, the display terminal is not required to initiate a query request, the resource consumption is reduced, and the flexibility and pushing efficiency of message pushing can be improved.
Fig. 8 is a block diagram of an apparatus for message pushing, according to an exemplary embodiment, as shown in fig. 8, the apparatus 200 includes:
the obtaining module 201 is configured to obtain a message to be pushed, and determine a type of the message to be pushed.
The determining module 202 is configured to determine, from among the WebSocket channels created in advance, a target WebSocket channel corresponding to the message to be pushed according to a correspondence between the type of the message to be pushed and the WebSocket channel.
The pushing module 203 is configured to push the message to be pushed to the display terminal through the target WebSocket channel, so that the display terminal displays the message to be pushed.
Optionally, the WebSocket channel includes at least: the determining module 202 may be configured to:
and if the type of the message to be pushed is a burst type, determining the first WebSocket channel as a target WebSocket channel.
And if the type of the message to be pushed is the leakage type, determining the second WebSocket channel as the target WebSocket channel.
Fig. 9 is a block diagram of another message pushing apparatus according to an exemplary embodiment, and if the type of the message to be pushed is a leakage type, as shown in fig. 9, the apparatus 200 further includes:
The first judging module 204 is configured to judge an event state corresponding to the message to be pushed before the message to be pushed is pushed to the display terminal through the target WebSocket channel.
The first determining module 204 is further configured to skip to a step of pushing the message to be pushed to the display terminal through the target WebSocket channel if the event state is not a new state and the event state is not a false alarm state, where the new state indicates that the data information included in the message to be pushed is generated for the first time, and the false alarm state indicates that the data information is not leaked.
Fig. 10 is a block diagram of another message pushing apparatus, shown in fig. 10, according to an exemplary embodiment, the apparatus 200 further includes:
The publishing module 205 is configured to publish the message to be pushed to a message queue before the message to be pushed is acquired, so that the message to be pushed is acquired from the message queue when the message to be pushed is not acquired for the first time.
The publishing module 205 is further configured to store the message to be pushed in a preset database, and add a status identifier to the message to be pushed in the preset database, where the status identifier is used to characterize whether the message to be pushed is pushed.
In another embodiment, the apparatus 200 further comprises:
and the receiving module 206 is configured to receive the setup request sent by the display terminal.
The creation module 207 is configured to create a WebSocket channel according to the creation request.
A selecting module 208, configured to select a preset number of messages to be pushed from the database according to a time sequence.
The determining module 202 is further configured to determine a preset number of messages to be pushed as the messages to be pushed acquired for the first time after the WebSocket channel is created.
Fig. 11 is a block diagram of another message pushing apparatus according to an exemplary embodiment, and if the type of the message to be pushed is a leakage type, as shown in fig. 11, the apparatus 200 further includes:
The second determining module 209 is configured to search a database for a status identifier of the message to be pushed before pushing the message to be pushed to the display terminal through the target WebSocket channel, so as to determine whether the message to be pushed has been pushed.
The second determining module 209 is further configured to skip to a step of pushing the message to be pushed to the display terminal through the target WebSocket channel if the message to be pushed is not pushed.
Optionally, the message queue is a Kafka queue, where the Kafka queue includes at least a first Topic and a second Topic, and the publishing module 205 may be configured to perform the following steps:
If the type of the message to be pushed is burst type, the message to be pushed is issued to the first Topic in the Kafka queue.
If the type of the message to be pushed is the leakage type, the message to be pushed is issued to a second Topic in the Kafka queue.
The display terminals are multiple, each display terminal has a unique terminal identifier, and the determining module 202 is further configured to:
Before pushing the message to be pushed to the display terminals through the target WebSocket channel so that the display terminals display the message to be pushed, determining the type of the message to be pushed, which needs to be displayed by each display terminal, and binding the type of the message to be pushed with the corresponding display terminal identification.
In another embodiment, the determining module 202 is further configured to: after the type of the message to be pushed is determined, determining a target display terminal from a plurality of display terminals according to the binding relation between the type of the message to be pushed and the terminal identification.
Accordingly, the pushing module 203 is configured to:
Pushing the message to be pushed to the target display terminal through the target WebSocket channel so that the target display terminal displays the message to be pushed.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
In summary, in the disclosure, a message to be pushed is obtained first, a type of the message to be pushed is further determined, the type of the message to be pushed is determined, then a target WebSocket channel corresponding to the message to be pushed is determined in a pre-created WebSocket channel according to a corresponding relation between the type of the message to be pushed and the WebSocket channel, and finally the message to be pushed is pushed to a display terminal through the target WebSocket channel, and the display terminal receives the message to be pushed through the target WebSocket channel, so that the message to be pushed is displayed. According to the message pushing method and device, the message to be pushed can be actively pushed to the display terminal through the corresponding WebSocket channel according to the type of the message to be pushed, the display terminal is not required to initiate a query request, the resource consumption is reduced, and the flexibility and pushing efficiency of message pushing can be improved.
The message pushing device comprises a processor and a memory, wherein the issuing module, the acquiring module, the pushing module and the like are all stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel can set one or more than one kernel, and the purpose of actively pushing the message to be pushed to the display terminal through the WebSocket channel by adjusting kernel parameters to realize the transfer of the message to be pushed through the message queue.
The embodiment of the invention provides a storage medium, and a program is stored on the storage medium, and the program is executed by a processor to realize the method for pushing any message.
The embodiment of the invention provides a processor for running a program, wherein the method for pushing any message is executed when the program runs.
Fig. 12 is a block diagram of an apparatus 30, according to an example embodiment. The device 30 comprises at least one processor 301, at least one memory 302 connected to the processor 301, a bus 303; the processor 301 and the memory 302 complete communication with each other through the bus 303. The processor 301 is configured to invoke the program instructions in the memory 302 to perform the message pushing method described above. The device herein may be a server (e.g., a local server or cloud server), a smart phone, a tablet computer, a PDA, a portable computer, or a fixed terminal such as a desktop computer.
The application also provides a computer program product adapted to perform, when executed on a data processing device, a program initialized with the method steps of:
Obtaining a message to be pushed, and determining the type of the message to be pushed;
Determining a target WebSocket channel corresponding to the message to be pushed from the pre-created WebSocket channels according to the corresponding relation between the type of the message to be pushed and the WebSocket channels;
Pushing the message to be pushed to a display terminal through the target WebSocket channel, so that the display terminal displays the message to be pushed.
Optionally, the WebSocket channel includes at least: the method for determining the target WebSocket channel corresponding to the message to be pushed from the pre-created WebSocket channels according to the corresponding relation between the type of the message to be pushed and the WebSocket channels comprises the following steps:
If the type of the message to be pushed is a burst type, determining the first WebSocket channel as the target WebSocket channel;
And if the type of the message to be pushed is a leakage type, determining the second WebSocket channel as the target WebSocket channel.
Optionally, if the type of the message to be pushed is a leakage type, before pushing the message to be pushed to a display terminal through the target WebSocket channel, the method further includes:
judging the event state corresponding to the message to be pushed;
if the event state is not a new state and the event state is not a false alarm state, jumping to the step of pushing the message to be pushed to a display terminal through the target WebSocket channel, wherein the new state indicates that the data information contained in the message to be pushed is generated for the first time, and the false alarm state indicates that the data information is not leaked.
Optionally, before acquiring the message to be pushed, the method further includes:
The message to be pushed is published to a message queue, so that when the message to be pushed is not acquired for the first time, the message to be pushed is acquired from the message queue; and
Storing the message to be pushed into a preset database, and adding a state identifier for the message to be pushed in the preset database, wherein the state identifier is used for representing whether the message to be pushed is pushed or not;
And/or the number of the groups of groups,
The method further comprises the steps of:
receiving an establishment request sent by the display terminal;
Creating the WebSocket channel according to the building request;
selecting a preset number of messages to be pushed from the database according to a time sequence;
And determining the preset number of messages to be pushed as the messages to be pushed which are acquired for the first time after the WebSocket channel is created.
Optionally, if the type of the message to be pushed is a leakage type, before pushing the message to be pushed to a display terminal through the target WebSocket channel, the method further includes:
Searching the state identification of the message to be pushed in the database to determine whether the message to be pushed is pushed or not;
And if the message to be pushed is not pushed, jumping to the step of pushing the message to be pushed to a display terminal through the target WebSocket channel.
Optionally, the message queue is a Kafka queue, the Kafka queue at least includes a first Topic and a second Topic, and the publishing the message to be pushed to the message queue, so that when the message to be pushed is not acquired for the first time, the acquiring the message to be pushed from the message queue includes:
If the type of the message to be pushed is burst type, the message to be pushed is issued to the first Topic in the Kafka queue;
and if the type of the message to be pushed is a leakage type, publishing the message to be pushed to the second Topic in the Kafka queue.
Optionally, the display terminals are multiple, each display terminal has a unique terminal identifier, and before the message to be pushed is pushed to the display terminal through the target WebSocket channel, so that the display terminal displays the message to be pushed, the method further includes:
determining the type of a message to be pushed, which needs to be displayed, of each display terminal, and binding the type of the message to be pushed with a corresponding display terminal identifier; and/or the number of the groups of groups,
After determining the type of the message to be pushed, the method further comprises:
determining a target display terminal from a plurality of display terminals according to the binding relation between the type of the message to be pushed and the terminal identifier; and/or the number of the groups of groups,
The pushing the message to be pushed to a display terminal through the target WebSocket channel, so that the display terminal displays the message to be pushed, including:
Pushing the message to be pushed to the target display terminal through the target WebSocket channel, so that the target display terminal displays the message to be pushed.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, the device includes one or more processors (CPUs), memory, and a bus. The device may also include input/output interfaces, network interfaces, and the like.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip. Memory is an example of a computer-readable medium.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.

Claims (9)

CN201910872882.3A2019-09-162019-09-16Message pushing method, device, storage medium and equipmentActiveCN112511580B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201910872882.3ACN112511580B (en)2019-09-162019-09-16Message pushing method, device, storage medium and equipment

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201910872882.3ACN112511580B (en)2019-09-162019-09-16Message pushing method, device, storage medium and equipment

Publications (2)

Publication NumberPublication Date
CN112511580A CN112511580A (en)2021-03-16
CN112511580Btrue CN112511580B (en)2024-06-25

Family

ID=74924035

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201910872882.3AActiveCN112511580B (en)2019-09-162019-09-16Message pushing method, device, storage medium and equipment

Country Status (1)

CountryLink
CN (1)CN112511580B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113067882A (en)*2021-03-312021-07-02建信金融科技有限责任公司Message processing method and device, electronic equipment and medium
CN113452774B (en)*2021-06-252022-07-12睿视(苏州)视频科技有限公司Message pushing method, device, equipment and storage medium
CN114039961A (en)*2021-10-082022-02-11中移(杭州)信息技术有限公司Message pushing method, device, server and storage medium based on WebSocket
CN114003327A (en)*2021-10-292022-02-01北京达佳互联信息技术有限公司 A message push method, device, terminal and storage medium
CN115150380A (en)*2022-06-302022-10-04广发证券股份有限公司Market quotation subscribing and publishing method and device suitable for multiple market quotation sources
CN115514731B (en)*2022-09-222024-09-17中国农业银行股份有限公司Message pushing method, device, medium and electronic equipment

Citations (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN108390950A (en)*2018-05-282018-08-10中国建设银行股份有限公司A kind of information push method, device and equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN104980898A (en)*2014-04-042015-10-14中兴通讯股份有限公司Information pushing method, system and equipment
CN107426081A (en)*2017-04-182017-12-01贵阳朗玛信息技术股份有限公司A kind of real-time messages transmission method and system
CN107181821A (en)*2017-07-052017-09-19广州华多网络科技有限公司A kind of information push method and device based on SSE specifications
CN108924265A (en)*2018-08-232018-11-30河南思维轨道交通技术研究院有限公司Data capture method, device and web page server
CN109981607B (en)*2019-03-072022-09-09深圳市商汤科技有限公司Media stream processing method and device, electronic equipment and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN108390950A (en)*2018-05-282018-08-10中国建设银行股份有限公司A kind of information push method, device and equipment

Also Published As

Publication numberPublication date
CN112511580A (en)2021-03-16

Similar Documents

PublicationPublication DateTitle
CN112511580B (en)Message pushing method, device, storage medium and equipment
CN112511339B (en)Container monitoring alarm method, system, equipment and storage medium based on multiple clusters
CN110310034B (en)Service arrangement and business flow processing method and device applied to SaaS
US11177999B2 (en)Correlating computing network events
CN105787077B (en)Data synchronization method and device
CN108289034B (en)A kind of fault discovery method and apparatus
CN110795756A (en)Data desensitization method and device, computer equipment and computer readable storage medium
CN107315972B (en)A kind of big data unstructured document dynamic desensitization method and system
CN111736825B (en)Information display method, device, equipment and storage medium
CN107181821A (en)A kind of information push method and device based on SSE specifications
CN107786551B (en)Method for accessing intranet server and device for controlling access to intranet server
CN113836405A (en)Information query method, device and computer readable storage medium
CN117215900A (en)Log acquisition method, device and equipment
KR20110037969A (en) Targeted user notification of messages in the monitoring system
CN110990213A (en)Method and device for monitoring user logs in cluster environment in real time
CN110933152A (en)Preheating method, device and system and electronic equipment
CN110888790B (en)Log management method and device, electronic equipment and storage medium
CN113055493A (en)Data packet processing method, device, system, scheduling device and storage medium
US9577967B2 (en)Method and system for managing an informational site using a social networking application
CN112488462A (en)Unified pushing method, device and medium for workflow data
CN109067864B (en)Notification message pushing method and device and electronic equipment
CN110502333B (en)Access request processing method and cloud storage system
CN116680187A (en)Data processing method and device
CN109815081A (en)The long range acquisition method and collection device of database performance
CN114168663A (en) A data processing method based on operation and maintenance platform

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp