Message display method and device, electronic equipment and storage medium

By generating message retrieval requests and optimizing the push and display of alarm information by combining message cache queue status, the problems of resource waste and server pressure in video surveillance scenarios are solved, and efficient message retrieval and display are achieved.

CN120881037APending Publication Date: 2025-10-31深圳市天视通科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511065261.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-31
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

In video surveillance scenarios, when the number of alarm messages is large, it leads to resource shortages and a surge in server pressure. Existing technologies cannot effectively optimize the push of alarm messages, resulting in resource waste and server pressure.

Method used

By generating a message retrieval request and sending a request to the server in conjunction with the cache status of the message cache queue, the target push message is retrieved and stored, and the message is displayed after the retrieval instruction is received, thus optimizing the message retrieval and display process.

Benefits of technology

This reduces server load, avoids resource waste, ensures that all retrieved messages are processed, and improves resource utilization efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120881037A_ABST
    Figure CN120881037A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a message display method and device, electronic equipment and a storage medium, and belongs to the technical field of message pushing. The method comprises the following steps: in response to a message acquisition instruction, generating a message acquisition request according to the message acquisition instruction and a preset message cache queue; sending a request to a preset server according to the message acquisition request, so that the server performs request processing according to the message acquisition request to obtain a plurality of target push messages; storing each target push message into a message cache queue; performing message acquisition on the message cache queue according to the message acquisition instruction to obtain a target display message; and performing message display according to the target display message. According to the embodiment of the invention, pushing of the alarm information can be optimized, and unnecessary resource waste and server pressure are avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of message push technology, and in particular to a message display method and device, electronic device and storage medium. Background Technology

[0002] In video surveillance scenarios, users' mobile devices connect to the video monitoring system via a network. When the video monitoring system detects a predetermined event, it issues an alarm message, which is then sent to the user's mobile device via the network. In some scenarios, the number of alarm messages is enormous. Sending all of them to the mobile device would cause resource strain and waste. For example, users might not view the alarm messages, leading to wasted network and memory resources. Alternatively, a sudden surge of alarm messages at certain times could cause a spike in server load. Therefore, optimizing alarm message delivery to avoid unnecessary resource waste and server stress has become a pressing issue. Summary of the Invention

[0003] The main objective of this application is to provide a message display method, device, electronic device, and storage medium, which aims to optimize the push of alarm information and avoid unnecessary resource waste and server pressure.

[0004] To achieve the above objectives, a first aspect of this application proposes a message display method, the method comprising:

[0005] In response to a message retrieval command, a message retrieval request is generated based on the message retrieval command and a preset message cache queue;

[0006] The message retrieval request is sent to a preset server so that the server processes the request and obtains multiple target push messages.

[0007] Each of the target push messages is stored in the message cache queue;

[0008] The message is retrieved from the message cache queue according to the message retrieval instruction to obtain the target display message;

[0009] The message is displayed according to the target message.

[0010] In some embodiments, the message cache queue includes multiple message cache blocks, each message cache block having a start timestamp; the message retrieval instruction includes a current timestamp; generating a message retrieval request based on the message retrieval instruction and a preset message cache queue includes:

[0011] The target timestamp is obtained by filtering each of the starting timestamps based on the current timestamp; wherein the target timestamp is less than the current timestamp, and the difference between the target timestamp and the current timestamp is minimized.

[0012] The message retrieval request is obtained by encapsulating the target timestamp, the current timestamp, and the preset message retrieval quantity.

[0013] In some embodiments, the step of processing the request based on the message acquisition request to obtain multiple target push messages includes:

[0014] The number of messages to be pushed is obtained by querying the preset database based on the current timestamp and the target timestamp.

[0015] If the number of messages to be pushed is greater than the preset number of messages to be acquired, a message lookup table is performed in the database based on the current timestamp and the preset number of messages to be acquired to obtain multiple target push messages;

[0016] If the number of messages to be pushed is less than or equal to the preset number of messages to be obtained, the database is searched according to the current timestamp and the target timestamp to obtain multiple target push messages.

[0017] In some embodiments, storing each of the target push messages into the message cache queue includes:

[0018] If the total number of all target push messages is equal to the preset message acquisition number, a message cache block is constructed for each target push message to obtain a cache block;

