Message sending method, device, electronic device and computer readable storage medium
By caching the message status on the server and resending the undisplayed messages, the problem of messages in the prior art cannot be reached is solved, and the 100% impression rate of messages on the client is achieved.
Patent Information
- Application Number
- CN202110125478.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-29
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2041-01-29
AI Technical Summary
In the prior art, the message sending method cannot guarantee the access of messages, especially when the client is busy or frequency control is controlled.
By cache the status of the message on the server, query and update the message status according to preset conditions, resend undisplayed messages until the client displays them.
Ensure that the message is displayed in the client, solving the problem that the message cannot reach.
Smart Images

Figure CN114816783B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of message processing, and in particular to a message sending method, device, electronic device and computer-readable storage medium. Background Art
[0002] With the continuous development of computer technology, digital information has been continuously improved and mobile terminal devices have been updated at an accelerated pace. Mobile terminal devices such as tablet computers, mobile phones, and e-readers have become widely popular. Today's mobile terminals are usually installed with a variety of client applications (APPs). The client can display text, pictures, videos, play audio and other multimedia information streams to users.
[0003] When the server wants to notify a user of something, it usually sends a message to the user's mobile client. However, each message has a specific display logic and display frequency control, which does not allow too many messages of the same type to be sent in a short period of time, so the user cannot be notified in all cases. Therefore, the message sending method in the prior art cannot guarantee the reach of the message. Summary of the invention
[0004] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0005] In order to solve the above technical problems, the embodiments of the present disclosure propose the following technical solutions.
[0006] In a first aspect, an embodiment of the present disclosure provides a message sending method, including:
[0007] Sending a first message to the client;
[0008] The state of recording the first message in the cache is a first state; wherein the first state indicates that the first message is not displayed in the client;
[0009] In response to detecting a preset condition, querying the cache for a status of the first message;
[0010] In response to finding that the state is the first state, the above steps are executed again.
[0011] In a second aspect, an embodiment of the present disclosure provides a message sending method, including:
[0012] Receiving a first message from a server;
[0013] Determine whether you meet the conditions for display;
[0014] If the display condition is met, display the first message;
[0015] A status message of the first message is sent to the server, wherein the status message indicates that the first message has been displayed in the client.
[0016] In a third aspect, an embodiment of the present disclosure provides a message sending device, including:
[0017] A first sending module, used for sending a first message to a client;
[0018] A recording module, configured to record in a cache that the state of the first message is a first state; wherein the first state indicates that the first message is not displayed in the client;
[0019] a query module, configured to query the state of the first message from the cache in response to detecting a preset condition;
[0020] A loop module is used for re-executing the above steps in response to finding that the state is the first state.
[0021] In a fourth aspect, an embodiment of the present disclosure provides a message sending device, including:
[0022] A first receiving module, used to receive a first message from a server;
[0023] A determination module, used to determine whether the display conditions are met;
[0024] A display module, configured to display the first message if a display condition is met;
[0025] The second sending module is used to send a status message of the first message to the server, wherein the status message indicates that the first message has been displayed in the client.
[0026] In a fifth aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor; and
[0027] A memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any of the methods described in the first and second aspects above.
[0028] In a sixth aspect, an embodiment of the present disclosure provides a non-transitory computer-readable storage medium, characterized in that the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute any of the methods described in the first and second aspects above.
[0029] The embodiments of the present disclosure disclose a message sending method, device, electronic device and computer-readable storage medium. The message sending method includes: sending a first message to a client; recording the state of the first message in a cache as a first state; wherein the first state indicates that the first message is not displayed in the client; in response to detecting a preset condition, querying the state of the first message from the cache; in response to querying that the state is the first state, re-executing the above steps. The above method solves the technical problem of not being able to ensure message reach by recording the state of the first message that has been sent and determining the message sending strategy based on the state.
[0030] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the following preferred embodiments are specifically cited and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0032] Figure 1 A flowchart of a message sending method provided by an embodiment of the present disclosure;
[0033] Figure 2 A flowchart of another message sending method provided by an embodiment of the present disclosure;
[0034] Figure 3 A schematic diagram of an application scenario of the message sending method provided in an embodiment of the present disclosure;
[0035] Figure 4 A schematic diagram of the structure of an embodiment of a message sending device provided in an embodiment of the present disclosure;
[0036] Figure 5 A schematic diagram of the structure of another embodiment of a message sending device provided by an embodiment of the present disclosure;
[0037] Figure 6 The present invention is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0038] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0039] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0040] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0041] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0042] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0043] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0044] Figure 1 This is a flowchart of a message sending method embodiment provided by the present disclosure. The message sending method provided by this embodiment can be executed by a message sending device. The message sending device can be implemented as software, or as a combination of software and hardware. The message sending device can be integrated in a device in a message sending system, such as a message sending server. Figure 1 As shown, the method is executed by the server, and the method includes the following steps:
[0045] Step S101, sending a first message to a client;
[0046] In this step, the server obtains a first message to be sent, and determines a target client for sending the first message.
[0047] The server generates different types of messages according to different scenarios, such as a system push message. If the push message is a broadcast message, the target client of the push message is all clients connected to the server. If the push message is a multicast message, the message carries a multicast flag, which corresponds to a client set, and the push message will be sent to each client in the client set. Or the message is a message sent from a first client to a second client. If the message is an offline message, the message will be sent to the cache of the second client, and the message will be pulled from the cache after the second client comes online; if the message is an instant message, the message will be sent to the second client immediately. The present disclosure does not limit the type of message, and any message can be sent using the message sending method described in the present disclosure.
[0048] After obtaining the first message to be sent and the target client, the server sends the message to the client.
[0049] Return to attachment Figure 1 , the message sending method further includes:
[0050] Step S102, recording the state of the first message in the cache as a first state;
[0051] In the present disclosure, the server includes a cache for storing the status of the first message that has been sent. The first status indicates that the first message has not been displayed in the client. That is, although the client has received the first message, the first message has not yet been displayed in the client. There are many reasons for not displaying, such as the client has frequency control over certain types of messages, such as only displaying a pushed message once within 5 minutes; or the client is displaying real-time streaming media content, and push messages are not allowed to be displayed at this time. In this way, although the client has received the first message, it cannot be displayed, and the server cannot determine whether the client has displayed the first message.
[0052] Optionally, if the first message is sent to the client for the first time, there is no state record of the first message in the cache, and the state of the first message is first established in the cache. Exemplarily, the state of the first message includes the ID of the first message and the state value of the first message. In this step, the state value of the first message corresponds to the first state.
[0053] Optionally, the first message is cached in the cache, that is, after the first message is generated, the first message is stored in the cache, and when the first message is sent by the server to the client, state information is added to the first message to record the state of the first message. Since the server cannot determine whether the client has displayed the first message, the server records the state of the first message as the first state, that is, the first message has not been displayed in the client.
[0054] Return to attachment Figure 1 , the message sending method further includes:
[0055] Step S103: in response to detecting a preset condition, querying the status of the first message from the cache.
[0056] The preset condition can be set according to different types of first messages, and different types of first messages correspond to different preset conditions. In this case, the step can obtain the preset condition corresponding to the type of the first message according to the type of the first message.
[0057] The preset condition may be a preset event occurring or a preset time reaching, such as the preset condition being a timer timeout. When the preset condition is detected, such as a counter timeout, the state of the first message is queried from the cache. At this time, the state of the first message may be the first state or may not be the first state. If the client has not yet displayed the first message, the state of the first message in the cache is still the first state. If the client has already displayed the first message, the state of the first message in the cache is the second state.
[0058] The state of the first message queried after the preset condition is detected determines a strategy for subsequently sending the first message.
[0059] Return to attachment Figure 1 , the message sending method further includes:
[0060] Step S104: in response to finding that the state is the first state, re-execute the above steps.
[0061] In this step, when the state of the first message is found to be the first state, it means that the first message has not been displayed by the client, and the first message needs to be resent. The process of resending the first message is the same as the steps S101 to S104, that is, the first message is sent to the client, and then the state of the first message is recorded as the first state. When the preset condition is detected again, the state of the first message is queried again, and then the above step S104 is continued. If the state is still the first state, the steps S101 to S104 are continued to be executed in a loop.
[0062] Thus, the server can determine whether the first message that has been sent to the client has been displayed by the client through the status of the first message recorded in the cache, so as to determine whether to resend the first message.
[0063] Furthermore, the message sending method further includes:
[0064] Step S105, in response to finding that the state is the second state, ending the sending process of the first message; wherein the second state indicates that the first message has been displayed in the client.
[0065] In this step, if the queried state is the second state, the sending process of the first message ends. At this time, the server can know that the client has displayed the first message, thereby ensuring 100% reach of the first message.
[0066] Optionally, after the above step S103, the method further includes:
[0067] The state of the first message in the cache is deleted.
[0068] In this optional embodiment, the status of the first message is deleted each time the status of the first message is queried. If the status of the first message is the first status, since the first message needs to be resent, the status of the first message can be re-recorded in the cache by executing step S102 next time; if the status of the first message is the second status, since the first message does not need to be resent, the cache space occupied by the first message can be released through the step.
[0069] Optionally, after the above step S102, the method further includes:
[0070] Step S106: receiving a status message sent by the receiving end, wherein the status message is used to modify the status of the first message from a first status to a second status.
[0071] Optionally, after displaying the first message, the receiving end generates and sends a status message of the first message to the server, and the server modifies the status of the first message in the cache from the first state to the second state according to the status message. Optionally, the server receives the status message through a preset API (Application Programming Interface), and the status message includes the ID of the first message and the value representing the second state. The API finds the first message in the cache through the ID of the first message, and then replaces the status value in the status of the first message with the value of the second state.
[0072] Optionally, after step S102, the method further includes: starting a timer for the first message, wherein the timeout period of the timer is the time interval (the inverse of the display frequency) or a preset time period for the client to display the first message.
[0073] In addition, in order to avoid the first message being resent all the time, if the client fails or the client is always busy and cannot display the first message, the life cycle of the first message can also be set. If the life cycle of the first message exceeds the life cycle, the first message is deleted and no longer sent. In this case, in step S104, in response to the query that the state is the first state, the life cycle of the first message is first queried. If the life cycle exceeds the life cycle, the first message is stopped from being sent and deleted. If the life cycle does not exceed the life cycle, the above steps are re-executed.
[0074] Figure 2 This is a flowchart of another message sending method embodiment provided by the embodiment of the present disclosure. The message sending method provided by this embodiment can be executed by a message sending device. The message sending device can be implemented as software, or as a combination of software and hardware. The message sending device can be integrated in a device in the message sending system, such as a message sending terminal device. Figure 2 As shown, the method is executed by the client, and the method includes the following steps:
[0075] Step S201, receiving a first message from a server.
[0076] The first message is the first message sent from the server in step S101, which will not be described in detail here.
[0077] Step S202, determining whether the display condition is met.
[0078] The first message needs to be displayed in the client, and after receiving the first message, the client needs to determine whether the first message meets the display condition. The display condition varies according to the type of message. For example, a push message has a display frequency. If the current time does not meet the display frequency requirement, the display condition is not met. If the client state is also one of the display conditions, such as the client is in a state of playing a certain type of streaming media, the client does not display the received push message.
[0079] Step S203: if the display conditions are met, display the first message.
[0080] Optionally, the display condition includes: the time since the last display of the first message exceeds a preset time threshold or the client is not in a state of blocking the first message. For example, if the control logic of the first message in the client is to display it every 5 minutes, then if the time since the last display of the first message by the client exceeds 5 minutes, the display condition is met. It can be understood that the first message is a general term for a type of message, that is, the last displayed first message and the current first message are the same type of message. Among them, the client is not in a state of blocking the first message. For example, when the client is in a state of playing a live video, push messages will be blocked. The fact that the client is not in a state of blocking the first message indicates that the client is not in a state of playing a live video. If the display condition is met, the client displays the first message.
[0081] Step S204: Send a status message of the first message to the server.
[0082] The status message indicates that the first message has been displayed in the client.
[0083] After displaying the first message, the client generates a status message of the first message; the status message includes the ID of the first message and a value representing the second state, such as using 0 to represent the first state and using 1 to represent the second state.
[0084] Optionally, sending the status message of the first message to the server includes: sending the status message of the first message to a preset API, wherein the API is set on the server, and is used to receive the status message of the first message and modify the status of the first message in the server cache according to the ID of the first message in the status message and the value of the second status.
[0085] Furthermore, the method further comprises:
[0086] If the display condition is not met, the first message is discarded.
[0087] In this step, if it is determined in step S202 that the client does not meet the display condition, the client directly discards the first message.
[0088] Thus, the client can update the status of the first message in the server cache through the status message, so that the server can obtain the display status of the first message in the client to further determine whether the first message needs to be resent. Thus, it can be ensured that the first message is displayed in the client.
[0089] In the technical solution of the above embodiment, the server sends the first message and records the status of the first message on the server. After the client receives and displays the first message, the client sends a status message to update the status of the first message recorded in the server, so that the server can stop resending the first message. Therefore, since the server will repeatedly send the first message to the client until the client displays the first message when the client does not display the first message, it can be ensured that the first message is displayed in the client.
[0090] Figure 3 FIG. 1 is a schematic diagram of an application scenario of the message sending method in the embodiment of the present disclosure. Figure 3 As shown, the server obtains the message to be sent from the message queue MQ; sends the message to the mobile client, and records the message sent this time in the Redis (REmote DIctionary Server) cache, and records the status of the message as having been sent, which means that the message has been sent to the mobile client, but has not yet been displayed in the mobile client; after waiting for 5 minutes, the server queries the status of the message in the Redis cache, and if it has still been sent, it returns to the step of obtaining the message to be sent in MQ and resends the message; after receiving the message, the client first determines whether the message can be displayed, and if it cannot be displayed, the message is directly discarded; if it can be displayed, the message is displayed in the mobile client, and the API is notified that the message has been displayed, at which time the API changes the status of the message in the Redis cache to displayed. If the query result of the server querying the status of the message in the Redis cache is displayed, the message sending process ends.
[0091] The disclosed embodiment discloses a message sending method, which includes: sending a first message to a client; recording the state of the first message in a cache as a first state; wherein the first state indicates that the first message is not displayed in the client; in response to detecting a preset condition, querying the state of the first message from the cache; in response to querying that the state is the first state, re-executing the above steps. The above method solves the technical problem of being unable to ensure message reach by recording the state of the first message that has been sent and determining the message sending strategy based on the state.
[0092] In the above, although the various steps in the above method embodiment are described in the above order, those skilled in the art should be aware that the steps in the embodiments of the present disclosure are not necessarily executed in the above order, and they may also be executed in other orders such as reverse order, parallel order, and cross order. Moreover, on the basis of the above steps, those skilled in the art may also add other steps. These obvious variations or equivalent replacement methods should also be included in the protection scope of the present disclosure and will not be repeated here.
[0093] Figure 4 This is a schematic diagram of the structure of an embodiment of a message sending device provided in an embodiment of the present disclosure. Figure 4 As shown, the device 400 includes: a first sending module 401, a recording module 402, a query module 403 and a circulation module 404.
[0094] A first sending module 401, configured to send a first message to a client;
[0095] A recording module 402, configured to record in a cache that the state of the first message is a first state; wherein the first state indicates that the first message is not displayed in the client;
[0096] A query module 403, configured to query the state of the first message from the cache in response to detecting a preset condition;
[0097] The loop module 404 is used for re-executing the above steps in response to finding that the state is the first state.
[0098] Furthermore, the message sending device 400 further includes:
[0099] The ending module is used to end the sending process of the first message in response to finding that the state is the second state; wherein the second state indicates that the first message has been displayed in the client.
[0100] Furthermore, the message sending device 400 further includes:
[0101] A deleting module is used to delete the state of the first message in the cache.
[0102] Furthermore, the message sending device 400 further includes:
[0103] The status message receiving module is used to receive a status message sent by the receiving end, where the status message is used to modify the status of the first message from a first state to a second state.
[0104] Furthermore, the preset condition is timer expiration.
[0105] Figure 4 The device shown can perform Figure 1 For the method of the embodiment shown in the figure, the part not described in detail in this embodiment can be referred to Figure 1 The implementation process and technical effects of this technical solution refer to Figure 1 The description in the illustrated embodiment will not be repeated here.
[0106] Figure 5 This is a schematic diagram of the structure of a message sending device embodiment provided by another embodiment of the present disclosure. Figure 5 As shown, the device 500 includes: a first receiving module 501, a determining module 502, a display module 503, and a second sending module 504.
[0107] A first receiving module 501, configured to receive a first message from a server;
[0108] Determination module 502, used to determine whether the display condition is met;
[0109] A display module 503, configured to display the first message if a display condition is met;
[0110] The second sending module 504 is configured to send a status message of the first message to the server, wherein the status message indicates that the first message has been displayed in the client.
[0111] Furthermore, the device 500 further includes:
[0112] The discarding module is used to discard the first message if the display condition is not met.
[0113] Furthermore, the conditions for meeting the display conditions include:
[0114] The time from the last display of the first message exceeds a preset time threshold or the client is not in a state of blocking the first message.
[0115] Figure 5 The device shown can perform Figure 2For the method of the embodiment shown in the figure, the part not described in detail in this embodiment can be referred to Figure 2 The implementation process and technical effects of this technical solution refer to Figure 2 The description in the illustrated embodiment will not be repeated here.
[0116] Reference below Figure 6 , which shows a schematic diagram of the structure of an electronic device 600 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0117] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0118] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0119] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0120] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0121] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0122] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0123] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method in the above embodiment.
[0124] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving 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 may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0125] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0126] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, constitute a limitation on the unit itself.
[0127] The functions described above herein 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 chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0128] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0129] According to one or more embodiments of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any one of the message sending methods described in the first aspect above.
[0130] According to one or more embodiments of the present disclosure, a non-transitory computer-readable storage medium is provided, characterized in that the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute any message sending method described in the first aspect.
[0131] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
Claims
1. A message sending method, executed by a server, characterized in that: include: Sending a first message to the client; Recording the state of the first message in the cache as a first state; When receiving a status message sent by the client, modifying the status of the first message from a first status to a second status; wherein the first status indicates that the first message is not displayed in the client; In response to detecting a preset condition, querying the cache for a status of the first message; In response to finding that the state is the first state, re-sending the first message to the client; recording the state of the first message as the first state in the cache; upon receiving a state message sent by the client, changing the state of the first message from the first state to the second state; wherein the first state indicates that the first message is not displayed in the client; in response to detecting a preset condition, querying the state of the first message from the cache; in response to finding that the state is the second state, ending the sending process of the first message; wherein the second state indicates that the first message has been displayed in the client; The method further includes: deleting the state of the first message in the cache.
2. The message sending method according to claim 1, characterized in that: The preset condition is timeout of the timer.
3. A message sending method, executed by a client, characterized in that: include: Receiving a first message from a server; Determine whether you meet the conditions for display; If the display condition is met, display the first message; Sending a status message of a first message to the server, wherein the status message indicates that the first message has been displayed in the client, the server is used to send the first message to the client; recording the status of the first message in the cache as the first status; upon receiving the status message sent by the client, changing the status of the first message from the first status to the second status; wherein the first status indicates that the first message is not displayed in the client; in response to detecting a preset condition, querying the status of the first message from the cache; in response to querying that the status is the first status, re-executing sending the first message to the client; recording the status of the first message in the cache as the first status; upon receiving the status message sent by the client, changing the status of the first message from the first status to the second status; wherein the first status indicates that the first message is not displayed in the client; in response to detecting a preset condition, querying the status of the first message from the cache; in response to querying that the status is the second status, ending the sending process of the first message; wherein the second status indicates that the first message has been displayed in the client; deleting the status of the first message in the cache.
4. The message sending method according to claim 3, characterized in that: The method further comprises: If the display condition is not met, the first message is discarded.
5. The message sending method according to claim 3, characterized in that: The conditions for display include: The time from the last display of the first message exceeds a preset time threshold or the client is not in a state of blocking the first message.
6. A message sending device, characterized in that: include: A first sending module, used for sending a first message to a client; A recording module, configured to record in a cache the state of the first message as a first state; When receiving a status message sent by the client, modifying the status of the first message from a first status to a second status; wherein the first status indicates that the first message is not displayed in the client; a query module, configured to query the state of the first message from the cache in response to detecting a preset condition; A loop module, configured to, in response to finding that the state is the first state, resend the first message to the client; record the state of the first message as the first state in the cache; upon receiving a state message sent by the client, change the state of the first message from the first state to the second state; wherein the first state indicates that the first message is not displayed in the client; in response to detecting a preset condition, query the state of the first message from the cache; in response to finding that the state is the second state, terminate the sending process of the first message; wherein the second state indicates that the first message has been displayed in the client; The query module is further configured to delete the state of the first message in the cache.
7. A message sending device, characterized in that: include: A first receiving module, used to receive a first message from a server; A determination module, used to determine whether the display conditions are met; A display module, configured to display the first message if a display condition is met; a second sending module, configured to send a status message of the first message to the server, wherein the status message indicates that the first message has been displayed in the client, and the server is configured to send the first message to the client; record the status of the first message in the cache as the first status; upon receiving the status message sent by the client, modify the status of the first message from the first status to the second status; wherein the first status indicates that the first message is not displayed in the client; in response to detecting a preset condition, query the status of the first message from the cache; in response to querying that the status is the first status, re-execute sending the first message to the client; record the status of the first message in the cache as the first status; upon receiving the status message sent by the client, modify the status of the first message from the first status to the second status; wherein the first status indicates that the first message is not displayed in the client; in response to detecting a preset condition, query the status of the first message from the cache; in response to querying that the status is the second status, terminate the sending process of the first message; wherein the second status indicates that the first message has been displayed in the client; and delete the status of the first message in the cache.
8. An electronic device comprising: a memory for storing computer readable instructions; as well as A processor, configured to execute the computer-readable instructions, so that the processor implements the method according to any one of claims 1 to 5 when executed.
9. A non-transitory computer-readable storage medium, used for storing computer-readable instructions, when the computer-readable instructions are executed by a computer, the computer is caused to execute the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method and apparatus for displaying game role state
CN101024124A
Message status display method and device
CN103731334A