Application message notification system and method and electronic equipment

By installing the first application on the terminal device, the application establishes a long connection and a PUSH connection with the backend server, and determines the display form of the message according to the preset message display rules, solving the problem of poor user experience in the prior art, and achieving the diversity of in-app message display forms and improving the user experience.

CN119557024APending Publication Date: 2025-03-04HONOR DEVICE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202311095416.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-25
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

In the prior art, applications on the terminal device cannot flexibly control the display form of the message after receiving the notification message sent by the server, resulting in poor user experience.

Method used

By installing the first application on the electronic device, the application establishes a long connection and a PUSH connection with the background server, and determines the display form of the message according to the preset message display rules, including the foreground display and the background display.

Benefits of technology

It realizes the diversity of in-app messages display forms, and can remind users to view messages at the right time, or avoid frequent prompts when they are not suitable, improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557024A_ABST
    Figure CN119557024A_ABST
Patent Text Reader

Abstract

The invention provides an application message notification system and method and electronic equipment. Under the condition that a long connection is established between a first application on the electronic equipment and a first server, the electronic equipment receives a first message sent by the first server through the first long connection between the first application on the electronic equipment and the first server; the electronic device obtains a first message display rule through the first application and determines a first display form of the first application based on the first message display rule, and the first message display rule defines display forms of different types of messages in the first application in different running states of the first application; the electronic equipment displays the first message based on the first display form through the first application; the first display form comprises but is not limited to; foreground display and background display. The application on the electronic equipment can determine the display format of the message in the application based on the message display rule in the application, and the diversity of the display form of the message in the application is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to an application message notification system, method and electronic device. Background Art

[0002] With the development of terminal technology, more and more applications can be installed on terminal devices (such as mobile phones, tablet computers, etc.). Applications installed on terminal devices can receive notification messages sent by servers. Applications can display the notification messages within the application, or they can display the notification messages in the notification bar to remind users to check.

[0003] Applications on electronic devices can have but are not limited to the following two ways of obtaining in-application notification messages. Method 1: The server can send the notification message of the first application to the electronic device through the PUSH channel. The electronic device can display the notification message on the notification bar, and the user can click on the notification message to open the first application to view the notification message. However, if the notification bar reminder is used, the user may be disturbed more frequently. Method 2: After the first application on the electronic device is turned on, the server can establish a long connection with the first application on the electronic device. The server can send the notification message of the first application to the first application on the electronic device through a long connection, and the first application can display the notification message in the first application. The user can open the first application and view the notification message in the first application. However, method 2 prompts in the application, and the user cannot view the notification message in time, which is an unfriendly experience. How to provide a flexible message notification method needs further study. Summary of the invention

[0004] The present application provides an application message notification system, method and electronic device, which enable applications on electronic devices to determine the display format of in-application messages based on message display rules within the application, thereby improving the diversity of in-application message display formats.

[0005] In a first aspect, the present application provides an application message notification system, the system comprising an electronic device and a first server, the electronic device having a first application installed thereon, the first server being a background server of the first application, and the electronic device and the first server establishing a first push connection, wherein the first server is used to obtain a first message; the first server is also used to send the first message to the first application on the electronic device through the first long connection between the first application and the first application when a long connection is established with the first application on the electronic device; the electronic device is used to receive the first message through the first long connection; the electronic device is also used to: obtain a first message display rule through the first application, and determine a first display form of the first application based on the first message display rule, the first message display rule limiting the display forms of different types of messages in the first application under different running states of the first application; based on the first display form, display the first message; wherein the first display form includes but is not limited to; foreground display and background display.

[0006] In some embodiments, the first message display rule may also only limit the display form of the message within the first application under different running states of the first application, that is, the display form of the first message is only related to the state of the first application and has nothing to do with the message type.

[0007] The first push connection is a long connection between the electronic device and the first server. The first server can send messages to the electronic device through the first push connection, and the electronic device cannot send messages to the first server through the first push connection, that is, the first push connection is a one-way communication long connection.

[0008] After the first application on the electronic device is started, a first persistent connection between the first server and the first application is established. After the first application on the electronic device is closed, the first persistent connection between the first server and the first application is disconnected.

[0009] Through this method, when it is determined that a long connection is established with the first application on the electronic device 100, the server 200 can send the first message to the first application on the electronic device 100 through the first long connection. In this way, the message received through the first long connection can be displayed in the foreground or in the background, the message originally displayed in the foreground can be displayed in the background, and the message displayed in the background can also be displayed in the foreground. The first application can display the first message in the foreground when it is appropriate to remind the user to view the first message, or display the first message in the background when it is not appropriate to remind the user to view the first message. The display form of the first message is determined by the first application on the electronic device 100, so that the display form of the message in the application is more flexible.

[0010] In combination with the first aspect, in a possible implementation, the first server is further used to send the first message to the electronic device through a first push connection when no long connection is established with the first application on the electronic device; the electronic device is further used to: receive the first message through the first push connection; and display the first message in the foreground.

[0011] When determining that a long connection is established with the first application on the electronic device 100, the first server can send the first message to the electronic device through the first push connection between the first server and the electronic device. The message received by the electronic device through the first push connection can be displayed in the foreground to remind the user to check the first message.

[0012] In combination with the first aspect, in a possible implementation, the system also includes a second server, a second application is also installed on the electronic device, the second server is the background server of the second application, and a second push connection is established between the electronic device and the second server, wherein the second server is used to obtain a second message; the second server is also used to send the second message to the second application on the electronic device through a second long connection between the second application and the second application when a long connection is established with the second application on the electronic device; the electronic device is used to receive the second message through the second long connection; the electronic device is also used to: obtain a second message display rule through the second application, and determine a second display form of the second message based on the second message display rule, the second message display rule limiting the display form of different types of messages in the second application under different running states of the first application; based on the second display form, display the second message; wherein the second display form includes but is not limited to; foreground display and background display.

[0013] In combination with the first aspect, in a possible implementation manner, the second application is different from the first application, and the first message display rule is different from the second message display rule.

[0014] In this way, different applications have different message display rules. Different applications can determine the display forms of different messages based on their own message display rules.

[0015] In combination with the first aspect, in a possible implementation manner, the second application is different from the first application, and the first message display rule is the same as the second message display rule.

[0016] In this way, the message display rules of different applications are the same. Different applications can determine the display forms of different messages based on the same message display rules.

[0017] In combination with the first aspect, in a possible implementation method, the electronic device is specifically used to: obtain a first message display rule through a first application, and obtain the running status of the first application and the message type of the first message; determine a first display form of the first message through the first application based on the first message display rule, the running status of the first application and the message type of the first message.

[0018] In some embodiments, the electronic device is specifically used to: obtain the first message display rule through the first application, and obtain the running state of the first application; determine the first display form of the first message through the first application based on the first message display rule and the running state of the first application. That is, the display form of the first message is only related to the state of the first application, and has nothing to do with the message type.

[0019] In combination with the first aspect, in a possible implementation, the first server includes multiple brokers, the multiple brokers include a first broker, and the long connection between the first application on the electronic device and the first broker is the first long connection; the first server stores a first routing table, and the first routing table stores a correspondence between an application identifier and an identifier of a broker connected to the application, and the correspondence between the application identifier and the broker connected to the application includes a correspondence between an application identifier of the first application and an identifier of the first broker; the first server is specifically used to: obtain the first routing table; obtain the identifier of the first broker from the first routing table based on the identifier of the first application; and send a first message to the first application on the electronic device through the first broker based on the first long connection.

[0020] Among them, the multiple brokers can be multiple node servers in the first server, that is, the first server is composed of multiple node servers, and the multiple node servers are used to share the business pressure of the first server. After the first application on the electronic device is turned on, the first application will randomly connect to one of the multiple brokers (the first broker), and the first broker will send the first message to the first application on the electronic device. This can speed up the efficiency of the server sending messages.

[0021] In combination with the first aspect, in a possible implementation, the first server includes multiple brokers, the multiple brokers include a second broker, and the long connection between the second application on the electronic device and the second broker is the second long connection; the first server stores a second routing table, and the second routing table stores a correspondence between an application identifier and an identifier of a broker connected to the application, and the correspondence between the application identifier and the broker connected to the application includes a correspondence between an application identifier of the second application and an identifier of the second broker; the first server is specifically used to: obtain the second routing table; obtain the identifier of the second broker from the second routing table based on the identifier of the second application; and send the second message to the second application on the electronic device through the second broker based on the second long connection.