[0019] The block to be cached is stored in the message cache queue.

[0020] In some embodiments, storing each of the target push messages into the message cache queue includes:

[0021] If the total number of all the target push messages is less than the preset message acquisition number, obtain the timestamp of the target push message with the smallest value to obtain the first timestamp;

[0022] The message cache queue is filtered according to the first timestamp to obtain cache blocks to be merged; wherein the first timestamp is greater than the start timestamp of the cache block to be merged, and the difference between the first timestamp and the cache block to be merged is the smallest among the differences between the first timestamp and the start timestamp of each message cache block.

[0023] The target push messages are merged with the cache block to be merged to obtain the cache block;

[0024] Remove the cache block to be merged from the message cache queue and store the cache block into the message cache queue.

[0025] In some embodiments, retrieving messages from the message cache queue according to the message retrieval instruction to obtain the target display message includes:

[0026] Each message cache block is filtered according to the current timestamp to obtain a target cache block; wherein, the start timestamp of the target cache block is less than the current timestamp, and the difference between the start timestamp of the target cache block and the current timestamp is the smallest among the start timestamps of all message cache blocks.

[0027] The target cache block is used to retrieve messages according to the preset message retrieval quantity to obtain the target display message.

[0028] In some embodiments, each of the message cache blocks has an end timestamp; the method further includes:

[0029] In response to a message deletion command, obtain the message to be deleted from the message deletion command;

[0030] Retrieve the cache block to be updated corresponding to the message to be deleted from the message cache queue;

[0031] Delete the message to be deleted from the cache block to be updated to obtain the updated cache block;

[0032] If the number of messages in the updated cache block is less than the preset message acquisition quantity, each message cache block is filtered according to the updated cache block to obtain the next cache block. The next cache block and the updated cache block are merged to obtain a merged cache block. The cache block to be updated and the next cache block are deleted from the message cache queue, and the merged cache block is stored in the message cache queue. Wherein, the start timestamp of the next cache block is less than the end timestamp of the cache block to be updated, and the difference between the start timestamp of the next cache block and the end timestamp of the updated cache block is the smallest among the start timestamps of all message cache blocks.

[0033] If the number of messages in the updated cache block is greater than or equal to the preset number of messages retrieved, the cache block to be updated is deleted from the message cache queue, and the updated cache block is stored in the message cache queue.

[0034] To achieve the above objectives, a second aspect of this application provides a message display device, the device comprising:

[0035] The request generation module is used to generate a message retrieval request in response to a message retrieval instruction, based on the message retrieval instruction and a preset message cache queue.

[0036] The request sending module is used to send a request to a preset server according to the message acquisition request, so that the server processes the request according to the message acquisition request and obtains multiple target push messages;

[0037] The message storage module is used to store each of the target push messages into the message cache queue;

[0038] The message acquisition module is used to acquire messages from the message cache queue according to the message acquisition instruction, and obtain the target display message;

[0039] The message display module is used to display messages according to the target message.

[0040] To achieve the above objectives, a third aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect.

[0041] To achieve the above objectives, a fourth aspect of the present application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect.

[0042] This application proposes a message display method, apparatus, electronic device, and storage medium, which generates a message retrieval request based on a message retrieval instruction and a preset message cache queue; sends a request to a preset server based on the message retrieval request, so that the server processes the request and obtains multiple target push messages; stores each target push message in the message cache queue; retrieves messages from the message cache queue according to the message retrieval instruction to obtain target display messages; and displays the messages based on the target display messages. Thus, this application's embodiments optimize message retrieval and message display by optimizing the message cache queue. First, after obtaining the message retrieval instruction, a message retrieval request is sent to the server based on the cache state of the message cache queue, enabling the server to retrieve the messages to be pushed based on the cache state of the message queue, obtaining the target push messages, avoiding the situation where all messages are pushed to the message cache queue at once, thereby reducing the server's load. On the other hand, since message retrieval is performed only after the message retrieval instruction, it ensures that all retrieved messages are processed, avoiding the situation where messages are sent to the message cache queue but not processed, reducing resource consumption. Finally, the obtained target push messages are stored in the message cache queue, and the target display messages are retrieved from the message cache queue according to the message retrieval instruction, and the target display messages are displayed. Attached Figure Description

