Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1-2 are schematic diagrams of an application scenario diagram of a message processing method of some embodiments of the present disclosure.
As shown in fig. 1, the electronic device 101 actively pushes a message to the client 102 to expose the message when there is a message by maintaining a long connection with the client 102. Wherein the message (i.e., the message notification) is used to alert the target user of the receipt of information from the system or other users.
Here, the electronic device 101 may greatly improve the efficiency of message presentation through long connection communication with the client 102. However, for messages with less high real-time requirements, it may be costly to deliver the messages in a long connection. In addition, maintenance of long connections is also costly.
As shown in fig. 2, the electronic device 201 periodically polls through the client 202 for the presence of a message to be delivered. And when the message is determined to exist, reading the message and displaying the message.
Here, for the mode of the client 202 polling periodically, if the polling time interval is too small, the number of accesses becomes high, and the cost also increases. And the polling time interval is too long, which results in poor message real-time performance, low efficiency and poor user experience.
In this way, there is often a problem of higher cost or relative lower efficiency for retrieving messages in a manner that maintains a long connection with the client and retrieving messages by periodic polling of the client.
The electronic device 101 and the electronic device 201 may be hardware or software. When the electronic device is hardware, the electronic device may be implemented as a distributed cluster formed by a plurality of servers or terminal devices, or may be implemented as a single server or a single terminal device. When the electronic device is embodied as software, it may be installed in the above-listed hardware devices. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
It should be understood that the number of electronic devices in fig. 1 and 2 is merely illustrative. There may be any number of electronic devices, as desired for implementation.
With continued reference to fig. 3, a flow 300 of some embodiments of a message processing method according to the present disclosure is shown. The message processing method comprises the following steps:
step 301, in response to receiving a message reading request of a client, reading at least one first message from a first storage space, and reading at least one second message from a second storage space.
In some embodiments, in response to receiving a message read request from a client, an executing entity (e.g., electronic device 101 shown in fig. 1) may read at least one first message from a first memory space and at least one second message from a second memory space. Wherein, the message reading request comprises: the client sends a first request in a periodic time and a second request triggered by the client based on received message signaling, wherein the message signaling is used for sending information that the inter-user message exists in the first storage space to the client. The first memory space may be a message memory space in a message system. The second storage space may be a message storage space of the application processing side. Here, the application processing side may be an application side that is pre-established for the system-directed push message and includes respective message processing sides. Each message processing terminal in the message processing terminals can calculate whether the system directional push message sent by the corresponding application needs to be sent to the client corresponding to the target user when the target user is online or not in real time. The system-directed push message may be a message sent by an application to a portion of users. For example, the system-directed push message may be a message sent by a target application to a user that has opened a member at the target application. Message signaling may be an instruction to notify the messaging system whether there is an inter-user message. The inter-user message may be a message transmitted between users. For example, both user a and user B use the target application, and user a and user B can chat in the target application. Thus, each message in the chat sent between user a and user B is an inter-user message.
It should be noted that, the message format of each of the at least one first message and the at least one second message may be: the method comprises the steps of identifying the type of an application, the source type of a message, the source object of the message, the source device of the message, the priority of the message, the expiration time of the message, the repeated determination information of the message, the display time of the message and the content of the message. The source type of the message corresponds to different configuration items and corresponds to application scenes of different services. The priority of a message characterizes how important the message is. The determination information of the message repetition may be whether the same message as the message appears in the history message. The expiration time of the message and the presentation time of the message may be timestamps corresponding to the message.
In some optional implementations of some embodiments, the first message includes: system global push messages and/or inter-user messages. The second message includes: the system directs push messages. The system global push message may be a message pushed by an application to all users currently in use or registered.
Optionally, in response to receiving the first request, where the first request is a request triggered by the client after receiving a message instruction in a long connection manner, the inter-user message is sent to the client in a short connection manner, and in response to receiving the second request, the system global push message and/or the system directional push message is sent to the client. The short connection can establish a connection when both communication parties have data interaction, and the connection is disconnected after the data transmission is completed, namely, only one service is transmitted in each connection. The long connection is a connection mode in which the client and the server are connected first to perform data interaction and are not disconnected after being established.
It should be noted that the importance of the inter-user message is relatively high compared to the system global push message and the system directional push message. Therefore, the message between the users is transmitted by adopting a long connection mode, so that the real-time performance of the message can be guaranteed. Since system global push messages and system directed push messages may be worthless messages. Therefore, selecting a short connection to transmit can reduce the cost reasonably.
Step 302, sequencing the at least one first message and the at least one second message to obtain a message sequence.
In some embodiments, the execution body may sort the at least one first message and the at least one second message to obtain a message sequence.
As an example, the execution body may first determine a priority of each of the at least one first message and the at least one second message. Wherein the priority of each message may be preset. The priority of a message may characterize the importance of the message. Then, the execution body sorts the at least one first message and the at least one second message according to the priority of each message to obtain a message sequence.
Step 303, sending at least one target message in the message sequence to the client according to the sequence of the messages in the message sequence.
In some embodiments, the execution body may send at least one target message in the message sequence to the client according to an order of the messages in the message sequence. The at least one target message may be a part of the messages in the message sequence, or may be all the messages in the message sequence.
As an example, the at least one target message may be at least one message in a message sequence whose priority satisfies a predetermined condition.
One of the above-described various embodiments of the present disclosure has the following advantageous effects: in response to receiving a message read request of a client, different message read requests can be respectively adopted to efficiently and cost-effectively read at least one first message from a first storage space and at least one second message from a second storage space. In particular, the real-time required for the inter-user message stored in the first memory space is high, so that retrieving the message by the second request triggered by the received message signaling may be more efficient for pushing the inter-user message to the client. For other types of messages in the second storage space and the first storage space, the real-time requirement is low, and the messages can be read through the first request sent by the client periodically. Alternatively, a relatively longer polling time may be employed to reduce costs. Then, the at least one first message and the at least one second message are sequenced to obtain a message sequence. And finally, sending at least one target message in the message sequence to the client according to the sequence of the messages in the message sequence. Here, by sequencing at least one first message and at least one second message, more targeted and important messages can be sent to the client first to improve the message sending efficiency.
Fig. 4 is a schematic diagram of yet another application scenario diagram of a message processing method of some embodiments of the present disclosure.
As shown in fig. 4, in response to receiving a message read request of the client 406, the electronic device 101 may read at least one first message from the first storage space 102 and at least one second message from the second storage space 403. Wherein, the message reading request comprises: a first request sent by the client 406 periodically and a second request triggered by the client 406 based on the received message signaling. The message signaling is used to send the information that the inter-user message exists in the first storage space 402 to the client 406. In the present application scenario, the first storage space 402 may be a message storage space in a message system. The second storage space 403 may be a message storage space of the application processing side. The messages stored in the first storage space 402 may include: first message 4021, first message 4022, first message 4023. The messages stored in the second storage space 403 may include: second message 4031, second message 4032, second message 4033. The execution entity may then sequence the at least one first message and the at least one second message to obtain a message sequence 404. In this application scenario, the message sequence 404 may be: "second message 4031, first message 4022, second message 4033, second message 4032, first message 4021, first message 4023". Finally, the execution agent may send at least one target message 405 in the message sequence 404 to the client 406 according to the sequence of messages in the message sequence 404. In the application scenario, the at least one target message 405 may include: a first message 4022, a second message 4033, a second message 4032, a first message 4021.
The electronic device 401 may be hardware or software. When the electronic device is hardware, the electronic device may be implemented as a distributed cluster formed by a plurality of servers or terminal devices, or may be implemented as a single server or a single terminal device. When the electronic device is embodied as software, it may be installed in the above-listed hardware devices. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
It should be understood that the number of electronic devices in fig. 4 is merely illustrative. There may be any number of electronic devices, as desired for implementation.
Continuing to refer to fig. 5, a flow 500 of further embodiments of a message processing method according to the present disclosure is shown, comprising the steps of:
it should be noted that the first message includes: a system global push message and/or an inter-user message, wherein the second message includes: the system directs push messages.
Step 501, in response to receiving a message reading request of a client, reading at least one first message from a first storage space, and reading at least one second message from a second storage space.
In some embodiments, in response to receiving a message read request from a client, an executing entity (e.g., electronic device 101 shown in fig. 1) may read at least one first message from a first memory space and at least one second message from a second memory space. The method comprises the steps of responding to each parameter index included in a message sending request sent by a user and/or a system to meet a preset condition, determining that messages sent by the user and/or the system meet a message frequency control requirement, and selectively storing the messages sent by the user and/or the system. For example, the respective parameter indicators may include, but are not limited to, at least one of: time parameter, message content parameter. The message frequency control requirements may be set for two dimensions (user dimension and message type dimension). The user dimension mainly checks whether the number of messages received within a time frame exceeds the relevant frequency control strategy. The message type dimension mainly checks whether the number of messages received within a time range of a message of a certain message type exceeds the frequency control strategy.
In some optional implementations of some embodiments, the selectively storing the message sent by the user and/or the system may include the following steps:
in a first step, in response to the message sent by the user and/or the system being the inter-user message, the message is stored in the first storage space according to a first predetermined storage format. As an example, the first predetermined storage format may be: "user identification ID: message notification list ".
And secondly, responding to the message sent by the user and/or the system as the global system push message, and storing the message in the first storage space according to a second preset storage format. As an example, the second predetermined storage format may be: "application identification ID: message notification list ".
And thirdly, responding to the message sent by the user and/or the system as the system directional push message, sending the system directional push message to an application processing end according to a message sending request with a preset standard format, and calculating whether to send the message to the client in real time when waiting for the target user to log in the client.
In some optional implementations of some embodiments, determining whether the message sent by the user and/or the system meets the message frequency control requirement is performed by:
the method comprises a first step of responding to at least one message stored in the first storage space and/or the second storage space, and determining a first number of history messages received in the first storage space and/or the second storage space.
Here, determining the first number of the history messages received in the first storage space and/or the second storage space may avoid sending a large number of messages to the client within a period of time, so that the client receives a large number of messages instantly, and the user experience is poor. In addition, there may be a heavy load problem with a large number of messages sent to the client.
And secondly, responding to the condition that the first number is smaller than a first preset threshold value, acquiring each history message pre-stored in the first storage space and/or the second storage space and determining the type of the message sent by the user and/or the system.
As an example, in response to the first number being smaller than a first predetermined threshold, the execution main body may acquire, in a wired manner or a wireless manner, each history message pre-stored in the first storage space and/or the second storage space. The execution body may also determine the type of the message sent by the user and/or the system by querying the message format of the message sent by the user and/or the system.
And thirdly, determining a second number of history messages with the same type as the history messages in each history message.
And fourthly, responding to the second number smaller than a second preset threshold value, and determining that the message meets the message frequency control requirement.
Optionally, the system directs the push message to determine whether to send to the client by:
and step one, responding to the detection that the target user logs in the client, and sending a third request to the application processing terminal. Wherein, the third request is used to determine whether a system push direction message exists in a second storage space in the application processing terminal.
And a second step of indicating, in response to the application processing end receiving the third request, each message processing end in the application processing ends to calculate in real time whether a message to be sent to the client exists in at least one system-oriented push message sent by the corresponding application.
And thirdly, responding to the determined existence, and storing at least one system directional push message to be sent to the client to the second storage space.
And fourthly, reading the directional push information of each system from the second storage space as the second message.
Optionally, each application sends at least one system-oriented push message to the application processing end through the message sending request in the predetermined canonical format; and responding to the end of real-time calculation of each message processing terminal in the application processing terminals, and sending a message request response with a preset response format corresponding to each system directional push message in the at least one system directional push message to the corresponding application.
Optionally, the message sending request in the predetermined canonical format includes: the application identification corresponding to the application, the user identification corresponding to each system directional push message and the client identification of the target user are obtained; the message request response in the predetermined response format includes at least one of: the system directional push message sent to the client is normalized and the reason information of the system directional push message not sent to the client is identified by the error of the system directional push message not sent to the client.
Step 502, sequencing the at least one first message and the at least one second message to obtain a message sequence.
Step 503, sending at least one target message in the message sequence to the client according to the sequence of the messages in the message sequence.
In some embodiments, the specific implementation of steps 501 and 503 and the technical effect brought by the implementation may refer to steps 301 and 303 in those embodiments corresponding to fig. 3, and are not described herein again.
As can be seen from fig. 5, the flow 500 of the message processing method in some embodiments corresponding to fig. 3 highlights the specific steps of message storage more than the description of some embodiments corresponding to fig. 3. Therefore, the solutions described in the embodiments can efficiently and selectively store the messages sent by the user and/or the system by considering that the message sending request includes various parameter indexes and that the messages sent by the user and/or the system satisfy the message frequency control requirement.
With continuing reference to fig. 6, as an implementation of the above-described method for the above-described figures, the present disclosure provides some embodiments of a message processing apparatus, which correspond to those of the method embodiments described above for fig. 3, and which may be applied in various electronic devices in particular.
As shown in fig. 6, the message processing apparatus 600 of some embodiments includes: a reading unit 601, a sorting unit 602 and a sending unit 602. The reading unit 601 is configured to, in response to receiving a message reading request of a client, read at least one first message from a first storage space and read at least one second message from a second storage space; wherein, the message reading request comprises: the client sends a first request in a periodic time and a second request triggered by the client based on received message signaling, wherein the message signaling is used for sending information that the inter-user message exists in the first storage space to the client. A sorting unit 602 configured to sort the at least one first message and the at least one second message to obtain a message sequence. A sending unit 603 configured to send at least one target message in the message sequence to the client according to the order of the messages in the message sequence.
In some optional implementations of some embodiments, the first message includes: a system global push message and/or an inter-user message, wherein the second message includes: the system directs push messages.
In some optional implementation manners of some embodiments, in response to receiving the first request, where the first request is a request triggered by the client after receiving a message instruction in a long connection manner, the inter-user message is sent to the client in a short connection manner, and in response to receiving the second request, the system global push message and/or the system directional push message is sent to the client.
In some optional implementations of some embodiments, in response to that each parameter index included in a message sending request sent by a user and/or a system satisfies a predetermined condition and that a message sent by the user and/or the system satisfies a message frequency control requirement, the message sent by the user and/or the system is selectively stored.
In some optional implementations of some embodiments, the message processing apparatus 600 further includes: a storage device (not shown). Wherein the storage device may be configured to: responding to the message sent by the user and/or the system as the inter-user message, and storing the message in the first storage space according to a first preset storage format; and responding to the message sent by the user and/or the system as the system global push message, and storing the message in the first storage space according to a second preset storage format. Responding to the message sent by the user and/or the system as the system directional push message, sending the system directional push message to an application processing end according to a message sending request with a preset standard format, and calculating whether to send the message to the client in real time when waiting for the target user to log in the client.
In some optional implementations of some embodiments, determining whether the message sent by the user and/or the system meets the message frequency control requirement is performed by: in response to storing at least one message in the first memory space and/or the second memory space, determining a first number of history messages received in the first memory space and/or the second memory space; in response to the first number being smaller than a first predetermined threshold, obtaining each history message pre-stored in the first storage space and/or the second storage space and determining the type of the message sent by the user and/or the system; determining a second number of history messages of the same type as the history messages in the history messages; and in response to the second number being less than a second predetermined threshold, determining that the message satisfies the message frequency control requirement.
In some optional implementations of some embodiments, the system directs the push message to determine whether to send to the client by: responding to the detected target user logging in the client, and sending a third request to the application processing terminal; the third request is used for determining whether a system push direction message exists in a second storage space in the application processing terminal; responding to the application processing terminal receiving the third request, and indicating each message processing terminal in the application processing terminals to calculate whether a message to be sent to the client exists in at least one system directional push message sent by the corresponding application in real time; in response to determining that the at least one system-directed push message to be sent to the client is present, storing the at least one system-directed push message to the second storage space; and reading the directional push information of each system from the second storage space as the second message.
In some optional implementation manners of some embodiments, each application sends at least one system-oriented push message to the application processing end through the message sending request in the predetermined canonical format; and responding to the end of real-time calculation of each message processing terminal in the application processing terminals, and sending a message request response with a preset response format corresponding to each system directional push message in the at least one system directional push message to the corresponding application.
In some optional implementations of some embodiments, the message sending request in the predetermined canonical format includes: the application identification corresponding to the application, the user identification corresponding to each system directional push message and the client identification of the target user are obtained; the message request response in the predetermined response format includes at least one of: the system directional push message sent to the client is normalized and the reason information of the system directional push message not sent to the client is identified by the error of the system directional push message not sent to the client.
It will be understood that the elements described in the apparatus 600 correspond to various steps in the method described with reference to fig. 3. Thus, the operations, features and resulting advantages described above with respect to the method are also applicable to the apparatus 600 and the units included therein, and are not described herein again.
Referring now to fig. 7, shown is a schematic diagram of an electronic device 700 suitable for use in implementing some embodiments of the present disclosure. The electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 7, electronic device 700 may include a processing means (e.g., central processing unit, graphics processor, etc.) 701 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from storage 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the electronic apparatus 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Generally, the following devices may be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 708 including, for example, magnetic tape, hard disk, etc.; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 illustrates an electronic device 700 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 7 may represent one device or may represent multiple devices as desired.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network via communications means 709, or may be installed from storage 708, or may be installed from ROM 702. The computer program, when executed by the processing device 701, performs the above-described functions defined in the methods of some embodiments of the present disclosure.
It should be noted that the computer readable medium described above in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the apparatus; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: in response to receiving a message reading request of a client, reading at least one first message from a first storage space and at least one second message from a second storage space; wherein, the message reading request comprises: a first request sent by the client in a periodic time and a second request triggered by the client based on a received message signaling, where the message signaling is used to send information that there is an inter-user message in the first storage space to the client; sequencing the at least one first message and the at least one second message to obtain a message sequence; and sending at least one target message in the message sequence to the client according to the sequence of the messages in the message sequence.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in some embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware. The described units may also be provided in a processor, and may be described as: a processor includes a reading unit, a sorting unit, and a transmitting unit. The names of these units do not in some cases form a limitation on the units themselves, for example, the sorting unit may also be described as "a unit that sorts the at least one first message and the at least one second message to obtain a message sequence".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
According to one or more embodiments of the present disclosure, there is provided a message processing method including: in response to receiving a message reading request of a client, reading at least one first message from a first storage space and at least one second message from a second storage space; wherein, the message reading request comprises: a first request sent by the client in a periodic time and a second request triggered by the client based on a received message signaling, where the message signaling is used to send information that there is an inter-user message in the first storage space to the client; sequencing the at least one first message and the at least one second message to obtain a message sequence; and sending at least one target message in the message sequence to the client according to the sequence of the messages in the message sequence.
According to one or more embodiments of the present disclosure, the first message includes: a system global push message and/or an inter-user message, wherein the second message includes: the system directs push messages.
According to one or more embodiments of the present disclosure, in response to receiving the first request, which is triggered by the client receiving a message instruction in a long connection manner, the client sends the inter-user message to the client in a short connection manner, and in response to receiving the second request, the client sends the system global push message and/or the system directional push message to the client.
According to one or more embodiments of the present disclosure, the inter-user message, the system global push message, and the system directional push message are stored by: and responding to each parameter index included in a message sending request sent by a user and/or a system to meet a preset condition, determining that the message sent by the user and/or the system meets a message frequency control requirement, and selectively storing the message sent by the user and/or the system.
According to one or more embodiments of the present disclosure, the selectively storing the message sent by the user and/or the system includes: responding to the message sent by the user and/or the system as the inter-user message, and storing the message in the first storage space according to a first preset storage format; and responding to the message sent by the user and/or the system as the system global push message, and storing the message in the first storage space according to a second preset storage format. Responding to the message sent by the user and/or the system as the system directional push message, sending the system directional push message to an application processing end according to a message sending request with a preset standard format, and calculating whether to send the message to the client in real time when waiting for the target user to log in the client.
According to one or more embodiments of the present disclosure, it is determined whether the message sent by the user and/or the system satisfies the message frequency control requirement by: in response to storing at least one message in the first memory space and/or the second memory space, determining a first number of history messages received in the first memory space and/or the second memory space; in response to the first number being smaller than a first predetermined threshold, obtaining each history message pre-stored in the first storage space and/or the second storage space and determining the type of the message sent by the user and/or the system; determining a second number of history messages of the same type as the history messages in the history messages; and in response to the second number being less than a second predetermined threshold, determining that the message satisfies the message frequency control requirement.
According to one or more embodiments of the present disclosure, the system directs the push message to determine whether to send to the client by: responding to the detected target user logging in the client, and sending a third request to the application processing terminal; wherein, the third request is used for determining whether a system-oriented message exists in a second storage space in the application processing terminal; responding to the application processing terminal receiving the third request, and indicating each message processing terminal in the application processing terminals to calculate whether a message to be sent to the client exists in at least one system directional push message sent by the corresponding application in real time; in response to determining that the at least one system-directed push message to be sent to the client is present, storing the at least one system-directed push message to the second storage space; and reading the directional push information of each system from the second storage space as the second message.
According to one or more embodiments of the present disclosure, each application sends at least one system-oriented push message to the application processing end through the message sending request in the predetermined canonical format; and responding to the end of real-time calculation of each message processing terminal in the application processing terminals, and sending a message request response with a preset response format corresponding to each system directional push message in the at least one system directional push message to the corresponding application.
According to one or more embodiments of the present disclosure, there is provided a message processing apparatus including: a reading unit configured to read at least one first message from a first storage space and at least one second message from a second storage space in response to receiving a message reading request of a client; wherein, the message reading request comprises: a first request sent by the client in a periodic time and a second request triggered by the client based on a received message signaling, where the message signaling is used to send information that there is an inter-user message in the first storage space to the client; a sorting unit configured to sort the at least one first message and the at least one second message to obtain a message sequence; and the sending unit is configured to send at least one target message in the message sequence to the client according to the sequence of the messages in the message sequence.
According to one or more embodiments of the present disclosure, the first message includes: a system global push message and/or an inter-user message, wherein the second message includes: the system directs push messages.
According to one or more embodiments of the present disclosure, in response to receiving the first request, which is triggered by the client receiving a message instruction in a long connection manner, the client sends the inter-user message to the client in a short connection manner, and in response to receiving the second request, the client sends the system global push message and/or the system directional push message to the client.
According to one or more embodiments of the present disclosure, in response to each parameter index included in a message sending request sent by a user and/or a system meeting a predetermined condition, and determining that a message sent by the user and/or the system meets a message frequency control requirement, the message sent by the user and/or the system is selectively stored.
According to one or more embodiments of the present disclosure, the message processing apparatus further includes: a storage device (not shown). Wherein the storage device may be configured to: responding to the message sent by the user and/or the system as the inter-user message, and storing the message in the first storage space according to a first preset storage format; and responding to the message sent by the user and/or the system as the system global push message, and storing the message in the first storage space according to a second preset storage format. Responding to the message sent by the user and/or the system as the system directional push message, sending the system directional push message to an application processing end according to a message sending request with a preset standard format, and calculating whether to send the message to the client in real time when waiting for the target user to log in the client.
According to one or more embodiments of the present disclosure, it is determined whether the message sent by the user and/or the system satisfies the message frequency control requirement by: in response to storing at least one message in the first memory space and/or the second memory space, determining a first number of history messages received in the first memory space and/or the second memory space; in response to the first number being smaller than a first predetermined threshold, obtaining each history message pre-stored in the first storage space and/or the second storage space and determining the type of the message sent by the user and/or the system; determining a second number of history messages of the same type as the history messages in the history messages; and in response to the second number being less than a second predetermined threshold, determining that the message satisfies the message frequency control requirement.
According to one or more embodiments of the present disclosure, the system directs the push message to determine whether to send to the client by: responding to the detected target user logging in the client, and sending a third request to the application processing terminal; the third request is used for determining whether a system push direction message exists in a second storage space in the application processing terminal; responding to the application processing terminal receiving the third request, and indicating each message processing terminal in the application processing terminals to calculate whether a message to be sent to the client exists in at least one system directional push message sent by the corresponding application in real time; in response to determining that the at least one system-directed push message to be sent to the client is present, storing the at least one system-directed push message to the second storage space; and reading the directional push information of each system from the second storage space as the second message.
According to one or more embodiments of the present disclosure, each application sends at least one system-oriented push message to the application processing end through the message sending request in the predetermined canonical format; and responding to the end of real-time calculation of each message processing terminal in the application processing terminals, and sending a message request response with a preset response format corresponding to each system directional push message in the at least one system directional push message to the corresponding application.
According to one or more embodiments of the present disclosure, the message transmission request in the predetermined canonical format includes: the application identification corresponding to the application, the user identification corresponding to each system directional push message and the client identification of the target user are obtained; the message request response in the predetermined response format includes at least one of: the system directional push message sent to the client is normalized and the reason information of the system directional push message not sent to the client is identified by the error of the system directional push message not sent to the client.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.