[0022] The second broker is different from the first broker, that is, different applications on the same electronic device can be connected to different brokers.

[0023] In some embodiments, the second broker may be the same as the first broker, that is, different applications on the same electronic device may be connected to the same broker.

[0024] Optionally, the second routing table may be the same routing table as the first routing table, and the second routing table may not be the same routing table as the first routing table.

[0025] In combination with the first aspect, in a possible implementation, the first server includes a plurality of servers, and the plurality of servers include a high-speed statistics counting storage server, a medium-speed statistics counting persistence server, and a low-speed statistics calculation server;

[0026] The electronic device is also used to send the reading behavior of the first message and the original data of the reading behavior to the first server; the first server is also used to: update the first statistical result of the reading status of the first message based on the reading behavior of the first message through a high-speed statistical counting storage server; cache the first statistical result of the reading status of the first message through a medium-speed statistical counting persistent server; obtain the second statistical result of the reading status of the first message based on the original data of the reading behavior through a low-speed statistical calculation server; cache the second statistical result of the reading status of the first message through a medium-speed statistical counting persistent server.

[0027] Among them, the reading status of the first message includes but is not limited to: the number of reads, the number of likes, the number of collections, the number of comments, the number of reposts, etc.

[0028] The reading status of the first message includes but is not limited to: read, liked, collected, commented, forwarded, etc.

[0029] The high-speed statistics and counting storage server may be a redis cluster. The high-speed statistics and counting storage server may perform high-speed access and cache for the statistical results of the reading status of the message. The high-speed statistics and counting storage server may send the statistical results of the reading status of the message to each electronic device.

[0030] The medium-speed statistics and counting persistent server can be a mongo cluster. The function of the medium-speed statistics and counting persistent server is to provide a persistent statistical result storage.

[0031] The low-speed statistical calculation server calculates the statistical results of the reading status of the message based on the original data, which is a statistical result obtained based on the original data of the reading behavior of the reported messages of each electronic device.

[0032] Through the three-level structure of high-speed statistical counting storage server, medium-speed statistical counting persistence server and low-speed statistical calculation server, the accuracy of the statistical results of the reading status of the message is guaranteed, and the statistical results of the reading status of the message can be quickly counted to meet the capabilities of high-speed access and counting changes.

[0033] In combination with the first aspect, in a possible implementation, the first server is also used to re-obtain the first statistical result of the reading status of the first message from the medium-speed statistical counting persistence server after the high-speed statistical counting storage server loses the first statistical result of the reading status of the first message.

[0034] In this way, the high-speed statistics counting storage server can quickly obtain the first statistical result of the reading status of the first message stored in the medium-speed statistics counting persistent server, so as to quickly feed back the first statistical result of the reading status of the first message to each electronic device.

[0035] In combination with the first aspect, in a possible implementation, the calculation speed of the high-speed statistics storage server is greater than the calculation speed of the medium-speed statistics persistence server, and the calculation speed of the medium-speed statistics persistence server is greater than the calculation speed of the low-speed statistics calculation server.

[0036] In combination with the first aspect, in a possible implementation manner, the foreground display method includes any one of the following: pop-up window display, and display in a pull-down notification bar.

[0037] Foreground display means that the user can view the first message without opening the first application.

[0038] Background display means that the first message is displayed inside the first application, and the user needs to manually open the first application before the first message can be viewed. Manual opening of the first application by the user means that the first application is displayed in the foreground, for example, the electronic device needs to display the user interface of the first application before the user can view the first message.

[0039] In second aspect, the present application provides an application message notification method, the method comprising: a first server obtains a first message of a first application; when a long connection is established between the first server and the first application on the electronic device, the first server sends the first message to the first application on the electronic device through the first long connection between the first server and the first application on the electronic device, the first message is used for the first application on the electronic device to determine a first display form of the first application based on a first message display rule, and display the first message based on the first display form; wherein the first message display rule limits the display forms of different types of messages in the first application under different running states of the first application; the first display form includes but is not limited to; foreground display and background display.

[0040] In combination with the second aspect, in a possible implementation, a first push connection is established between the first server and the electronic device, and the method also includes: when the first server has not established a long connection with the first application on the electronic device, sending a first message to the electronic device through the first push connection, and the first message is used by the first application on the electronic device to display the first message on the foreground of the electronic device.

[0041] In combination with the second aspect, in a possible implementation, the first server includes multiple brokers, the multiple brokers include a first broker, and the long connection between the first application on the electronic device and the first broker is the first long connection; the first server stores a first routing table, and the first routing table stores a correspondence between an application identifier and an identifier of a broker connected to the application, and the correspondence between the application identifier and the broker connected to the application includes a correspondence between an application identifier of the first application and an identifier of the first broker; the first server sends the first message to the first application on the electronic device through the first long connection between the first application and the first application on the electronic device, specifically including: the first server obtains the first routing table; the first server obtains the identifier of the first broker from the first routing table based on the identifier of the first application; the first server sends the first message to the first application on the electronic device through the first broker based on the first long connection.

[0042] In combination with the second aspect, in a possible implementation, the first server includes multiple servers, and the multiple servers include a high-speed statistical counting storage server, a medium-speed statistical counting persistent server and a low-speed statistical calculation server; after the first server sends the first message to the first application on the electronic device through a first long connection between the first message and the first application on the electronic device, the method also includes: the first server receives the reading behavior of the first message sent by the electronic device and the original data of the reading behavior; the first server updates the first statistical result of the reading status of the first message based on the reading behavior of the first message through the high-speed statistical counting storage server; the first server caches the first statistical result of the reading status of the first message through the medium-speed statistical counting persistent server; the first server obtains the second statistical result of the reading status of the first message based on the original data of the reading behavior through the low-speed statistical calculation server; the first server caches the second statistical result of the reading status of the first message through the medium-speed statistical counting persistent server.

[0043] In combination with the second aspect, in a possible implementation, the method also includes: after the high-speed statistical counting storage server loses the first statistical result of the reading status of the first message, the first server re-obtains the first statistical result of the reading status of the first message from the medium-speed statistical counting persistence server.

[0044] In conjunction with the second aspect, in a possible implementation, the calculation speed of the high-speed statistics storage server is greater than the calculation speed of the medium-speed statistics persistence server, and the calculation speed of the medium-speed statistics persistence server is greater than the calculation speed of the low-speed statistics calculation server.

[0045] In conjunction with the second aspect, in a possible implementation, the foreground display method includes any one of the following: display in a pop-up window, display in a pull-down notification bar.

[0046] In a third aspect, the present application provides an application message notification method, the method comprising: when a first application on an electronic device establishes a long connection with a first server, the electronic device receives a first message sent by the first server through the first long connection between the first application on the electronic device and the first server; the electronic device obtains a first message display rule through the first application, and determines a first display form of the first application based on the first message display rule, the first message display rule limiting the display forms of different types of messages in the first application under different running states of the first application; the electronic device displays the first message based on the first display form through the first application; wherein the first display form includes but is not limited to; foreground display and background display.

[0047] In combination with the third aspect, in a possible implementation, a first push connection is established between the electronic device and the first server, and the method also includes: when the first application on the electronic device has not established a long connection with the first server, the electronic device receives a first message sent by the first server through the first push connection; and the electronic device displays the first message in the foreground.

[0048] In combination with the third aspect, in a possible implementation, when a second application on the electronic device establishes a long connection with a second server, the electronic device receives a second message sent by the second server through the second long connection between the second application on the electronic device and the second server; the electronic device obtains a second message display rule through the second application, and determines a second display form of the second message based on the second message display rule, and the second message display rule limits the display form of different types of messages in the second application under different running states of the second application; the electronic device displays the second message based on the second display form through the second application; wherein the second display form includes but is not limited to; foreground display and background display.

[0049] In conjunction with the third aspect, in a possible implementation manner, the second application is different from the first application, and the first message display rule is different from the second message display rule.

[0050] In combination with the third aspect, in a possible implementation manner, the second application is different from the first application, and the first message display rule is the same as the second message display rule.

[0051] In conjunction with the third aspect, in a possible implementation manner, the electronic device obtains a first message display rule through a first application, and determines a first display form of the first application based on the first message display rule, specifically including:

[0052] The electronic device obtains a first message display rule through a first application, and obtains the running status of the first application and the message type of the first message; the electronic device determines a first display form of the first message through the first application based on the first message display rule, the running status of the first application and the message type of the first message.

[0053] In combination with the third aspect, in a possible implementation, the first server includes multiple brokers, the multiple brokers include the first broker, and the long connection between the first application on the electronic device and the first broker is the first long connection; the electronic device receives the first message sent by the first server through the first long connection between the first application on the electronic device and the first server, specifically including: the electronic device receives the first message sent by the first broker through the first long connection between the first application on the electronic device and the first broker.

[0054] In combination with the third aspect, in a possible implementation, the first server includes multiple brokers, the multiple brokers include a second broker, and the long connection between the first application on the electronic device and the second broker is the second long connection; the electronic device receives the second message sent by the second server through the second long connection between the second application on the electronic device and the second server, specifically including: the electronic device receives the second message sent by the second broker through the second long connection between the second application on the electronic device and the second broker.

[0055] In a fourth aspect, the present application provides an electronic device comprising one or more cameras, one or more processors and one or more memories; wherein, the one or more cameras, the one or more memories are coupled to one or more processors, and the one or more memories are used to store computer program code, and the computer program code includes computer instructions, and when one or more processors execute the computer instructions, an application message notification method in any possible implementation of any of the above aspects is executed.

[0056] In a fifth aspect, an embodiment of the present application provides a computer storage medium, including computer instructions, which, when executed on an electronic device, enables a communication device to execute an application message notification method in any possible implementation of any of the above aspects.

[0057] In a sixth aspect, an embodiment of the present application provides a computer program product, which, when executed on a computer, enables the computer to execute an application message notification method in any possible implementation of any of the above aspects.

[0058] For the beneficial effects of the second to sixth aspects, reference may be made to the description of the beneficial effects in the first aspect, and this application will not repeat them here. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1A A system architecture diagram provided for an embodiment of the present application;

[0060] Figure 1B A schematic diagram of the architecture of a server 200 provided by the present application is shown;

[0061] Figure 2 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0062] Figure 3 A software structure block diagram of an electronic device 100 provided in an embodiment of the present application;

[0063] Figure 4 A schematic diagram of the structure of a server 200 provided in an embodiment of the present application;

[0064] Figure 5 A schematic diagram of an electronic device 100 receiving a first message and displaying the first message provided in an embodiment of the present application;

[0065] Figure 6A-6G A schematic diagram of a group of first applications displaying a first message provided by an embodiment of the present application;

[0066] Figure 7 A schematic diagram of the structure of a server 200 is shown;

[0067] Figure 8 A schematic diagram of the composition structure of another server 200 is shown. DETAILED DESCRIPTION

[0068] The technical solutions in the embodiments of the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0069] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.

[0070] The term "user interface (UI)" in the following embodiments of the present application refers to a medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. A common form of user interface is a graphical user interface (GUI), which refers to a user interface related to computer operation displayed in a graphical manner. It can be a visual interface element such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. displayed on the display screen of an electronic device.

[0071] Figure 1A A system architecture diagram provided for this application.

[0072] like Figure 1AAs shown, the system includes an electronic device 100 and a server 200 .

[0073] One or more applications are installed on the electronic device 100 , wherein the one or more applications may include a first application.

[0074] In some embodiments, the server 200 may be a server corresponding to the first application.

[0075] The server 200 may send a first message to a first application on the electronic device 100 .

[0076] The first message may be a social interaction message of the first application, a content subscription push message, a system notification message, a configuration update message, etc.

[0077] Among them, social interaction messages may include but are not limited to chat messages between contacts, interactive messages such as likes, comments, and shares between contacts, etc.

[0078] Content subscription push messages may include but are not limited to content information, video, article and other messages.

[0079] System notification messages may include but are not limited to user order notification messages, transaction reminder messages, logistics notification messages, upgrade reminder messages, etc.

[0080] The configuration update message may include but is not limited to an application function update message of the first application, etc.

[0081] The first message may also be other messages, which is not limited in this application.

[0082] After receiving the first message sent by the server 200 , the first application on the electronic device 100 can determine the display format of the first message based on the message display rule to determine whether the first message is displayed in the foreground or in the background of the electronic device 100 .

[0083] For a detailed introduction to the message display rules, please refer to the description in the subsequent embodiments, and this application will not go into details here.

[0084] In this way, the application on the electronic device can flexibly configure the display form of the message sent by the server based on the message display rules, so that the message sent by the server can be displayed in the most appropriate way, thereby improving the user experience.

[0085] In some embodiments, the server 200 needs to store and count messages in addition to sending messages to the first application on the electronic device 100. For example, after the first application on the electronic device 100 displays the first message, the first application can send the reading status (e.g., read or unread) of the first message to the server 200, so that the server 200 can count the reading status of the first message.

[0086] The present application provides a hierarchical structure of servers, so that the server 200 can quickly count the number of messages and the reading status, and ensure the accuracy of the data statistics results. For details, please refer to Figure 8 Description in the Examples.

[0087] Figure 1B A schematic diagram of the architecture of a server 200 provided in the present application is shown.

[0088] like Figure 1B As shown, the server 200 includes two task items, including a message push task item and a message storage task item.

[0089] The push channels for message push tasks include but are not limited to foreground push and background push.

[0090] Among them, the foreground push is to push the message through the PUSH connection between the server 200 and the electronic device.

[0091] Background push is to push messages through a long connection (such as an MQTT long connection) between the server 200 and the application on the electronic device.

[0092] Among them, the background push can be realized through the broker cluster. The broker cluster consists of multiple node servers, such as broker1, broker2 and broker3, etc. After the application on the electronic device is turned on, the node service management will randomly assign a broker, and the application on the electronic device will randomly connect to any broker in the broker cluster. The server will record the corresponding relationship between each application and the broker it is connected to, and generate and save the routing table.

[0093] When the server needs to send a message to an application on an electronic device, it will first determine whether the server has established a persistent connection with the application on the electronic device. If a persistent connection is established, the server will look up the routing table, obtain the broker to which the application is connected from the routing table, and send the message to the application on the electronic device through the broker. After receiving the message sent by the broker, the application on the electronic device will determine whether the message should be displayed in the foreground or in the background based on the running status of the application and / or the message type. If it is displayed in the background, the message will be displayed in the background; if it is displayed in the foreground, the message will be displayed in the foreground.

[0094] In the absence of a persistent connection, the server directly sends the message to the electronic device through the mobile phone PUSH channel. After receiving the message, the electronic device directly displays the message on the foreground.

[0095] For details, please refer to Figure 7 Description in the examples.

[0096] In some embodiments, the server 200 also needs to store messages, for example, store the statistical results of the reading status of the messages, and push the statistical results of the reading status of the messages to various electronic devices.

[0097] The storage structure of the server 200 is divided into three layers, namely, a high-speed statistics counting storage layer, a medium-speed statistics counting persistence layer and a low-speed statistics calculation layer.

[0098] Among them, the reading status of the message includes but is not limited to: the number of reads, the number of likes, the number of collections, the number of comments, the number of reposts, etc.

[0099] The reading status of a message includes but is not limited to: read, liked, collected, commented on, forwarded, etc.

[0100] The high-speed statistics and counting storage layer can be a redis cluster. The high-speed statistics and counting storage layer can perform high-speed access and cache for the statistical results of the reading status of the message. The high-speed statistics and counting storage layer can send the statistical results of the reading status of the message to each electronic device.

[0101] The medium-speed statistics and counting persistence layer can be a mongo cluster. The function of the medium-speed statistics and counting persistence layer is to provide a persistent statistical result storage.

[0102] The low-speed statistical calculation layer is a statistical result of the reading status of the message calculated based on the original data, and is a statistical result obtained based on the original data of the reading behavior of the reported messages of each electronic device.

[0103] Through the three-level structure of high-speed statistical counting storage layer, medium-speed statistical counting persistence layer and low-speed statistical calculation layer, the accuracy of the statistical results of the reading status of the message is guaranteed, and the statistical results of the reading status of the message can be quickly counted to meet the capabilities of high-speed access and counting changes.

[0104] For details, please refer to Figure 8 Description in the examples.

[0105] refer to Figure 2 , Figure 2 A schematic structural diagram of an electronic device is shown.