[0043] Figure 1 This is a flowchart of the message display method provided in the embodiments of this application;

[0044] Figure 2 yes Figure 1 The flowchart of step S101 in the text;

[0045] Figure 3 yes Figure 1 The flowchart of step S102 in the document;

[0046] Figure 4 yes Figure 1 The flowchart of step S103 in the process;

[0047] Figure 5 yes Figure 1 The flowchart of step S103 in the process;

[0048] Figure 6 yes Figure 1 The flowchart of step S104 in the process;

[0049] Figure 7 This is a flowchart of a message display method provided in another embodiment of this application;

[0050] Figure 8 This is a schematic diagram of the structure of the message display device provided in the embodiments of this application;

[0051] Figure 9 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application;

[0052] Figure 10 This is a schematic diagram of the message cache queue provided in an embodiment of this application;

[0053] Figure 11 This is another schematic diagram of a message cache queue provided in an embodiment of this application. Detailed Implementation

[0054] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0055] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0057] In video surveillance scenarios, users' mobile devices connect to the video monitoring system via a network. When the video monitoring system detects a predetermined event, it issues an alarm message, which is then sent to the user's mobile device via the network. In some scenarios, the number of alarm messages is enormous. Sending all of them to the mobile device would cause resource strain and waste. For example, users might not view the alarm messages, leading to wasted network and memory resources. Alternatively, a sudden surge of alarm messages at certain times could cause a spike in server load. Therefore, optimizing alarm message delivery to avoid unnecessary resource waste and server stress has become a pressing issue.

[0058] Based on this, embodiments of this application provide a message display method and apparatus, electronic device and storage medium, which aim to optimize the push of alarm information and avoid unnecessary resource waste and server pressure.

[0059] This application provides a message display method, apparatus, electronic device, and storage medium, which are specifically described through the following embodiments. First, the message display method in this application is described.

[0060] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0061] Foundational technologies in artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0062] The message display method provided in this application relates to the field of message push technology. The message display method provided in this application can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application implementing the message display method, but is not limited to the above forms.

[0063] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0064] It should be noted that in all specific embodiments of this application, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent is obtained first. Furthermore, the collection, use, and processing of this data comply with relevant laws, regulations, and standards. In addition, when embodiments of this application require access to sensitive personal information of users, separate permission or consent from the user is obtained through pop-ups or redirection to confirmation pages. Only after obtaining the user's separate permission or consent is the necessary user-related data required for the proper functioning of these embodiments acquired.

[0065] Figure 1 This is an optional flowchart of the message display method provided in the embodiments of this application. Figure 1 The method may include, but is not limited to, steps S101 to S105.

[0066] Step S101: In response to the message retrieval instruction, generate a message retrieval request based on the message retrieval instruction and the preset message cache queue;

[0067] Step S102: Send a request to a preset server according to the message retrieval request, so that the server processes the request according to the message retrieval request and obtains multiple target push messages;

[0068] Step S103: Store the push messages for each target into the message cache queue;

[0069] Step S104: Retrieve messages from the message cache queue according to the message retrieval instruction to obtain the target display message;

[0070] Step S105: Display the message according to the target message.

[0071] Steps S101 to S105 of this embodiment involve generating a message retrieval request based on a message retrieval instruction and a preset message cache queue; sending a request to a preset server based on the message retrieval request, so that the server processes the request and obtains multiple target push messages; storing each target push message in the message cache queue; retrieving messages from the message cache queue based on the message retrieval instruction to obtain target display messages; and displaying messages based on the target display messages. Thus, this embodiment optimizes message retrieval and message display by optimizing the message cache queue. First, after obtaining the message retrieval instruction, a message retrieval request is sent to the server based on the cache state of the message cache queue, enabling the server to retrieve the messages to be pushed based on the cache state of the message queue, obtaining the target push messages, avoiding the situation where all messages are pushed to the message cache queue at once, thereby reducing the server's load. On the other hand, since message retrieval is performed only after the message retrieval instruction, it ensures that all retrieved messages are processed, avoiding the situation where messages are sent to the message cache queue but not processed, thus reducing resource consumption. Finally, the obtained target push messages are stored in the message cache queue, and the target display messages are retrieved from the message cache queue according to the message retrieval instruction, and the target display messages are displayed.

