Disclosure of Invention
The purpose of the application is to provide a message pushing method, a device and a medium, which are used for solving the problems that in the prior art, a target receiving terminal needs to be confirmed in a polling mode for sending messages of a plurality of receiving terminals, and the network traffic is large and the pushing delay is high.
In order to solve the above technical problems, the present application provides a message pushing method, including:
receiving a target message sent by a service party;
under the condition that the pushing condition meets a message pushing mode set by a user, the target message is sent to a message queue;
and sending the target message in the message queue to a receiving terminal corresponding to the positioning character string according to the positioning character string in the target message and the configured pushing rule.
Preferably, the message pushing mode includes a real-time sending mode and a timing sending mode;
if the message is in the timing sending mode, sending the target message to a message queue under the condition that the pushing condition meets the message pushing mode set by the user is as follows: and starting timing after receiving the target message, and sending the target message to the message queue after the timing time meets the set time.
Preferably, the message pushing mode includes a real-time sending mode and a timing sending mode;
if the message is in the timing sending mode, sending the target message to a message queue under the condition that the pushing condition meets the message pushing mode set by the user is as follows: and when the system time reaches a preset time point, the target message is sent to the message queue.
Preferably, the sending the target message in the message queue to the receiving terminal corresponding to the positioning character string according to the positioning character string in the target message and the configured pushing rule includes:
confirming a target receiving terminal sent according to the positioning character string in the target message;
and calling the pushing rule, reading a character string used for representing the message type in the target message to confirm the type of the target message, merging the target messages with the same type in the message queue, and then sending the merged target message to the target receiving terminal.
Preferably, after the step of sending the target message to a message queue, the method further includes:
screening the target message in the message queue according to the configured screening rule; the screening rule is a rule configured according to the set sensitive character string.
Preferably, the step of merging the target messages of the same type in the message queue and then sending the merged target message to the target receiving terminal includes:
and merging the target messages of the same type in the message queue received in a preset time period and then sending the merged target messages to the target receiving terminal.
Preferably, the sending the target message in the message queue to the receiving terminal corresponding to the positioning string is: sending the target message in the message queue to a receiving terminal corresponding to the positioning character string in an asynchronous multithreading consumption mode; the number of threads is set according to the number of the receiving terminals.
In order to solve the above technical problem, the present application further provides a message pushing device, including:
the receiving module is used for receiving the target message sent by the service party;
the sending module is used for sending the target message to a message queue under the condition that the pushing condition meets a message pushing mode set by a user;
and the processing module is used for sending the target message in the message queue to a receiving terminal corresponding to the positioning character string according to the positioning character string in the target message and the configured pushing rule.
In order to solve the above technical problem, the present application further provides another message pushing device, including a memory, configured to store a computer program;
and the processor is used for realizing the steps of the message pushing method when executing the computer program.
To solve the above technical problem, the present application further provides a computer readable storage medium, where a computer program is stored, where the computer program implements the steps of the message pushing method described above when executed by a processor.
According to the message pushing method, the target message sent by the service party is received; under the condition that the pushing condition meets a message pushing mode set by a user, sending a target message to a message queue; and sending the target message in the message queue to a receiving terminal corresponding to the positioning character string according to the positioning character string in the target message and the configured pushing rule. Compared with the prior art, the method has the advantages that the problems that the network flow is large, the pushing delay is high and the like of the target receiving terminal are confirmed in a polling mode for sending the messages of the plurality of receiving terminals, the method is adopted to uniformly send the messages sent by the service party, after the target messages are received, the target messages in the message queue are sent to the receiving terminals corresponding to the positioning character strings according to the positioning character strings in the target messages and the configured pushing rules, the identification of the receiving terminals is realized, the message pushing can be carried out by combining the pushing rules, the customized pushing mode can be realized, and the user experience is improved. In addition, when the target message is sent to the message queue, the target message is sent under the condition that the pushing condition meets the message pushing mode set by the user, so that unified arrangement of the messages is facilitated.
In addition, the message pushing device and the medium provided by the application correspond to the message pushing method, and have the same effects.
Detailed Description
The following description of the technical solutions in the embodiments of the present application will be made clearly and completely with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments herein without making any inventive effort are intended to fall within the scope of the present application.
The core of the application is to provide a message pushing method, a device and a medium, which are used for realizing more convenient message pushing.
In order to provide a better understanding of the present application, those skilled in the art will now make further details of the present application with reference to the drawings and detailed description.
Fig. 1 is a flowchart of a message pushing method provided in an embodiment of the present application, where, as shown in fig. 1, the message pushing method includes:
s10: receiving a target message sent by a service party;
s11: under the condition that the pushing condition meets a message pushing mode set by a user, sending a target message to a message queue;
s12: and sending the target message in the message queue to a receiving terminal corresponding to the positioning character string according to the positioning character string in the target message and the configured pushing rule.
The message pushing method provided by the application is mainly used for realizing unified sending processing of the messages, and is used as an intermediate plug-in unit for sending the messages of the service party to each receiving terminal. In a specific implementation, the execution body of the message pushing method may be a message pushing device, and in particular may be a processor, and from the aspect of software, the message pushing method may be used as a message pushing platform, where the platform includes a message pushing receiver, a pushing management server, and a pushing database. The message push receiver is configured to receive a message from a sender, i.e. a service party, and transmit the message to the push management server. The push management server is responsible for selecting a proper push mode according to the received message and pushing the message to a receiving terminal, namely a target device or a user. The push database is used for storing data related to message pushing, including push records, push policies, and the like.
In a specific implementation, the target message sent by the service party needs to be received first, and the target message sent by the service party may be multiple types, multiple messages or single. In the message pushing method, a user can set a message pushing mode of a target message according to requirements, for example, the message received in a period of time can be uniformly sent, the message can be sent at a certain set time point, and the message can be sent immediately after the message is received. In addition, the configuration may be performed according to the number, the number of times, etc. of received messages, for example, the configuration may be performed after the messages of the service party are received for a plurality of times. And when the sending time of the target message is required to meet the message pushing mode set by the user, the target message is sent to the message queue. In a specific implementation, different service interfaces can be selected for different message pushing modes to perform respective processing.
After the target message is sent to the message queue, the message in the message queue can be consumed through an austin-handler service, and specifically, the target message in the message queue can be sent to a receiving terminal corresponding to the positioning character string according to the positioning character string in the target message and the configured pushing rule. It can be understood that, depending on the receiving terminal, the pushing manner of the target message may also be different, for example, a push notification, a push message, a push mail, a push sms, etc. In the targeted message sent by the service party there should be a positioning string distinguishing which receiving terminal or terminals to send to, so the austin-handler service distinguishes which receiving terminals to send the message to by the positioning string. In addition, the customized and personalized processing can be carried out on the pushed content through the configured pushing rule, so that the user experience is improved.
According to the message pushing method, the target message sent by the service party is received; under the condition that the pushing condition meets a message pushing mode set by a user, sending a target message to a message queue; and sending the target message in the message queue to a receiving terminal corresponding to the positioning character string according to the positioning character string in the target message and the configured pushing rule. Compared with the prior art, the method has the advantages that the problems that the network flow is large, the pushing delay is high and the like of the target receiving terminal are confirmed in a polling mode for sending the messages of the plurality of receiving terminals, the method is adopted to uniformly send the messages sent by the service party, after the target messages are received, the target messages in the message queue are sent to the receiving terminals corresponding to the positioning character strings according to the positioning character strings in the target messages and the configured pushing rules, the identification of the receiving terminals is realized, the message pushing can be carried out by combining the pushing rules, the customized pushing mode can be realized, and the user experience is improved. In addition, when the target message is sent to the message queue, the target message is sent under the condition that the pushing condition meets the message pushing mode set by the user, so that unified arrangement of the messages is facilitated.
The above embodiments provide various message pushing modes, which may be set according to time, or may be the number of messages, the number of times of transmission, etc. On the basis of the above embodiment, the present embodiment provides a specific message pushing mode, including a real-time sending mode and a timing sending mode;
if the message is in the timing sending mode, if the pushing condition meets the message pushing mode set by the user, sending the target message to the message queue is as follows: and starting timing after receiving the target message, and sending the target message to a message queue when the timing time meets the set time.
The present embodiment provides different service interfaces, for example, by invoking an austin-api service interface to send when sending real-time messages; when the timing message is sent, the timing task is managed and configured through an austin-admin service.
The timing transmission mode provided in this embodiment may be to start timing after receiving a target message sent by a service party, for example, when the timing time reaches 5 minutes, and then send the target message to a message queue. Alternatively, the target message received within 5 minutes may be uniformly sent to the message queue.
As another timing transmission mode, in the case where the push condition satisfies the message push mode set by the user, transmitting the target message to the message queue is: and when the system time reaches a preset time point, sending the target message to a message queue. The timing sending mode in this embodiment may be sending by depending on the time of the computer system itself, for example, configuring a fixed message pushing time in each day, and after the system time reaches a preset time point, sending all the received target messages to the message queue.
In this embodiment, the real-time transmission mode refers to a mode of transmitting a target message sent by a service party to a message queue immediately after receiving the target message, where the real-time transmission mode is a mode relative to a timing transmission mode, and the timing transmission mode needs to transmit the message when time is satisfied, and the real-time transmission mode is a mode of transmitting the message immediately after receiving the message, and of course, there is a possibility that the message in the real-time transmission mode is delayed due to problems such as network fluctuation and transmission.
In the foregoing embodiments, in order to improve user experience, the application further provides a customizable push rule, where in this embodiment, providing a specific push rule, specifically, according to a positioning string in a target message and a configured push rule, sending the target message in a message queue to a receiving terminal corresponding to the positioning string includes:
confirming a target receiving terminal sent according to a positioning character string in the target message;
and calling a pushing rule, reading a character string used for representing the type of the message in the target message to confirm the type of the target message, merging the target messages of the same type in the message queue, and then sending the merged target message to the target receiving terminal.
The pushing rule provided in the embodiment is used for merging the target messages according to the types of the messages, so that unified pushing of the messages is realized. In this embodiment, the type of the target message may be confirmed by reading a string for characterizing the type of the message in the target message, and the target messages of the same type in the message queue may be combined and then sent. In this process, the messages in the same message queue may be combined, and in other embodiments, the step of sending the same type of target message in the message queue to the target receiving terminal after combining includes: and merging the target messages of the same type in the message queues received in the preset time period and then sending the merged target messages to the target receiving terminal. In this embodiment, the pushing of the message may be to combine the messages sent by the service side for multiple times, for example, for a message in the real-time sending mode, the messages in all the message queues received in the preset time period may be combined.
It will be appreciated that there may be unwanted messages, sensitive messages, or company internal messages, etc. in the target message sent by the business side, and such messages may be sent in error. Therefore, in order to avoid the false sending of the sensitive information, in this embodiment, after the step of sending the target message to the message queue, the method further includes: screening the target message in the message queue according to the configured screening rule; the screening rule is a rule configured according to the set sensitive character string.
In this embodiment, the screening rule is a rule configured according to a set sensitive character string, for example, the set sensitive character string is a, and if the set sensitive character string is a, the message containing a in the target message is screened, and the target message containing no a is pushed. In addition, in the implementation, different filtering rules may be configured for different receiving terminals, for example, the sensitive character string of the first receiving terminal is a, and the sensitive character string of the second receiving terminal is B.
In a specific implementation, in order to ensure success of message transmission, after the message is transmitted to the receiving terminal by using the message pushing method provided by the application, information which is fed back by the receiving terminal and is used for representing success of message transmission can be obtained, so that other messages or messages of the next receiving terminal can be transmitted. In this embodiment, in order to increase the rate of sending the message, sending the target message in the message queue to the receiving terminal corresponding to the positioning string is: sending the target message in the message queue to a receiving terminal corresponding to the positioning character string in an asynchronous multithreading consumption mode; the number of threads is set according to the number of receiving terminals.
In this embodiment, by means of asynchronous consumption, after sending the message, the default receiving terminal can receive the message, so as to implement quick sending of the message, and avoid pushing of other messages caused by abnormality of feedback information of the receiving terminal. In addition, through a multithreading mode, the information can be simultaneously pushed to different receiving terminals, and the sending rate is improved.
In the above embodiments, the detailed description is given to the message pushing method, and the application further provides a corresponding embodiment of the message pushing device. It should be noted that the present application describes an embodiment of the device portion from two angles, one based on the angle of the functional module and the other based on the angle of the hardware.
Fig. 2 is a block diagram of a message pushing device provided in an embodiment of the present application, and as shown in fig. 2, the message pushing device includes:
a receiving module 10, configured to receive a target message sent by a service party;
a sending module 11, configured to send a target message to a message queue when a push condition satisfies a message push mode set by a user;
the processing module 12 is configured to send the target message in the message queue to the receiving terminal corresponding to the positioning string according to the positioning string in the target message and the configured pushing rule.
Since the embodiments of the apparatus portion and the embodiments of the method portion correspond to each other, the embodiments of the apparatus portion are referred to the description of the embodiments of the method portion, and are not repeated herein.
Compared with the prior art that the problem that the target receiving terminal has large network flow, high pushing delay and the like in the message sending of a plurality of receiving terminals is required to be confirmed by a polling mode, by adopting the technical scheme, the message sending device for the message provided by the embodiment of the application uniformly sends the message sent by the service party, after receiving the target message, sends the target message in the message queue to the receiving terminal corresponding to the positioning character string according to the positioning character string in the target message and the configured pushing rule, so that the identification of the receiving terminal is realized, the message pushing can be carried out by combining the pushing rule, the customized pushing mode can be realized, and the user experience is improved. In addition, when the target message is sent to the message queue, the target message is sent under the condition that the pushing condition meets the message pushing mode set by the user, so that unified arrangement of the messages is facilitated.
Fig. 3 is a block diagram of another message pushing device provided in an embodiment of the present application, as shown in fig. 3, where the device includes: a memory 20 for storing a computer program;
the processor 21 is configured to implement the steps of the message pushing method according to the above embodiment when executing the computer program.
The message pushing device provided in this embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, or the like.
Processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 may be implemented in hardware in at least one of a digital signal processor (Digital Signal Processor, DSP), a Field programmable gate array (Field-Programmable Gate Array, FPGA), a programmable logic array (Programmable Logic Array, PLA). The processor 21 may also comprise a main processor, which is a processor for processing data in an awake state, also called central processor (Central Processing Unit, CPU), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 21 may be integrated with an image processor (Graphics Processing Unit, GPU) for taking care of rendering and rendering of the content that the display screen is required to display. In some embodiments, the processor 21 may also include an artificial intelligence (Artificial Intelligence, AI) processor for processing computing operations related to machine learning.
Memory 20 may include one or more computer-readable storage media, which may be non-transitory. Memory 20 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used for storing a computer program 201, which, when loaded and executed by the processor 21, is capable of implementing the relevant steps of the message pushing method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may further include an operating system 202, data 203, and the like, where the storage manner may be transient storage or permanent storage. The operating system 202 may include Windows, unix, linux, among others. The data 203 may include, but is not limited to, a positioning string or the like.
In some embodiments, the message pushing device may further include a display 22, an input/output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.
Those skilled in the art will appreciate that the configuration shown in fig. 3 is not limiting of the message pushing device and may include more or fewer components than shown.
The message pushing device provided by the embodiment of the application comprises a memory and a processor, wherein the processor can realize the following method when executing a program stored in the memory: receiving a target message sent by a service party; under the condition that the pushing condition meets a message pushing mode set by a user, sending a target message to a message queue; and sending the target message in the message queue to a receiving terminal corresponding to the positioning character string according to the positioning character string in the target message and the configured pushing rule.
Compared with the prior art that the problem that the target receiving terminal has large network flow, high pushing delay and the like in the message sending of a plurality of receiving terminals is required to be confirmed by a polling mode, by adopting the technical scheme, the message sending device for the message provided by the embodiment of the application uniformly sends the message sent by the service party, after receiving the target message, sends the target message in the message queue to the receiving terminal corresponding to the positioning character string according to the positioning character string in the target message and the configured pushing rule, so that the identification of the receiving terminal is realized, the message pushing can be carried out by combining the pushing rule, the customized pushing mode can be realized, and the user experience is improved. In addition, when the target message is sent to the message queue, the target message is sent under the condition that the pushing condition meets the message pushing mode set by the user, so that unified arrangement of the messages is facilitated.
Finally, the present application also provides a corresponding embodiment of the computer readable storage medium. The computer-readable storage medium has stored thereon a computer program which, when executed by a processor, performs the steps as described in the method embodiments above.
It will be appreciated that the methods of the above embodiments, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored on a computer readable storage medium. With such understanding, the technical solution of the present application, or a part contributing to the prior art or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium, performing all or part of the steps of the method described in the various embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The message pushing method, the device and the medium provided by the application are described in detail above. In the description, each embodiment is described in a progressive manner, and each embodiment is mainly described by the differences from other embodiments, so that the same similar parts among the embodiments are mutually referred. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section. It should be noted that it would be obvious to those skilled in the art that various improvements and modifications can be made to the present application without departing from the principles of the present application, and such improvements and modifications fall within the scope of the claims of the present application.
It should also be noted that in this specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, 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 the element.