[0106] The electronic device 100 may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, an in-vehicle device, a smart home device and / or a smart city device. The embodiments of the present application do not impose any special restrictions on the specific type of the electronic device.

[0107] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0108] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0109] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0110] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0111] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0112] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0113] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.

[0114] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.

[0115] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0116] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.

[0117] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.

[0118] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0119] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0120] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0121] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.

[0122] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0123] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0124] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0125] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0126] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0127] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0128] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0129] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0130] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Mini LED, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0131] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0132] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise and brightness of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

[0133] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0134] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0135] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0136] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0137] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).

[0138] Random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, the fifth generation DDR SDRAM is generally referred to as DDR5SDRAM), etc.; non-volatile memory may include disk storage devices and flash memory.

[0139] Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle; single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the storage unit potential level; universal flash storage (UFS), embedded multi media card (eMMC), etc. according to the storage specification.

[0140] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data.

[0141] The non-volatile memory may also store executable programs and user and application data, etc., and may be loaded into the random access memory in advance for direct reading and writing by the processor 110 .

[0142] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external non-volatile memory.

[0143] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0144] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0145] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.

[0146] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.

[0147] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.

[0148] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0149] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0150] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.

[0151] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.

[0152] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.

[0153] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0154] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.

[0155] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.

[0156] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

[0157] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0158] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

[0159] The touch sensor 180K is also called a "touch control device". The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch control screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0160] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone. The audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function. The application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.

[0161] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0162] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0163] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0164] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the Android system of the layered architecture is taken as an example to exemplify the software structure of the electronic device 100.

[0165] Figure 3 1 is a software structure block diagram of the electronic device 100 according to an embodiment of the present invention.

[0166] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.

[0167] The application layer can include a series of application packages.

[0168] like Figure 3 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.

[0169] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0170] like Figure 3As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0171] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0172] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0173] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0174] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).

[0175] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0176] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0177] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0178] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0179] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0180] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0181] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0182] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0183] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0184] A 2D graphics engine is a drawing engine for 2D drawings.

[0185] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0186] The following is an illustrative description of the workflow of the software and hardware of the electronic device 100 in conjunction with capturing a photo scene.

[0187] Figure 4 A schematic structural diagram of the server 200 is shown.

[0188] like Figure 4 As shown, the server 200 may include: one or more processors 210, a memory 211, a communication interface 212, a transmitter 214, a receiver 215, a coupler 216, and an antenna 217. These components may be connected via a bus 213 or other means. Figure 2 Take bus connection as an example for explanation.

[0189] The communication interface 212 can be used to connect the server 200 with other electronic devices, such as Figure 2 The electronic device 100 shown communicates. Specifically, the communication interface 212 can be a 3G communication interface, a long-term evolution (LTE) (4G) communication interface, a 5G communication interface, a WLAN communication interface, a WAN communication interface, etc. Not limited to a wireless communication interface, the server 200 can also be configured with a wired communication interface 212 to support wired communication.

[0190] In some embodiments of the present application, the transmitter 214 and the receiver 215 can be regarded as a wireless modem. The transmitter 214 can be used to transmit and process the signal output by the processor 210. The receiver 215 can be used to receive the signal. In the server 200, the number of the transmitter 214 and the receiver 215 can be one or more. The antenna 217 can be used to convert the electromagnetic energy in the transmission line into electromagnetic waves in the free space, or to convert the electromagnetic waves in the free space into electromagnetic energy in the transmission line. The coupler 216 can be used to divide the mobile communication signal into multiple paths and distribute it to multiple receivers 215. It can be understood that the antenna 217 of the server 200 can be implemented as a large-scale antenna array.

[0191] The memory 211 is coupled to the processor 210 and is used to store various software programs and / or multiple sets of instructions. Specifically, the memory 211 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage devices, flash memory devices or other non-volatile solid-state storage devices.

[0192] The memory 211 can store an operating system (hereinafter referred to as the system), for example The memory 211 may also store a network communication program, which can be used for the electronic device 100 to communicate.

[0193] The processor 210 may be used to read and execute computer-readable instructions. Specifically, the processor 210 may be used to call a program stored in the memory 211 and execute instructions contained in the program.

[0194] It should be noted that Figure 4 The server 200 shown is only one implementation of the embodiment of the present application. In actual applications, the server 200 may also include more or fewer components, which is not limited here.

[0195] Figure 5 A schematic diagram showing the electronic device 100 receiving a first message and displaying the first message is shown.

[0196] S501: The electronic device 100 and the server 200 establish a first PUSH connection.

[0197] The server 200 may send a message to the electronic device 100 through the first PUSH connection. After receiving the message sent by the server 200 through the first PUSH connection, the electronic device 100 may display the message in a drop-down notification bar of the electronic device 100. The user may click on the message in the drop-down notification bar to view the details of the message.

[0198] S502: The electronic device 100 and the server 200 establish a first long connection (eg, a first MQTT connection).

[0199] Exemplarily, the first long connection may be a first MQTT connection. The first long connection may also be other connection modes, which is not limited in the present application. The present application only uses the MQTT connection as an example for illustration.

[0200] Optionally, after the first application on the electronic device 100 is started, the server 200 can establish a first MQTT connection with the first application on the electronic device 100. After the first application on the electronic device 100 is closed, the first MQTT connection between the server 200 and the first application on the electronic device 100 is disconnected.

[0201] The first application is started, which may mean that the process of the first application is running. The first application may be running in the foreground or in the background.

[0202] The first application is turned on or off, which may refer to the process of the first application being turned off.

[0203] Optionally, different applications on the electronic device 100 may have different long connections with the server 200. For example, after the second application on the electronic device 100 is started, the server 200 may establish a second MQTT connection with the second application on the electronic device 100.

[0204] After the server 200 and the first application on the electronic device 100 establish a first MQTT connection, the server 200 can send messages to the first application on the electronic device 100 through the first MQTT connection, and the first application on the electronic device 100 can also send messages to the server 200 through the first MQTT connection.

[0205] S503 : The server 200 needs to confirm whether a long connection is established with an application on the electronic device 100 .

[0206] Before the server 200 sends a first message to a first application on the electronic device 100 , the server 200 needs to determine whether a long connection is established with an application on the electronic device 100 .

[0207] When it is determined that a persistent connection is established with the first application on the electronic device 100, the server 200 may send the first message to the first application on the electronic device 100 through the persistent connection. The first application on the electronic device 100 determines the display form of the first message, making the display form of the in-application message more flexible.

[0208] In other embodiments, when it is determined that no long connection is established with the first application on the electronic device 100, the server 200 may send the first message to the electronic device 100 via the first PUSH connection, and the electronic device 100 may display the first message in the foreground.

[0209] That is, when it is determined that a long connection is established with the electronic device 100, S509-S510 are executed.

[0210] When it is determined that no long connection is established with the electronic device 100 , S504 - S508 are executed.

[0211] S504. The server 200 sends a first message to a first application on the electronic device 100 through the first long connection.

[0212] When it is determined that the server 200 has established a persistent connection with the first application on the electronic device 100, the server 200 may send the first message to the first application on the electronic device 100 through the first persistent connection. The first application on the electronic device 100 determines the display form of the first message, making the display form of the message in the first application more flexible.

[0213] S505: The first application on the electronic device 100 obtains a first display rule.

[0214] In some embodiments, the first display rule may also be referred to as a first message display rule.

[0215] In some embodiments, message display rules of different applications are different. For example, the electronic device 100 also includes a second application, and the second application can obtain a second message display rule.

[0216] Optionally, the second application is different from the first application, and the first message display rule is different from the second message display rule.

[0217] Optionally, the second application is different from the first application, and the first message display rule is the same as the second message display rule.

[0218] S506: The first application on the electronic device 100 determines foreground display or background display based on the first display rule.

[0219] After the first application on the electronic device 100 receives the first message sent by the server 200 through the first long connection, the first application on the electronic device 100 can obtain the first display rule so that the first application can determine the display form of the first message based on the first display rule.

[0220] Among them, the first display rule defines the display forms of different types of messages in the first application under different running states of the first application.

[0221] After acquiring the first display rule, the first application may determine the display form of the first message in combination with the first display rule, the running state of the first application and / or the message type of the first message.