[0072] like Figure 10 As shown, it should be noted that in this embodiment, the message cache queue includes multiple message cache blocks ordered in this order, and each message cache block contains a default number of messages, such as 10 messages. Each message cache block is arranged in chronological order. For example, the first message cache block may contain 10 messages from the time period from 14:14 to 15:14, the second message cache block may contain 10 messages from the time period from 16:16 to 17:00, and so on.

[0073] The message cache queue is stored on the user's terminal to cache messages. When a user views a message through the terminal, they first enter the message interface. If the current time matches the time in the message cache queue, then... Figure 10 As shown, if the current time is 17:00, no request will be sent to the preset server. This situation is triggered when a user enters the message interface, exits within one minute, and then enters again.

[0074] If the current time is greater than the maximum time of the message cache queue, for example, the current time is 17:05, while the maximum time of the largest message cache block in the message cache queue is 17:00, then there may be new messages that need to be received between 17:00 and 17:05, which will trigger the message retrieval instruction, that is, enter step S101. At this time, the current timestamp is 17:05.

[0075] Suppose a user starts browsing 10 messages at 17:00, which means they have finished browsing all the messages in the first message cache block in the message cache queue. Then, if the user continues to scroll down or triggers another message browsing operation in other ways, a message retrieval instruction will be triggered, which means entering step S101. At this time, the current timestamp is 16:16.

[0076] A message retrieval command refers to a user's operation on a mobile terminal. For example, swiping down on a browsing interface can be considered a message trigger command issued by the user to the mobile terminal.

[0077] Please see Figure 2 In some embodiments, the message cache queue includes multiple message cache blocks, each message cache block having a start timestamp; the message retrieval instruction includes the current timestamp; step S101 may include, but is not limited to, steps S201 to S202:

[0078] Step S201: Filter each starting timestamp according to the current timestamp to obtain the target timestamp; wherein, the target timestamp is less than the current timestamp, and the difference between the target timestamp and the current timestamp is the smallest;

[0079] Step S202: Encapsulate the message retrieval request based on the target timestamp, the current timestamp, and the preset message retrieval quantity.

[0080] Steps S201 to S202, as shown in the embodiments of this application, filter each starting timestamp according to the current timestamp to obtain the target timestamp, and then encapsulate the target timestamp, the current timestamp, and the preset message retrieval quantity to obtain a message retrieval request. This ensures that the messages subsequently retrieved from the server are not in the message cache queue, thereby accurately retrieving messages, reducing server pressure, and reducing resource waste.

[0081] In step S201 of some embodiments, such as Figure 10 As shown, assuming the current timestamp is 17:05, we filter the starting timestamps, namely 17:00 and 15:14, to obtain the timestamp closest to the current timestamp, namely 17:00, and thus obtain the target timestamp.

[0082] In step S202 of some embodiments, the message retrieval request is encapsulated by combining the target timestamp, the current timestamp, and the preset message retrieval quantity into a structure. Specifically, encapsulation into a structure is achieved by defining a structure that includes three parameters: the target timestamp, the current timestamp, and the preset message retrieval quantity. For example, the message retrieval request structure could be: {target timestamp = 17:00, current timestamp = 17:05, preset message retrieval quantity = 10}.

[0083] like Figure 10 As shown, for example, if a user starts browsing messages at 17:05, then the current timestamp is 17:05 and the target timestamp is 17:00.

[0084] For example, if a user scrolls through the messages from 17:00 to 16:16 and then continues to scroll to the next page, the current timestamp will be 16:16 and the target timestamp will be 15:14.

[0085] Please see Figure 3 In some embodiments, step S102 may include, but is not limited to, steps S301 to S303:

[0086] Step S301: Query the number of messages in the preset database based on the current timestamp and the target timestamp to obtain the number of messages to be pushed;

[0087] Step S302: If the number of messages to be pushed is greater than the preset number of messages to be acquired, perform a message lookup in the database based on the current timestamp and the preset number of messages to be acquired to obtain multiple target push messages;