[0222] The message type of the first message of the first application includes but is not limited to social interaction messages, content subscription push messages, system notification messages, configuration update messages, etc.

[0223] The running state of the first application includes but is not limited to foreground running, background running, and ongoing business matters of the first application.

[0224] The display form of the first message includes but is not limited to foreground display and background display.

[0225] The foreground display includes but is not limited to the pull-down notification bar display, pop-up window display, etc.

[0226] Background display includes but is not limited to display within the application.

[0227] Exemplarily, when the first application is running in the foreground and a social interaction business item is being performed, when the first message is a social interaction message (eg, a voice call message / video call message), the first application may determine that the first message is to be displayed in the background.

[0228] Exemplarily, when the first application is running in the foreground or the background but is not performing any social interaction business matters, when the first message is a social interaction message (eg, a voice call message / video call message), the first application can determine that the first message is displayed in the foreground.

[0229] Optionally, the display rules of messages of different applications may be different or the same. For example, a second application on the electronic device 100 may obtain a second display rule, which is different from the first display rule.

[0230] S507: The first application on the electronic device 100 displays the first message in the foreground.

[0231] After the first application determines to display the first message in the foreground, the first application may display the first message in the foreground.

[0232] In a possible implementation, in response to the first message being displayed in the foreground, the first application may display prompt information in a pull-down notification bar, and the user may view the first message through the prompt information.

[0233] For example, Fig. 6AAs shown, the electronic device 100 displays the main interface. The main interface may include: a status bar, a tray with commonly used application icons, and other application icons. Among them, the status bar may include a time indicator, a battery status indicator, one or more signal strength indicators of wireless fidelity (Wi-Fi) signals, and one or more signal strength indicators of mobile communication signals (also known as cellular signals). The tray with commonly used application icons can display: a camera icon, a phone icon, a contact icon, and a text message icon. Other application icons may include, for example: a clock icon, a calendar icon, a gallery icon, a memo icon, a Huawei video icon, and an instant messaging icon. The icon of any application can be used to respond to the user's operation (such as a single-click operation) so that the electronic device 100 starts the application corresponding to the icon. Among them, the instant messaging icon can be used to start application instant messaging. The electronic device 100 can send messages to contacts or make voice calls or video calls through application instant messaging.

[0234] The electronic device 100 may receive a sliding operation performed by a user on the main desktop (eg, a sliding operation from the top of the display screen downwards). In response to the sliding operation of the user, the electronic device 100 may display Figure 6B The drop-down notification bar shown.

[0235] like Figure 6B As shown, the drop-down notification bar of the electronic device 100 includes multiple options, for example, the multiple options include but are not limited to WLAN options, Bluetooth options, flashlight options, ring options, automatic rotation options, instant sharing options, airplane mode options, mobile data options, location information options, screenshot options, screen brightness adjustment options, etc.

[0236] The drop-down notification bar also includes prompt information 601, which includes a text prompt "Your friend AAA invites you to make a video call..." The prompt information 601 can be a prompt information displayed in the foreground in response to the first message.

[0237] In some embodiments, the user can view the first message through the prompt information 601.

[0238] For example, Figure 6C As shown, the electronic device 100 can receive a user input operation (such as a click) for the prompt information 601, and in response to the user's input operation, the electronic device 100 can display Fig.6D User interface 602 is shown.

[0239] User interface 602 may be a user interface corresponding to the first message. User interface 602 includes an answer option, a reject option, and a switch to voice call option. The user may establish a video call connection with the peer device through the answer option. The user may also reject the establishment of a video call connection with the peer device through the reject option. The user may also establish a voice call connection with the peer device through the switch to voice call option.

[0240] In other possible implementations, in response to the first message being displayed in the foreground, the first application may display a prompt message in a pop-up window, and the user may view the first message through the prompt message.

[0241] For example, Fig. 6E As shown, in response to the first message being displayed in the foreground, the electronic device 100 displays a pop-up window 603, which includes a text prompt "Your friend AAA invites you to make a video call..." The pop-up window 603 may be prompt information displayed in the foreground in response to the first message.

[0242] In some embodiments, the user can view the first message through the pop-up window 603.

[0243] For example, Fig. 6E As shown, the electronic device 100 can receive a user input operation (such as a single click) for the pop-up window 603, and in response to the user's input operation, the electronic device 100 can display Fig.6D User interface 602 is shown.

[0244] It should be noted that Figure 6A-6E This is merely an example of how the first application displays the first message in the foreground, and this application does not limit this.

[0245] In this way, the first application can see the first message displayed in the foreground, thereby prompting the user to check the first message in time.

[0246] S508: The first application on the electronic device 100 displays the first message in the background.

[0247] After the first application determines to display the first message in the background, the first application can display the first message in the background. The first application displays the first message in the background, that is, displays the first message in the first application instead of in the foreground, so as to avoid the first message being displayed in the foreground and frequently prompting the user to cause interference to the user.

[0248] When the first message is displayed in the background, the first application needs to be opened and run in the foreground to view the first message.

[0249] For example, Fig. 6F As shown, after the first application displays the first message in the background, the user cannot view the first message.

[0250] like Fig. 6F As shown, the electronic device 100 can receive an input operation (such as a single click) from a user on an instant messaging application icon in the main interface. In response to the input operation from the user, the electronic device 100 can start the first application and run the first application in the foreground. The electronic device 100 can display Figure 6G The user interface 602 shown may be a user interface within an instant messaging application.

[0251] S509. The server 200 sends a first message to the electronic device 100 through the first PUSH connection.

[0252] When it is determined that no persistent connection is established with the first application on the electronic device 100 , the server 200 can only send the first message to the electronic device 100 through the PUSH channel.

[0253] For example, the server 200 may send a first message to the electronic device 100 through a first PUSH connection.

[0254] S510: The electronic device 100 displays the first message in the foreground.

[0255] In response to receiving the first message sent by the server 200 through the first PUSH connection, the electronic device 100 displays the first message in the foreground, thereby prompting the user to check the first message in time.

[0256] That is, if the server 200 has not established a persistent connection with the first application on the electronic device 100, the server 200 cannot send the first message to the first application on the electronic device 100 through the persistent connection. The server 200 can only send the first message to the electronic device 100 through the first PUSH connection, so that the electronic device 100 can obtain the first message.

[0257] The message received by the PUSH channel needs to be displayed in the foreground. Then, after the electronic device 100 receives the first message sent by the server 200 through the first PUSH connection, the electronic device 100 can display the first message in the foreground.

[0258] Exemplarily, in response to the electronic device 100 displaying the first message on the foreground, the electronic device 100 may display the first message on the Figure 6B In the drop-down notification bar shown, or display the first message in Fig. 6E in the pop-up window shown.

[0259] Through this method, before the server 200 needs to send a message to the first application, it can be determined whether the server 200 has established a long connection with the first application. In the case of a long connection, the server 200 can send the first message to the first application on the electronic device 100 through the long connection. After the first application receives the first message sent by the server 200 through the long connection. The first application can determine the display form of the first message based on the first display rule, the running state of the first application and / or the message type of the first message, that is, determine whether the first message is displayed in the foreground or in the background. In other words, the first message sent by the server 200 to the first application on the electronic device 100 through the long connection can be displayed both in the foreground and in the background, which improves the flexibility of the display form of the first message in the first application.

[0260] In the case where a persistent connection is not established, the server 200 can send the first message to the electronic device 100 through the PUSH channel, and the electronic device 100 then displays the first message on the foreground. This ensures that in the case where a persistent connection is not established, the first message can be sent to the electronic device 100 through the PUSH channel.

[0261] After the first application on the electronic device 100 is started, the first application on the electronic device 100 can establish a persistent connection (e.g., an MQTT connection) with the server 200, so that the server 200 sends the first message to the first application on the electronic device 100 through the persistent connection, and the first application then decides whether to display the first message in the foreground or the background.

[0262] In some embodiments, the number of users using the first application and the number of messages in the first application are large. In order to reduce the burden on the server 200, multiple different servers can be deployed in the server 200, and different servers can be used to send messages to different electronic devices that have installed the first application. This can not only reduce the pressure on the server 200, but also improve the efficiency of the server 200 in sending application messages to different electronic devices.

[0263] Figure 7 A schematic diagram of the structure of the server 200 is shown.

[0264] The server 200 may include a broker cluster and a message gateway module. The broker cluster may include multiple servers, which may be MQTT broker1, MQTT broker2, and MQTT broker3.

[0265] The MQTT broker is used to maintain an MQTT persistent connection with the application on the electronic device and send messages to the application on the electronic device through the MQTT persistent connection between the broker and the application on the electronic device.

[0266] After the application on the electronic device is turned on, the application on the electronic device can randomly establish and maintain an MQTT long connection with an MQTT broker in the broker cluster.

[0267] In some embodiments, multiple different applications in the same electronic device can establish and maintain an MQTT persistent connection with one MQTT broker in the broker cluster. That is, one MQTT broker can only establish and maintain an MQTT persistent connection with different applications on one electronic device.

[0268] In other embodiments, multiple different applications in the same electronic device can establish and maintain MQTT long connections with different MQTT brokers in the broker cluster.

[0269] In other embodiments, the same application in different electronic devices can establish and maintain an MQTT persistent connection with one MQTT brokerr in the broker cluster. That is, one MQTT broker can only establish and maintain an MQTT persistent connection with the same application.

[0270] In other embodiments, an MQTT broker can only establish and maintain MQTT persistent connections with a preset number of applications. When the number of applications that establish and maintain MQTT persistent connections with the MQTT broker exceeds the preset number, the MQTT broker can no longer establish and maintain MQTT persistent connections with other applications.

[0271] After the application on the electronic device establishes and maintains an MQTT long connection with a certain MQTT broker in the broker cluster, the server 200 will record the correspondence between the application on the electronic device and a certain MQTT broker in the broker cluster, and obtain a routing table, which records the correspondence between each application and the MQTT broker with which the long connection is established.

[0272] Table 1

[0273] Labeling of electronic devices Application ID MQTT broker id Electronic devices 100 The id of the first application The id of the first MQTT broker Electronic equipment 200 The id of the second application The id of the second MQTT broker Electronic equipment 300 The id of the third application The id of the third MQTT broker

[0274] Table 1 shows a routing table stored in the server 200 .

[0275] Different applications installed on the same electronic device have different application IDs. The same application installed on different electronic devices also has different application IDs. In other words, different applications have different application IDs. The server 200 can uniquely determine which electronic device the application corresponding to the application ID is based on the application ID.

[0276] As shown in Table 1, the electronic device 100 has a first application installed, the first application is started and establishes an MQTT persistent connection with the first MQTT broker. The server 200 stores a correspondence between the id of the first application and the id of the first MQTT broker.

[0277] The electronic device 200 has a second application installed on it, which is started and establishes an MQTT persistent connection with the second MQTT broker. The server 200 stores a corresponding relationship between the id of the second application and the id of the second MQTT broker.

[0278] The electronic device 200 has a third application installed, which is started and establishes an MQTT persistent connection with a third MQTT broker. The server 200 stores a corresponding relationship between the id of the third application and the id of the third MQTT broker.

[0279] It should be noted that the server 200 may also store the corresponding relationship between the IDs of other applications and the MQTT brokers with which the MQTT persistent connections are established.

[0280] For example, Figure 7 As shown, the server 200 includes a first MQTT broker, a second MQTT broker and a third MQTT broker.

[0281] The first application in the electronic device 100 establishes and maintains an MQTT long connection with the first MQTT broker. The second application in the electronic device 100 establishes and maintains an MQTT long connection with the second MQTT broker. The third application in the electronic device 100 establishes and maintains an MQTT long connection with the third MQTT broker.

[0282] like Figure 7As shown, when the server 200 needs to send a first message to the first application on the electronic device 100, the message gateway module can first obtain the routing table, and obtain the ID of the MQTT broker1 from the routing table based on the ID of the first application. After that, the message gateway module sends the ID of the MQTT broker1 and the first message to the decision sending node. The decision sending node can send the ID of the first application and the first message to the MQTT broker1 based on the ID of the MQTT broker1. Since the MQTTbroker1 can establish an MQTT long connection with multiple applications, the MQTT broker1 can obtain the MQTT long connection between the MQTT broker1 and the first application based on the ID of the first application. And based on the MQTT long connection between the MQTT broker1 and the first application, the first message is sent to the first application on the electronic device 100.

[0283] In some embodiments, the first message sent by the server 200 to the first application on the electronic device 100 may be a message displayed in the first application after being actively queried by the user. Alternatively, the first message may be a message actively recommended by the server 200 to the user for viewing in the first application. The first message may be stored in the server 200.

[0284] After the first application on the electronic device obtains the first message, when the first application receives the user's operation to read the first message or forward the first message or collect the first message or comment on the first message, the first application on the electronic device 100 needs to send the reading status of the first message on the electronic device to the server 200, so that the server 200 can count the reading status of the first message by different users on different electronic devices, and display the reading status of the first message to the user for viewing.

[0285] The statistical results of the reading status of the first message include but are not limited to: the number of reads, the number of likes, the number of favorites, the number of comments, the number of reposts, etc.

[0286] The reading status of the first message includes but is not limited to: read, liked, collected, commented, forwarded, etc.

[0287] In order to enable the server 200 to timely count the reading status of the first message and display it to different users for viewing, the accuracy of the reading status statistics of the first message needs to be ensured. In this application, the server 200 adopts a hierarchical statistical structure to count the reading status of different messages.

[0288] like Figure 8 As shown, the server 200 is divided into a three-level structure, which is a high-speed statistics counting storage layer, a medium-speed statistics counting persistence layer and a low-speed statistics calculation layer.

[0289] Among them, the high-speed statistical counting storage layer can be an ultra-high-speed cache cluster, such as a redis cluster. The high-speed statistical counting storage layer can perform high-speed access and cache for the statistical results of the reading status of the message. And continue to provide electronic devices with ultra-high concurrency, low-latency statistical result modification, reading and other operations of the reading status of the message. In some embodiments, the high-speed statistical counting storage layer can perform cache periodic invalidation operations, such as periodically clearing data to free up memory. In other words, the high-speed statistical counting storage layer can provide fast statistical result calculation capabilities and statistical result reporting capabilities, so that electronic devices of different users can view the statistical results of the reading status of the message in a timely manner.

[0290] The high-speed statistical counting storage layer is not based on the statistical results of the reading status of the message calculated based on the original data, but is based on the statistical results obtained from the reading behavior of the reported messages of each electronic device. After the reading status of the first message displayed in the first application on the electronic device changes, the electronic device can send the reading behavior of the first message on the device and the original data of the reading behavior to the server 200. After the server 200 receives the reading behavior of the first message reported by the electronic device and the original data of the reading behavior, the high-speed statistical counting storage layer in the server 200 can update the statistical results of the reading status of the first message based on the reading behavior of the first message, without traversing the original data of the reading behavior of the first message, so the statistical speed will be very fast.

[0291] For example, after the user has read the first message on the electronic device, the electronic device 100 can send the read behavior of the first message and the raw data of the read behavior to the server 200. The high-speed statistical counting storage layer in the server 200 can add 1 to the number of reads of the first message based on the read behavior of the first message. In this way, the statistical result of the reading status of the message is quickly calculated. Among them, the raw data of the read behavior of the first message can include the read behavior when, where and on which device it occurred.

[0292] For another example, after the user forwards the first message on the electronic device, the electronic device 100 can send the forwarding behavior of the first message and the raw data of the forwarding behavior to the server 200. The high-speed statistical counting storage layer in the server 200 can add 1 to the forwarding number of the first message based on the forwarding behavior of the first message. In this way, the statistical result of the reading status of the message is quickly calculated. Among them, the raw data of the forwarding behavior of the first message can include when, where and on which device the forwarding behavior occurred.

[0293] The medium-speed statistics and counting persistence layer can be a mongo cluster, which is used to provide a persistent statistical result storage. The medium-speed statistics and counting persistence layer will not directly report the statistical results of the message reading status to the electronic device. The statistical results of the message reading status of the medium-speed statistics and counting persistence layer are executed asynchronously through the message queue. Because the data statistics change itself is executed asynchronously, the correct final consistency of the statistical data can be achieved.

[0294] The low-speed statistical calculation layer does not have storage capabilities. Instead, it is composed of plug-in business calculation logic. The function of the low-speed statistical calculation layer is to calculate the statistical results of the reading status of each type of message based on the original data. Since the low-speed statistical calculation layer is calculated based on the original data, it has the highest accuracy, but the speed is slow. It is used to ensure the correctness of the statistical results of the reading status of the message in the entire hierarchical statistical structure.