[0088] Step S303: If the number of messages to be pushed is less than or equal to the preset number of messages to be obtained, perform a message lookup in the database based on the current timestamp and the target timestamp to obtain multiple target push messages.

[0089] In the embodiments of this application, steps S301 to S303 involve querying the number of messages in a preset database based on the current timestamp and the target timestamp to obtain the number of messages to be pushed. If the number of messages to be pushed is greater than the preset number of messages to be acquired, a message lookup table is performed in the database based on the current timestamp and the preset number of messages to be acquired to obtain multiple target push messages. If the number of messages to be pushed is less than or equal to the preset number of messages to be acquired, a message lookup table is performed in the database based on the current timestamp and the target timestamp to obtain multiple target push messages. This allows for precise control of the number of messages sent by the server, thereby reducing the server's load.

[0090] In step S301 of some embodiments, the message count query involves querying a preset database based on the current timestamp and the target timestamp to determine the number of messages to be pushed. This query operation calculates the time range between the current timestamp and the target timestamp and retrieves the number of messages in the database that meet the criteria for that time period. Specifically, the database filters relevant message records based on the timestamp range and returns the number of messages within that time period as the number of messages to be pushed.

[0091] In step S302 of some embodiments, the message lookup involves querying the database based on the current timestamp and a preset message acquisition count. If the number of messages to be pushed is greater than the preset message acquisition count, the database is retrieved for the N messages closest to the current timestamp, where N is the preset message acquisition count.

[0092] The reason for retrieving the N messages closest to the current timestamp is that each page on the user's terminal only displays N messages, where N is the preset number of messages to retrieve. When browsing messages, users may not scroll to the next page of the message list. Therefore, only the N messages near the current timestamp need to be pushed to the user, instead of pushing all eligible messages at once, reducing server load and avoiding potential resource waste.

[0093] like Figure 10 As shown, for example, if there are more than 10 messages between 17:05 and 17:00, then the 10 messages closest to 17:05 will be selected.

[0094] For example, if there are more than 10 messages between 16:16 and 15:14, then the 10 messages closest to 16:16 will be selected.

[0095] In step S303 of some embodiments, if the number of messages to be pushed is less than or equal to the preset number of messages to be acquired, the database will be queried and multiple target push messages will be selected based on the conditions of the current timestamp and the target timestamp.

[0096] like Figure 10 As shown, for example, if there are fewer or fewer than 10 messages between 17:05 and 17:00, then all messages between 17:05 and 17:00 will be returned to the user terminal.

[0097] Alternatively, if there are fewer or fewer than 10 messages between 16:16 and 15:14, then all messages between 16:16 and 15:14 will be returned to the user terminal.

[0098] Please see Figure 4 In some embodiments, step S103 may include, but is not limited to, steps S401 to S402:

[0099] Step S401: If the total number of all target push messages is equal to the preset message acquisition number, construct a message cache block for each target push message to obtain a cache block;

[0100] Step S402: Store the block to be cached into the message cache queue.

[0101] In steps S401 to S402 of the embodiments of this application, if the number of all target push messages is equal to the preset message acquisition number, a message cache block is constructed for each target push message to obtain a cache block to be cached, and the cache block to be cached is stored in the message cache queue, thereby ensuring that one cache block corresponds to one page of the user terminal, and the user terminal can refresh the new message list by accessing only one cache block, reducing the resource consumption of the user terminal.

[0102] In one embodiment of step S401 of some implementations, when the number of target push messages is equal to 10, these 10 target push messages are sorted according to their timestamps. Then, the sorted messages are constructed into a block to be cached, and the start and end timestamps of the block to be cached are marked. The start timestamp is the timestamp of the latest message in the block to be cached. The end timestamp is the timestamp of the oldest message in the block to be cached.

[0103] In step S402 of some embodiments, the message cache block is inserted into the message cache queue in chronological order according to the termination timestamp of the block to be cached.

[0104] Please see Figure 5 In some embodiments, step S103 includes, but is not limited to, steps S501 to S502:

[0105] Step S501: If the total number of all target push messages is less than the preset message acquisition number, obtain the timestamp of the smallest target push message to get the first timestamp;