[0295] The low-speed statistical calculation layer is a statistical result of the reading status of the message calculated based on the original data, and is a statistical result obtained based on the original data of the reading behavior of the message reported by each electronic device. After the reading status of the first message displayed in the first application on the electronic device changes, the electronic device can send the reading behavior of the first message on the device and the original data of the reading behavior to the server 200. After the server 200 receives the reading behavior of the first message reported by the electronic device and the original data of the reading behavior, the low-speed statistical calculation layer in the server 200 can update the statistical result of the reading status of the first message based on the original data of the reading behavior of the first message. Since the original data of the reading behavior of many messages is stored on the server 200, the low-speed statistical calculation layer needs to traverse the original data of the reading behavior of each message in turn, which will result in a slower statistical speed but more accurate results.

[0296] For example, after the user has read the first message on the electronic device, the electronic device 100 may send the read behavior of the first message and the raw data of the read behavior to the server 200. The low-speed statistical calculation layer in the server 200 may add 1 to the number of reads of the first message based on the raw data of the read behavior of the first message. In this way, the statistical result of the reading status of the message obtained based on the raw data improves the accuracy of the statistical result. Among them, the raw data of the read behavior of the first message may include the read behavior occurred at what time, where and on which device.

[0297] For another example, after the user forwards the first message on the electronic device, the electronic device 100 can send the forwarding behavior of the first message and the raw data of the forwarding behavior to the server 200. The low-speed statistical calculation layer in the server 200 can add 1 to the forwarding number of the first message based on the raw data of the forwarding behavior of the first message. In this way, the statistical result of the reading status of the message obtained based on the raw data improves the accuracy of the statistical result. Among them, the raw data of the forwarding behavior of the first message can include when, where and on which device the forwarding behavior occurred.

[0298] The coordination process of the high-speed statistics counting storage layer, the medium-speed statistics counting persistence layer and the low-speed statistics calculation layer is as follows: First, the low-speed statistics calculation layer can obtain the first statistical result of the message reading status based on the original data of the message reading behavior. The low-speed statistics calculation layer then sends the first statistical result of the message reading status to the medium-speed statistics counting persistence layer, and the medium-speed statistics counting persistence layer can save the first statistical result of the message reading status. For example, the medium-speed statistics counting persistence layer can write the first statistical result of the message reading status to the disk to prevent loss.

[0299] The high-speed statistics and counting storage layer can obtain the statistical result of the reading status of the message based on the reading line of the message. The high-speed statistics and counting storage layer can save the second statistical result of the reading status of the message. For example, the high-speed statistics and counting storage layer can write the second statistical result of the reading status of the message into the memory. At the same time, the high-speed statistics and counting storage layer will also send the second statistical result of the reading status of the message to the message queue, and then the message queue will send it to the medium-speed statistics and counting persistence layer. The medium-speed statistics and counting persistence layer can save the second statistical result of the reading status of the message. In order to avoid the high-speed statistics and counting storage layer losing the second statistical result of the reading status of the message, the second statistical result of the reading status of the message can be quickly obtained from the medium-speed statistics and counting persistence layer.

[0300] In some embodiments, the high-speed statistics counting storage layer can perform cache expiration invalidation, that is, clear the data in the memory at irregular intervals / at certain time intervals. After the data in the memory is cleared, the second statistical result cached in the memory by the high-speed statistics counting storage layer is also gone. In this case, in order to enable the high-speed statistics counting storage layer to quickly obtain the statistical results of the reading status of the message and send the statistical results of the reading status of the message to each electronic device, the high-speed statistics counting storage layer can send a cache expiration invalidation message to the message queue. On the one hand, the message queue will send the cache expiration invalidation message to the medium-speed statistics counting persistence layer. In response to the cache expiration invalidation message, the medium-speed statistics counting persistence layer can obtain the second statistical result of the reading status of the stored message and send the second statistical result of the reading status of the message to the high-speed statistics counting storage layer, so that the high-speed statistics counting storage layer can quickly obtain the statistical results of the reading status of the message. On the other hand, the message queue will send the recalculated statistical results to the low-speed statistical calculation layer. In response to the recalculated statistical results, the low-speed statistical calculation layer can recalculate the first statistical result of the reading status of the message based on the original data, and send the recalculated first statistical result of the reading status of the message to the medium-speed statistical counting persistence layer. The medium-speed statistical counting persistence layer can store the recalculated first statistical result of the reading status of the message, so that the medium-speed statistical counting persistence layer stores accurate statistical results.

[0301] In some embodiments, the medium-speed statistical counting persistence layer may also compare a first statistical result of a stored message reading status with a second statistical result of the message reading status. When the difference between the second statistical result of the message reading status and the first statistical result of the message reading status is greater than a preset value, the medium-speed statistical counting persistence layer may update the second statistical result based on the first statistical result, and report the updated second statistical result to the high-speed statistical counting storage layer, so that the high-speed statistical counting storage layer can obtain accurate statistical results, thereby ensuring the accuracy of the statistical results sent by the server 200 to the user's electronic device.

[0302] Through the above three-level structure, the accuracy of the statistical results of the reading status of the message is guaranteed, and the statistical results of the reading status of the message can be quickly counted to meet the capabilities of high-speed access and counting changes.

[0303] The various implementation modes of the present application can be combined arbitrarily to achieve different technical effects.

[0304] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)), etc.

[0305] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.

[0306] In short, the above description is only an embodiment of the technical solution of the present invention, and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made according to the disclosure of the present invention shall be included in the protection scope of the present invention.

Claims

1. An application message notification system, characterized in that: The system includes an electronic device and a first server. A first application is installed on the electronic device. The first server is a background server of the first application. A first push connection is established between the electronic device and the first server. The first server is used to obtain a first message; The first server is further configured to send the first message to the first application on the electronic device through the first persistent connection between the first application and the first server when a persistent connection is established with the first application on the electronic device; The electronic device is configured to receive the first message through the first persistent connection; The electronic device is further used for: Acquire a first message display rule through the first application, and determine a first display form of the first application based on the first message display rule, wherein the first message display rule defines display forms of different types of messages in the first application under different running states of the first application; Based on the first display form, display the first message; The first display mode includes foreground display or background display.

2. The system according to claim 1, characterized in that The first server is further configured to send the first message to the electronic device through the first push connection when no persistent connection is established with the first application on the electronic device; The electronic device is further used for: receiving the first message through the first push connection; The first message is displayed in the foreground.

3. The system according to claim 1 or 2, characterized in that: The system further includes a second server, a second application is also installed on the electronic device, the second server is a background server of the second application, and a second push connection is established between the electronic device and the second server, wherein: The second server is used to obtain a second message; The second server is further configured to send the second message to the second application on the electronic device through a second long connection between the second application and the second server when a long connection is established with the second application on the electronic device; The electronic device is configured to receive the second message through the second long connection; The electronic device is further used for: Acquire a second message display rule through the second application, and determine a second display form of the second message based on the second message display rule, wherein the second message display rule defines display forms of different types of messages in the second application under different running states of the first application; Based on the second display form, display the second message; The second display mode includes foreground display or background display.

4. The system according to claim 3, characterized in that The second application is different from the first application, and the first message display rule is different from the second message display rule.

5. The system according to claim 3, characterized in that The second application is different from the first application, and the first message display rule is the same as the second message display rule.

6. The system according to any one of claims 1 to 5, characterized in that: The electronic device is specifically used for: Acquire the first message display rule through the first application, and acquire the running state of the first application and the message type of the first message; The first display form of the first message is determined by the first application based on the first message display rule, the running state of the first application, and the message type of the first message.

7. The system according to any one of claims 1 to 6, characterized in that: The first server includes a plurality of brokers, the plurality of brokers includes a first broker, and a long connection between a first application on the electronic device and the first broker is the first long connection; a first routing table is stored in the first server, and a correspondence between an application identifier and an identifier of a broker connected to the application is stored in the first routing table, and the correspondence between the application identifier and the broker connected to the application includes a correspondence between an application identifier of the first application and an identifier of the first broker; The first server is specifically used for: Obtaining the first routing table; Acquire the identifier of the first broker from the first routing table based on the identifier of the first application; The first message is sent to the first application on the electronic device through the first broker based on the first long connection.

8. The system according to claim 3, characterized in that The first server includes a plurality of brokers, the plurality of brokers include a second broker, and the long connection between the second application on the electronic device and the second broker is the second long connection; the first server stores a second routing table, the second routing table stores a correspondence between an application identifier and an identifier of a broker connected to the application, and the correspondence between the application identifier and the broker connected to the application includes a correspondence between an application identifier of the second application and an identifier of the second broker; The first server is specifically used for: Obtaining the second routing table; Acquire the identifier of the second broker from the second routing table based on the identifier of the second application; The second message is sent to a second application on the electronic device through the second broker based on the second long connection.

9. The system according to any one of claims 1 to 8, characterized in that: The first server includes a plurality of servers, and the plurality of servers include a high-speed statistics counting storage server, a medium-speed statistics counting persistence server, and a low-speed statistics calculation server; The electronic device is further used to send the reading behavior of the first message and the original data of the reading behavior to the first server; The first server is further used for: Obtaining, by the low-speed statistical calculation server, a first statistical result of the reading status of the first message based on the original data of the reading behavior; caching a first statistical result of the reading status of the first message by the medium-speed statistical counting persistent server; Updating a second statistical result of the reading status of the first message based on the reading behavior of the first message by the high-speed statistical counting storage server; The medium-speed statistical counting persistent server caches the second statistical result of the reading status of the first message.

10. The system according to claim 9, characterized in that The first server is further configured to reacquire the first statistical result of the reading status of the first message from the medium-speed statistical counting persistent server after the high-speed statistical counting storage server loses the first statistical result of the reading status of the first message.

11. The system according to claim 9 or 10, characterized in that: The calculation speed of the high-speed statistics counting storage server is greater than the calculation speed of the medium-speed statistics counting persistent server, and the calculation speed of the medium-speed statistics counting persistent server is greater than the calculation speed of the low-speed statistics calculation server.

12. The system according to any one of claims 1 to 11, characterized in that: The foreground display method includes any one of the following: pop-up window display, and display in a pull-down notification bar.

13. An application message notification method, characterized in that: The method comprises: The first server obtains a first message of the first application; In a case where a long connection is established between the first server and a first application on the electronic device, the first server sends the first message to the first application on the electronic device through the first long connection between the first server and the first application on the electronic device, where the first message is used for the first application on the electronic device to determine a first display form of the first application based on a first message display rule, and to display the first message based on the first display form; The first message display rule defines the display forms of different types of messages in the first application under different running states of the first application; The first display mode includes foreground display or background display.

14. The method according to claim 13, characterized in that The first server and the electronic device establish a first push connection, and the method further includes: When the first server has not established a long connection with the first application on the electronic device, the first message is sent to the electronic device through the first push connection, and the first message is used by the first application on the electronic device to display the first message in the foreground of the electronic device.

15. The method according to claim 13 or 14, characterized in that The first server includes a plurality of brokers, the plurality of brokers includes a first broker, and a long connection between a first application on the electronic device and the first broker is the first long connection; a first routing table is stored in the first server, and a correspondence between an application identifier and an identifier of a broker connected to the application is stored in the first routing table, and the correspondence between the application identifier and the broker connected to the application includes a correspondence between an application identifier of the first application and an identifier of the first broker; The first server sends the first message to the first application on the electronic device through a first persistent connection between the first server and the first application on the electronic device, specifically including: The first server obtains the first routing table; The first server obtains the identifier of the first broker from the first routing table based on the identifier of the first application; The first server sends the first message to the first application on the electronic device through the first broker based on the first long connection.

16. The method according to any one of claims 13 to 15, characterized in that: The first server includes a plurality of servers, and the plurality of servers include a high-speed statistics counting storage server, a medium-speed statistics counting persistence server, and a low-speed statistics calculation server; After the first server sends the first message to the first application on the electronic device through the first long connection between the first server and the first application on the electronic device, the method further includes: The first server receives the reading behavior of the first message sent by the electronic device and the original data of the reading behavior; The first server obtains a first statistical result of the reading status of the first message based on the original data of the reading behavior through the low-speed statistical calculation server; The first server caches a first statistical result of the reading status of the first message through the medium-speed statistical counting persistent server; The first server updates a second statistical result of the reading status of the first message based on the reading behavior of the first message through the high-speed statistical counting storage server; The first server caches the second statistical result of the reading status of the first message through the medium-speed statistical counting persistent server.

17. The method according to claim 16, characterized in that The method further comprises: After the high-speed statistics counting storage server loses the first statistics result of the reading status of the first message, the first server re-acquires the first statistics result of the reading status of the first message from the medium-speed statistics counting persistence server.

18. The method according to claim 16 or 17, characterized in that The calculation speed of the high-speed statistics counting storage server is greater than the calculation speed of the medium-speed statistics counting persistent server, and the calculation speed of the medium-speed statistics counting persistent server is greater than the calculation speed of the low-speed statistics calculation server.

19. The method according to any one of claims 13 to 18, characterized in that: The foreground display method includes any one of the following: pop-up window display, and display in a pull-down notification bar.

20. An application message notification method, characterized in that: The method comprises: In a case where a first application on the electronic device has established a persistent connection with a first server, the electronic device receives a first message sent by the first server through a first persistent connection between the first application on the electronic device and the first server; The electronic device obtains a first message display rule through the first application, and determines a first display form of the first application based on the first message display rule, wherein the first message display rule defines display forms of different types of messages in the first application under different running states of the first application; The electronic device displays the first message based on the first display form through the first application; The first display mode includes foreground display or background display.

21. The method according to claim 20, characterized in that The electronic device and the first server establish a first push connection, and the method further includes: When the first application on the electronic device has not established a persistent connection with the first server, the electronic device receives the first message sent by the first server through the first push connection; The electronic device displays the first message in the foreground.

22. The method according to claim 20 or 21, characterized in that In a case where a persistent connection is established between the second application on the electronic device and the second server, the electronic device receives a second message sent by the second server through a second persistent connection between the second application on the electronic device and the second server; The electronic device obtains a second message display rule through the second application, and determines a second display form of the second message based on the second message display rule, wherein the second message display rule defines display forms of different types of messages in the second application under different running states of the second application; The electronic device displays the second message based on the second display form through the second application; The second display mode includes foreground display or background display.

23. The method according to claim 22, characterized in that The second application is different from the first application, and the first message display rule is different from the second message display rule.

24. The method according to claim 22, characterized in that The second application is different from the first application, and the first message display rule is the same as the second message display rule.

25. The method according to any one of claims 20 to 24, characterized in that: The electronic device acquires a first message display rule through the first application, and determines a first display form of the first application based on the first message display rule, specifically including: The electronic device obtains the first message display rule through the first application, and obtains the running state of the first application and the message type of the first message; The electronic device determines the first display form of the first message through the first application based on the first message display rule, the running state of the first application, and the message type of the first message.

26. The method according to any one of claims 20 to 24, characterized in that: The first server includes a plurality of brokers, the plurality of brokers includes a first broker, and a long connection between a first application on the electronic device and the first broker is the first long connection; The electronic device receives a first message sent by the first server through a first persistent connection between the first application on the electronic device and the first server, specifically including: The electronic device receives the first message sent by the first broker through the first long connection between the first application on the electronic device and the first broker.

27. The method according to claim 22, characterized in that The first server includes a plurality of brokers, the plurality of brokers include a second broker, and the long connection between the first application on the electronic device and the second broker is the second long connection; The electronic device receives a second message sent by the second server through a second persistent connection between the second application on the electronic device and the second server, specifically including: The electronic device receives the second message sent by the second broker through the second long connection between the second application on the electronic device and the second broker.

28. The system according to any one of claims 20 to 27, characterized in that: The foreground display method includes any one of the following: pop-up window display, and display in a pull-down notification bar.

29. An electronic device, characterized in that: It comprises one or more processors and one or more memories; wherein, the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, and the computer program code includes computer instructions, and when the one or more processors execute the computer instructions, the method as described in any one of claims 20-28 is executed.

30. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the method according to any one of claims 20 to 28 is executed.

Citation Information

Patent Citations

  • Message display method and message display terminal device

    CN109218410A

  • Notification message display method and device, terminal and storage medium

    CN110955471A

  • Message notification method and device and electronic equipment

    CN112416202A