[0106] Step S502: Filter the message cache queue according to the first timestamp to obtain the cache blocks to be merged; wherein, the first timestamp is greater than the start timestamp of the cache block to be merged, and the difference between the first timestamp and the cache block to be merged is the smallest among the differences between the first timestamp and the start timestamp of each message cache block.

[0107] Step S503: Merge the push messages of each target with the cache block to be merged to obtain the cache block to be merged;

[0108] Step S504: Remove the cache block to be merged from the message cache queue and store the cache block to be cached into the message cache queue.

[0109] In some embodiments, steps S501 to S504 are assumed to be triggered by a scenario where a user browses messages at 17:00, reads the 10 messages from 16:16, and then flips to the next page.

[0110] like Figure 10 As shown, the current timestamp is 16:16 and the target timestamp is 15:14.

[0111] If the target number of push messages is 3, which is less than the preset number of messages to be retrieved, then the message with the shortest time among these three messages will be retrieved, for example, 15:30.

[0112] Based on 15:30, find the closest cache block that is less than 15:30, which is the cache block from 14:14 to 15:14. In other words, the first timestamp is 15:14, and the cache block to be merged is the cache block from 14:14 to 15:14.

[0113] Then, these three messages are merged with the cache block to be merged. Assuming the three messages are 15:30, 15:35, and 15:50 respectively, the cache block to be merged is removed from the message cache queue and stored in the message cache queue. Then, as follows... Figure 11 As shown, a new message cache queue is obtained.

[0114] Steps S501 to S504 are used to merge messages, ensuring that when users browse messages on mobile terminals, they can read a page of messages by accessing only one cache block, thus saving resource consumption.

[0115] Please see Figure 6 In some embodiments, step S104 includes, but is not limited to, steps S601 to S602:

[0116] Step S601: Filter each message cache block according to the current timestamp to obtain the target cache block; wherein, the starting timestamp of the target cache block is less than the current timestamp, and the starting timestamp of the target cache block has the smallest difference between the starting timestamp of all message cache blocks and the current timestamp.

[0117] Step S602: Retrieve messages from the target cache block according to the preset message retrieval quantity to obtain the target display message.

[0118] like Figure 11 As shown, steps S601 to S602 in some embodiments, for example.

[0119] For example, if the current timestamp is 17:00, then the largest starting timestamp that is less than 17:00 will be retrieved, which is the cache block from 16:16 to 17:00.

[0120] For example, if the current timestamp is 15:55, then the largest timestamp less than 15:55 will be retrieved, which is 14; the cache block from 14 to 15:50.

[0121] After obtaining the cache block, the first 10 messages within it are retrieved. For example, the first 10 messages from the cache block from 14:14 to 15:50 are retrieved. When the user continues scrolling down, one possibility is that step S101 is triggered, or the cache block from a certain time to 14:14 is already cached in the message cache queue. In this case, the last 3 messages from 14:14 to 15:50 are retrieved, and 7 more messages are retrieved from the message cache queue, thus forming 10 messages, which are then displayed on the user's mobile terminal.

[0122] Please see Figure 7 In some embodiments, step S106 may include, but is not limited to, steps S701 to S705:

[0123] Step S701: In response to the message deletion command, obtain the message to be deleted from the message deletion command;

[0124] Step S702: Obtain the cache block to be updated corresponding to the message to be deleted from the message cache queue;

[0125] Step S703: Delete the messages to be deleted from the cache block to be updated to obtain the updated cache block;

[0126] Step S704: If the number of messages in the updated cache block is less than the preset message acquisition quantity, filter each message cache block according to the updated cache block to obtain the next cache block. Merge the next cache block and the updated cache block to obtain the merged cache block. Delete the cache block to be updated and the next cache block from the message cache queue and store the merged cache block in the message cache queue. The start timestamp of the next cache block is less than the end timestamp of the cache block to be updated, and the difference between the start timestamp of the next cache block and the end timestamp of the updated cache block is the smallest among all the start timestamps of the message cache blocks.

[0127] Step S705: If the number of messages in the updated cache block is greater than or equal to the preset number of messages retrieved, the cache block to be updated is deleted from the message cache queue, and the updated cache block is stored in the message cache queue.

[0128] In steps S701 to S705 of some embodiments, when a user deletes a message, that is, issues a message deletion command, the message to be deleted is obtained from the message deletion command, and then the cache block corresponding to the message to be deleted in the message cache queue is searched to obtain the cache block to be updated.

[0129] Then, delete the messages to be deleted from the cache block to be updated, and obtain the updated cache block.

[0130] If the number of messages in the updated cache block is less than the preset message retrieval count, for example, if a cache block contains 10 messages and deleting one message results in a count less than the preset message retrieval count of 10.

[0131] Then find the cache block following the one to be updated, such as... Figure 11 As shown, if a message in the cache block from 16:16 to 17:00 is deleted, the number of messages retrieved is less than the preset message count of 10. The cache block from 14:14 to 15:50 is then searched for. The remaining 9 messages from 16:16 to 17:00 are then merged with the cache block from 14:14 to 15:50.

[0132] Then delete the original two cache blocks from 14:14 to 15:50 and from 16:16 to 17:00.

[0133] The remaining 9 messages from 16:16 to 17:00 and the cache block from 14:14 to 15:50 are merged to form a cache block that is stored in the message cache queue in chronological order.

[0134] Please see Figure 8 This application also provides a message display device that can implement the above-described message display method. The device includes:

[0135] The request generation module 801 is used to generate a message retrieval request in response to a message retrieval command, based on the message retrieval command and a preset message cache queue.

[0136] The request sending module 802 is used to send a request to a preset server according to the message retrieval request, so that the server processes the request according to the message retrieval request and obtains multiple target push messages;

[0137] The message storage module 803 is used to store push messages from various targets into a message cache queue.

[0138] The message retrieval module 804 is used to retrieve messages from the message cache queue according to the message retrieval instruction and obtain the target display message;

[0139] The message display module 805 is used to display messages based on the target message.

[0140] The specific implementation of this message display device is basically the same as the specific embodiment of the message display method described above, and will not be repeated here.

[0141] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the aforementioned message display method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.

[0142] Please see Figure 9 , Figure 9 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:

[0143] The processor 901 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.

[0144] The memory 902 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and is called and executed by the processor 901 using the message display method of the embodiments of this application.

[0145] The input / output interface 903 is used to implement information input and output;

[0146] The communication interface 904 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0147] Bus 905 transmits information between various components of the device (e.g., processor 901, memory 902, input / output interface 903, and communication interface 904);

[0148] The processor 901, memory 902, input / output interface 903, and communication interface 904 are connected to each other within the device via bus 905.

[0149] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described message display method.

[0150] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0151] The message display method, device, electronic device, and storage medium provided in this application's embodiments generate a message retrieval request based on a message retrieval instruction and a preset message cache queue; send a request to a preset server based on the message retrieval request, so that the server processes the request and obtains multiple target push messages; store each target push message in the message cache queue; retrieve messages from the message cache queue according to the message retrieval instruction to obtain target display messages; and display messages based on the target display messages. Thus, this application's embodiments optimize message retrieval and message display by optimizing the message cache queue. First, after obtaining the message retrieval instruction, a message retrieval request is sent to the server based on the cache state of the message cache queue, enabling the server to retrieve the messages to be pushed based on the cache state of the message queue, obtaining the target push messages, avoiding the situation where all messages are pushed to the message cache queue at once, thereby reducing the server's load. On the other hand, since message retrieval is performed only after the message retrieval instruction, it ensures that all retrieved messages are processed, avoiding the situation where messages are sent to the message cache queue but not processed, reducing resource consumption. Finally, the obtained target push messages are stored in the message cache queue, and the target display messages are retrieved from the message cache queue according to the message retrieval instruction, and the target display messages are displayed.

[0152] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0153] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0154] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0155] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0156] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0157] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0158] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0159] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0160] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0161] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0162] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A message display method, characterized in that, The method includes: In response to a message retrieval command, a message retrieval request is generated based on the message retrieval command and a preset message cache queue; The message retrieval request is sent to a preset server so that the server processes the request and obtains multiple target push messages. Each of the target push messages is stored in the message cache queue; The message is retrieved from the message cache queue according to the message retrieval instruction to obtain the target display message; The message is displayed according to the target message.

2. The method according to claim 1, characterized in that, The message cache queue includes multiple message cache blocks, each of which has a start timestamp; the message retrieval instruction includes the current timestamp. The step of generating a message retrieval request based on the message retrieval instruction and a preset message cache queue includes: The target timestamp is obtained by filtering each of the starting timestamps based on the current timestamp; wherein the target timestamp is less than the current timestamp, and the difference between the target timestamp and the current timestamp is minimized. The message retrieval request is obtained by encapsulating the target timestamp, the current timestamp, and the preset message retrieval quantity.

3. The method according to claim 2, characterized in that, The process of handling the request based on the message acquisition request yields multiple target push messages, including: The number of messages to be pushed is obtained by querying the preset database based on the current timestamp and the target timestamp. If the number of messages to be pushed is greater than the preset number of messages to be acquired, a message lookup table is performed in the database based on the current timestamp and the preset number of messages to be acquired to obtain multiple target push messages; If the number of messages to be pushed is less than or equal to the preset number of messages to be obtained, the database is searched according to the current timestamp and the target timestamp to obtain multiple target push messages.

4. The method according to claim 2, characterized in that, The step of storing each of the target push messages into the message cache queue includes: If the total number of all target push messages is equal to the preset message acquisition number, a message cache block is constructed for each target push message to obtain a cache block; The block to be cached is stored in the message cache queue.

5. The method according to claim 2, characterized in that, The step of storing each of the target push messages into the message cache queue includes: If the total number of all the target push messages is less than the preset message acquisition number, obtain the timestamp of the target push message with the smallest value to obtain the first timestamp; The message cache queue is filtered according to the first timestamp to obtain cache blocks to be merged; wherein the first timestamp is greater than the start timestamp of the cache block to be merged, and the difference between the first timestamp and the cache block to be merged is the smallest among the differences between the first timestamp and the start timestamp of each message cache block. The target push messages are merged with the cache block to be merged to obtain the cache block; Remove the cache block to be merged from the message cache queue and store the cache block into the message cache queue.

6. The method according to claim 2, characterized in that, The step of retrieving messages from the message cache queue according to the message retrieval instruction to obtain the target display message includes: Each message cache block is filtered according to the current timestamp to obtain a target cache block; wherein, the start timestamp of the target cache block is less than the current timestamp, and the difference between the start timestamp of the target cache block and the current timestamp is the smallest among the start timestamps of all message cache blocks. The target cache block is used to retrieve messages according to the preset message retrieval quantity to obtain the target display message.

7. The method according to claim 2, characterized in that, Each of the aforementioned message cache blocks has an end timestamp; the method further includes: In response to a message deletion command, obtain the message to be deleted from the message deletion command; Retrieve the cache block to be updated corresponding to the message to be deleted from the message cache queue; Delete the message to be deleted from the cache block to be updated to obtain the updated cache block; If the number of messages in the updated cache block is less than the preset message acquisition quantity, each message cache block is filtered according to the updated cache block to obtain the next cache block. The next cache block and the updated cache block are merged to obtain a merged cache block. The cache block to be updated and the next cache block are deleted from the message cache queue, and the merged cache block is stored in the message cache queue. Wherein, the start timestamp of the next cache block is less than the end timestamp of the cache block to be updated, and the difference between the start timestamp of the next cache block and the end timestamp of the updated cache block is the smallest among the start timestamps of all message cache blocks. If the number of messages in the updated cache block is greater than or equal to the preset number of messages retrieved, the cache block to be updated is deleted from the message cache queue, and the updated cache block is stored in the message cache queue.

8. A message display device, characterized in that, The device includes: The request generation module is used to generate a message retrieval request in response to a message retrieval instruction, based on the message retrieval instruction and a preset message cache queue. The request sending module is used to send a request to a preset server according to the message acquisition request, so that the server processes the request according to the message acquisition request and obtains multiple target push messages; The message storage module is used to store each of the target push messages into the message cache queue; The message acquisition module is used to acquire messages from the message cache queue according to the message acquisition instruction, and obtain the target display message; The message display module is used to display messages according to the target message.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the message display method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the message display method according to any one of claims 1 to 7.