[go: up one dir, main page]

CN111343045B - Method and device for adjusting heartbeat frequency - Google Patents

Method and device for adjusting heartbeat frequency Download PDF

Info

Publication number
CN111343045B
CN111343045B CN202010092415.1A CN202010092415A CN111343045B CN 111343045 B CN111343045 B CN 111343045B CN 202010092415 A CN202010092415 A CN 202010092415A CN 111343045 B CN111343045 B CN 111343045B
Authority
CN
China
Prior art keywords
service
server
log data
terminal
heartbeat frequency
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010092415.1A
Other languages
Chinese (zh)
Other versions
CN111343045A (en
Inventor
裴运波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Jukanyun Technology Co ltd
Original Assignee
Qingdao Jukanyun Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qingdao Jukanyun Technology Co ltd filed Critical Qingdao Jukanyun Technology Co ltd
Priority to CN202010092415.1A priority Critical patent/CN111343045B/en
Publication of CN111343045A publication Critical patent/CN111343045A/en
Application granted granted Critical
Publication of CN111343045B publication Critical patent/CN111343045B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The application discloses a heartbeat frequency adjusting method and a server, and belongs to the field of communication of the Internet of things. In the application, the server may obtain subscription service information of the first terminal, obtain target log data associated with a service indicated by the subscription service information from the plurality of log data according to the subscription service information, estimate a push probability of the service message according to the target log data, and then adjust a heartbeat frequency according to the push probability. Therefore, the center hop frequency can be adjusted according to the push probability, and compared with the fixed heartbeat frequency adopted in the related technology all the time, the problems that when the adopted heartbeat frequency is high, the load pressure of a server is too high, and the consumed flow is too high can be avoided. Meanwhile, the problem that whether the connection is available or not cannot be detected in time when the adopted heartbeat frequency is low so that the arrival rate of message pushing is low can be solved.

Description

Method and device for adjusting heartbeat frequency
Technical Field
The application relates to the field of communication of the Internet of things, in particular to a method and a server for adjusting heartbeat frequency.
Background
In an internet of things environment, a server pushes a message to a terminal by establishing a TCP (Transmission Control Protocol) connection with the terminal. When the network environment is unstable, the TCP connection between the terminal and the server is easily unstable, and thus the message pushed to the terminal by the server may not reach the terminal. Based on this, a mechanism for detecting a connection state is defined in the current TCP protocol to detect whether a TCP connection between the server and the terminal is available.
In the related art, when a TCP connection between a server and a terminal is established, a heartbeat detection frequency and a reference threshold may be set. In this way, after establishing the TCP connection, the server may send a heartbeat request to the terminal through the TCP connection according to the set heartbeat detection frequency. The terminal may send a heartbeat response to the server through the TCP connection after receiving the heartbeat request, and if the server does not receive the heartbeat response sent by the terminal for a number of times that continuously exceeds the reference threshold, the server may determine that the TCP connection with the terminal is unavailable.
Disclosure of Invention
The embodiment of the application provides a method for adjusting heartbeat frequency, a server and a storage medium. The technical scheme is as follows:
in a first aspect, a method for adjusting a heartbeat frequency is provided, the method including:
obtaining subscription service information of a first terminal, wherein the subscription service information is used for indicating a server to provide services for the first terminal;
acquiring target log data associated with the service indicated by the subscription service information from a plurality of log data according to the subscription service information;
estimating the pushing probability of a service message according to the target log data, wherein the service message is a message corresponding to the service provided for the first terminal;
And adjusting the heartbeat frequency according to the push probability, wherein the push probability and the heartbeat frequency are in positive correlation.
In a second aspect, a server is provided, the server comprising:
the server comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring subscription service information of a first terminal, and the subscription service information is used for indicating the server to provide services for the first terminal;
the acquisition module is further used for acquiring target log data associated with the service indicated by the subscription service information from a plurality of log data according to the subscription service information;
the pre-estimation module is used for pre-estimating the pushing probability of a service message according to the target log data, wherein the service message is a message corresponding to the service provided for the first terminal;
and the adjusting module is further used for adjusting the heartbeat frequency according to the pushing probability, wherein the pushing probability and the heartbeat frequency are in positive correlation.
In a third aspect, a computer-readable storage medium is provided, in which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for adjusting a heartbeat frequency as provided above.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
In the embodiment of the application, the heartbeat frequency can be adjusted according to the push probability by acquiring the target log data and pre-estimating the push probability of pushing the service message to the first terminal according to the target log data. Therefore, the center hop frequency can be adjusted according to the push probability, and compared with the fixed heartbeat frequency adopted in the related technology all the time, the problems that when the adopted heartbeat frequency is high, the load pressure of a server is too high, and the consumed flow is too high can be avoided. Meanwhile, the problem that whether the connection is available or not cannot be detected in time when the adopted heartbeat frequency is low so that the arrival rate of message pushing is low can be solved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a system architecture diagram according to a method for adjusting a heartbeat frequency provided by an embodiment of the present application;
Fig. 2 is a flowchart of a method for adjusting a heartbeat frequency according to an embodiment of the present application;
FIG. 3 is a flowchart of another method for adjusting a heartbeat frequency according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a server according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of another server provided in the embodiment of the present application;
fig. 6 is a schematic structural diagram of another server provided in the embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the exemplary embodiments of the present application clearer, the technical solutions in the exemplary embodiments of the present application will be clearly and completely described below with reference to the drawings in the exemplary embodiments of the present application, and it is obvious that the described exemplary embodiments are only a part of the embodiments of the present application, but not all the embodiments.
All other embodiments, which can be derived by a person skilled in the art from the exemplary embodiments shown in the present application without inventive effort, shall fall within the scope of protection of the present application. Moreover, while the disclosure herein has been presented in terms of exemplary one or more examples, it is to be understood that each aspect of the disclosure can be utilized independently and separately from other aspects of the disclosure to provide a complete disclosure.
It should be understood that the terms "first," "second," "third," and the like in the description and claims of this application and in the foregoing drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used are interchangeable under appropriate circumstances and can, for example, be implemented in sequences other than those illustrated or otherwise described herein with reference to the embodiments of the application.
Furthermore, the terms "comprises" and "comprising," as well as any variations thereof, are intended to cover a non-exclusive inclusion, such that a product or device that comprises a list of elements is not necessarily limited to those elements explicitly listed, but may include other elements not expressly listed or inherent to such product or device.
The term module, as used herein, refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware or/and software code that is capable of performing the functionality associated with that element.
Before explaining the embodiments of the present application in detail, an application scenario of the embodiments of the present application is explained first. With the development of networks, a terminal may subscribe to various services from a server, and then the server may push a service message corresponding to the subscribed service to the terminal. Since an available connection must be established between the server and the terminal, the service messages pushed by the server can reach the terminal. Therefore, in order to avoid that a service message cannot reach the terminal due to the unavailability of the connection between the server and the terminal, the server may detect whether the connection between the server and the terminal is available by sending a heartbeat request. The method for adjusting the heartbeat frequency, provided by the embodiment of the application, can be used for adjusting the heartbeat frequency by predicting the probability of the server for pushing the message to the terminal in the scene so as to detect whether the connection between the server and the terminal is available in time, thereby ensuring that the pushed service message can successfully reach the terminal.
Next, a system architecture related to a method for adjusting a heartbeat frequency provided in an embodiment of the present application is described.
Fig. 1 is a system architecture diagram of a method for adjusting a heartbeat frequency according to an embodiment of the present disclosure. As shown in fig. 1, the system 100 includes a first terminal 101, a server 102, and a second terminal 103. The first terminal 101, the server 102, and the second terminal 103 are connected in a wireless or wired manner to communicate with each other.
The first terminal 101 may subscribe to the service from the server 102 by sending subscription service information corresponding to the subscription service to the server 102. Thereafter, the first terminal 101 may receive a service message corresponding to the subscribed service sent by the server 102.
The server 102 may receive the subscription service information sent by the first terminal 101, and determine the service subscribed by the first terminal 101 according to the subscription service information. Meanwhile, the server 102 may also receive log data sent by the second terminal 103, and analyze and process the log data according to the subscription service information to obtain target log data related to the service subscribed by the first terminal 101. Then, the probability of pushing the service message to the first terminal 101 may be estimated according to the target log data, and further, the heartbeat frequency may be adjusted according to the pushing probability. When the push time of the service message is reached, the server may push the service message corresponding to the service to the first terminal 101.
The second terminal 103 may send log data to the server 102 in real time after being powered on, where the log data may be classified into operation-type log data, background-type log data, view-type log data, and the like according to data types. Of course, the log data may also include application log data corresponding to different applications.
Optionally, the first terminal 101 and the second terminal 103 may be interchanged. That is, the second terminal 103 may subscribe to the service from the server 102 by transmitting subscription service information to the server 102 to subscribe to the service from the server 102. Thereafter, the second terminal 103 may receive a service message corresponding to the subscribed service sent by the server 102. The first terminal 101 may send log data to the server 102 in real time after being powered on, where the log data includes log data of a monitoring application, log data of a remote control application, log data of a video call application, and the like. In this case, the server 102 may receive the subscription service information sent by the second terminal 103 and the log data sent by the first terminal 101, and analyze and process the log data according to the subscription service information to obtain target log data related to the service subscribed by the second terminal 103. Then, the probability of pushing the service message to the second terminal 103 may be estimated according to the target log data, and further, the heartbeat frequency may be adjusted according to the pushing probability. When the push time of the service message is reached, the server 102 may push the service message corresponding to the service to the second terminal 103.
In this embodiment, the first terminal 101 may be a device such as a smart phone and a computer, the server 102 may be a server or a server cluster for adjusting the heartbeat frequency, and the second terminal 103 may be a device such as a television and a computer, which is not limited in this embodiment.
The system architecture described above is only a system architecture under one possible scenario given in the embodiments of the present application. In some scenarios, the first terminal 101 and the second terminal 103 may be the same device. In this case, the device may subscribe to the corresponding service by transmitting subscription service information to the server 102, and transmit log data to the server 102 in real time after power-on. The server 102 may estimate a push probability of pushing the service message to the device by using the method provided in the embodiment of the present application, and further adjust a heartbeat frequency between the server and the device according to the push probability. Thereafter, when the push time of the service message is reached, the server 102 may send the service message corresponding to the service to the device, and the device may receive the service message sent by the server 102. Of course, in other scenarios, the system architecture may be other, and this is not limited in this embodiment of the present application.
Next, a method for adjusting a heartbeat frequency provided in an embodiment of the present application is described.
Fig. 2 is a flowchart of a method for adjusting a heartbeat frequency according to an embodiment of the present application, where the method may be applied to a server, which may be referred to as the server 102 in fig. 1. As shown in fig. 2, the method comprises the steps of:
step 201: and acquiring the subscription service information of the first terminal.
In the embodiment of the application, a TCP connection may be established between the server and the first terminal, and after the TCP connection is successfully established, the server may receive the subscription service information sent by the first terminal through the TCP connection, and subsequent information interaction between the server and the first terminal may also be performed through the TCP connection. The subscription service information is used for indicating the service provided by the server for the first terminal.
It should be noted that the server may provide a plurality of services to the first terminal, and each service in the plurality of services may be indicated by one piece of subscription service information, that is, the server may determine the service subscribed by the first terminal according to the received subscription service information.
The subscription service information may include any one of a subscription service type and a subscription service identifier. The subscription service type is used to indicate a service type corresponding to a service subscribed by the first terminal, in this case, the service subscribed by the first terminal does not have a corresponding application in the second terminal, and the subscription service type may be used to indicate the second terminal to subsequently acquire data related to the service from log data of various data types uploaded by the second terminal. The subscribed service identifier is used to indicate a service identifier corresponding to a service subscribed by the first terminal, in this case, the service subscribed by the first terminal corresponds to an application in the second terminal, and the subscribed service identifier may be used to indicate an application corresponding to the service in the second terminal. The server may subsequently obtain the application log data of the application indicated by the subscription service identifier from the application log data of each application reported by the second terminal.
For example, it is assumed that the server may provide a viewing behavior monitoring service for the first terminal, and the second terminal is a smart tv, where there is no monitoring application for providing data related to the monitoring service for the smart tv. At this time, the subscription service information sent by the first terminal may include a subscription service type: watching behavior monitoring (watching viewer monitoring). According to the subscription service type, the server may determine that the service to which the first terminal is subscribed is the viewing behavior monitoring service, that is, the subscription service type is used to indicate that the type of the service that the server is to provide to the first terminal is the viewing behavior monitoring. Subsequently, the server may obtain log data related to the viewing behavior from log data of various data types reported by the second terminal according to the subscription service type.
For another example, assume that the server may provide a video call service for the first terminal. The second terminal has the video call application installed therein, and at this time, the subscription service information sent by the first terminal may include a subscription service identifier: a Video call (Video call), the subscription service identification may be used to indicate an application that the second terminal uses to provide Video calls. The server can determine that the service to which the first terminal subscribes is the video call service according to the subscription service identifier. The subsequent server can obtain the application log data of the video call application from the application log data of each application reported by the second terminal.
Optionally, each of the plurality of services provided by the server for the first terminal may correspond to an application. That is, the first terminal may send subscription service information to the server through a certain installed application, and in this case, the server may determine, according to the subscription service information, which service corresponds to the application provided for the first terminal. And after subscribing to the service corresponding to the application, the first terminal may receive, in the application interface of the application, configuration information of the subscribed service input by the user, and send the configuration information to the server.
For example, if the monitoring application is installed in the first terminal, the subscription service information including the subscription service type of watching viewer monitoring may be sent to the server through the monitoring application, so as to subscribe to the viewing behavior monitoring service. Then, the configuration may be performed in a configuration interface provided by the monitoring application, where the configuration interface includes a plurality of configuration items, such as a monitoring channel, a monitoring duration, and the like. The user can input configuration information in each configuration item in the configuration interface, and the first terminal can send the configuration information to the server, for example, the configuration information may be that the juvenile channel is monitored, the monitoring watching time length does not exceed 30 minutes, the monitoring watching time length of the juvenile channel does not exceed 30 minutes, and the like.
It should be noted that the server may further receive log data sent by a second terminal, where the second terminal is another terminal corresponding to the service provided by the server. The second terminal can send log data to the server in real time after being started, and the log data can include any plurality of contents such as time, data types, application identifications and operations.
Optionally, in the embodiment of the present application, the first terminal and the second terminal are only used as different terminals for example, that is, the service subscriber terminal and the log data report terminal are different. In some embodiments, the service subscriber and the log reporting terminal may be the same terminal, that is, the first terminal and the second terminal may be the same terminal, which is not limited herein in this embodiment of the present application.
Step 202: and acquiring target log data associated with the service indicated by the subscription service information from the plurality of log data according to the subscription service information.
After receiving the subscription service information of the first terminal, the server may obtain, from the plurality of log data, target log data associated with a service indicated by the subscription service information according to the received subscription service information.
In some embodiments, the subscription service information received by the server includes a subscription service type, so that the server may obtain a target data type corresponding to the subscription service type from a mapping relationship between the service type and the data type, further obtain log data with the data type being the target data type from a plurality of log data, and use the obtained log data as the target log data.
It should be noted that the server may store a first mapping table in which a plurality of subscription service types correspond to a plurality of data types. Based on this, the server may search in the first mapping relation table according to the subscription service type included in the received subscription service information, obtain the data type corresponding to the subscription service type, and use the data type as the target data type.
For example, the subscription service information received by the server includes subscription service type watching follower monitoring, and then the server may search in the first mapping relationship table according to the subscription service type watching follower monitoring, and if the data type corresponding to the subscription service type watching follower monitoring is found to be Watch, the Watch may be used as the target data type.
Next, the server may compare the target data type with a data type of each of the received plurality of log data, acquire log data having a data type identical to the target data type from the plurality of log data, and take the acquired log data as the target log data.
Illustratively, continuing with the aforementioned target data type Watch as an example, the data types of the log data include an Operation type, a Backstage type, a Watch type, and the like. The server may obtain log data of which the data type is the Watch type from the plurality of log data according to the target data type Watch, and use the obtained log data as the target log data.
Optionally, if the server further receives configuration information of a service to be subscribed, which is sent by the first terminal, or default service configuration information is stored in the server, the server may further filter the obtained data of the target data type according to the configuration information. For example, for the viewing behavior monitoring service, assuming that the configuration information includes the monitoring channel, the server may further obtain log data of the target monitoring channel from the obtained data of the target data type as target log data.
In other embodiments, the subscription service information received by the server includes a subscription service identifier, so that the server may obtain a target application identifier corresponding to the subscription service identifier from a mapping relationship between the service identifier and the application identifier, further obtain log data of a target application identified by the target application identifier from the plurality of log data, and use the obtained log data as target log data.
It should be noted that, a second mapping relationship table of a plurality of subscription service identifiers and a plurality of application identifiers may be stored in the server. The server may obtain the target application identifier from the second mapping relationship table according to the subscription service identifier, and obtain the target log data from the plurality of log data according to the target application identifier. The method for obtaining the target application identifier and the target log data is the same as the aforementioned method for obtaining the target data type and the target log data according to the subscription service type, and is not described herein again.
Exemplarily, the subscription service information received by the server includes a subscription service identifier Video call, and then, the server may perform lookup in the second mapping relationship table according to the subscription service identifier Video call to obtain an application identifier corresponding to the subscription service identifier Video call as a Video call, and then may use the Video call as a target application identifier.
At this time, the plurality of log data include log data of a plurality of applications, and the log data of each application includes an application identifier of the application, for example, the log data of the chat application includes an application identifier Talk of the chat application, the log data of the Music application includes an application identifier Music of the Music application, the log data of the Video call application includes an application identifier Video call of the Video call application, and the like. The server may obtain, according to the target application identifier Video call, log data with an application identifier being the Video call from the plurality of log data, that is, obtain the log data of the target application Video call application identified by the target application identifier. Then, the acquired log data is set as target log data.
Step 203: and estimating the pushing probability of the service message according to the target log data.
After obtaining the target log data, the server may determine a current service progress according to the target log data, and estimate a push probability of the service message according to the current service progress. The current service progress refers to the progress of the service corresponding to the target log data, and the service message refers to a message corresponding to the service provided for the first terminal.
In the embodiment of the application, indexes for indicating the service progress can be different for different services, and based on the indexes, the server can determine the current service progress through the following method according to the service subscribed by the first terminal and the acquired target log data, and further estimate the push probability of the service message according to the current service progress.
In one possible scenario, the service progress may be indicated by a service duration. In this case, the server may store a total service duration subscribed by the first terminal, where the total service duration may be a service duration included in the configuration information of the subscription service sent by the first terminal, or may be a duration configured by default in the server. After the server acquires the target log data, the server can determine the current service duration according to the time included in the target log data, and estimate the push probability of the service message according to the current service duration and the total service duration.
After the server acquires the target log data, the server may record the target log data, and if the target log data is the first target log data associated with the service indicated by the subscription service information acquired by the server, at this time, the server may use the time included in the target data as the time for starting the service indicated by the subscription service information.
Then, each time the server obtains one target log data, the time difference between the currently obtained target log data and the first target log data can be obtained by subtracting the time in the first target log data from the time in the currently obtained target log data, the time difference is used as the current service time length, the proportion of the current service time length to the total service time length is calculated, and the push probability of the service message is estimated according to the proportion.
It should be noted that, a mapping relation table between the service duration ratio and the push probability may be stored in the server. After the current service duration is determined, a first ratio of the current service duration to the total service duration can be calculated according to the current service duration and the total service duration, then, the mapping relation table is searched according to the first ratio, and if the ratio which is the same as the first ratio is searched, the push probability corresponding to the ratio is used as the estimated push probability. If the proportion same as the first proportion is not found, the push probability of the service message can be estimated through a difference method according to the service duration proportion stored in the mapping relation table and the push probability corresponding to the service duration proportion.
Optionally, the server may further store a first reference threshold of the mapping relation table. When the same proportion is not found in the mapping relation table, if a difference between the first proportion and a certain proportion in the mapping relation table is smaller than or equal to a first reference threshold, at this time, the push probability corresponding to the proportion can also be used as the estimated push probability.
Illustratively, for example, the subscribed service is a viewing behavior monitoring service, and the configuration information is that the monitoring viewing duration does not exceed 30 minutes, that is, the total duration of the service is 30 minutes, the mapping relation table of the service duration proportion and the push probability stored by the server is table 1 below, and the first reference threshold is 5%. The target log data obtained by the server according to the target data type Watch is shown in table 2 below. The first target log data obtained by the server is target log data 1, which includes times 2019.11.15-19:26, and 2019.11.15-19:26 is the time of service start for which the monitoring viewing duration does not exceed 30 minutes. When the server acquires the target log data 2, the time difference 1 obtained by subtracting the time included in the target log data 1 from the time included in the target log data 2 is 10 minutes, that is, the current viewing duration is 10 minutes, and the first proportion of the time difference 1 in the total service duration is calculated to be 33%, because the proportion corresponding to the first proportion of 33% is not found in table 1, and the proportion different from the first proportion by less than or equal to 5% does not exist, the push probability 1 can be estimated to be 20% according to the proportions of 50% and 80% and the push probabilities of 30% and 50% respectively corresponding thereto. When the server acquires the target log data 3, the time difference 2 can be obtained to be 20 minutes according to the same method, the first proportion of the time difference 2 in the total service duration is calculated to be 67%, and since the proportion corresponding to the first proportion 67% is not found in table 1 and the proportion different from the first proportion by less than or equal to 5% does not exist, the push probability 2 can be estimated to be 40% according to the proportions of 50%, 80% and the corresponding push probabilities of 30% and 50%, respectively. Referring to the same method, the time difference 3 determined from the target log data 4 is 25 minutes, the first ratio is 83%, and the difference from the ratio 80% in table 1 is less than 5%, a push probability 50% corresponding to the ratio 80% can be used as the estimated push probability 3, the time difference 4 of the target log data 5 is 28 minutes, the first ratio is 93%, the estimated push probability 4 is 80%, the time difference 5 of the target log data 6 is 29 minutes, the first ratio is 97%, and the estimated push probability 5 is 90%.
TABLE 1
Ratio of Probability of push
50% 30%
80% 50%
90% 80%
TABLE 2
Target log data label Time Types of Frequency channel
1 2019.11.15-19:26 Watch Children's channel
2 2019.11.15-19:36 Watch Children's channel
3 2019.11.15-19:46 Watch Children's channel
4 2019.11.15-19:51 Watch Movie channel
5 2019.11.15-19:54 Watch Movie channel
6 2019.11.15-19:55 Watch Movie channel
In another possible scenario, service progress may be indicated by the received operation. In this case, the server stores an operation table corresponding to the service subscribed by the first terminal. After the server obtains the target log data, the server can determine the current service progress according to the operation and the operation table included in the target log data, and estimate the pushing probability of the service message according to the current service progress.
It should be noted that the server stores a correspondence between the subscription service identifiers of the plurality of services and the plurality of operation tables. The subscription service identifier of each service corresponds to an operation table, one operation table includes a plurality of operations arranged according to an execution sequence, and each operation also corresponds to a push probability, where the push probability may be determined according to the execution sequence of the operation corresponding to the service progress in the operation table and the number of the plurality of operations included in the operation table.
After the server obtains the target log data, the server can obtain an operation table corresponding to the subscription service identifier from the stored corresponding relationship between the plurality of subscription service identifiers and the plurality of operation tables according to the subscription service identifier corresponding to the target log data. And then, each time the server obtains one target log data, matching the operation included in the target log data with the operation table, and if the matching is successful, obtaining the current service progress according to the execution sequence of the operation matched with the operation included in the target log data in the operation table.
After the current service progress is determined, the push probability of the service message can be estimated according to the execution sequence of the current service progress in an operation table corresponding to the service subscribed by the first terminal.
Illustratively, taking the subscribed service as a Video telephony service as an example, the operation table corresponding to the Video telephony service acquired by the server according to the subscribed service identifier Video call is table 3 below, and the target log data acquired according to the target application identifier Video call is table 4 below. After obtaining the target log data 1, the server performs matching among a plurality of operations included in the operation table according to the operation Open of the Video call app of the target log data 1, and the matching is successful with the operation 1, that is, the user opens the Video call application, at this time, 50% of the push probability corresponding to the operation 1 in the operation table can be used as the estimated push probability. When the server acquires the target log data 2, matching can be performed in multiple operations according to the same method, the target log data 2 cannot be successfully matched in the multiple operations, and at this time, the estimated push probability is still 50%. Referring to the same method, if the target log data 3 is not successfully matched in multiple operations, the estimated push probability is 50%, if the target log data 4 is successfully matched with the operation 2 in multiple operations, 80% of the push probability corresponding to the operation 2 may be used as the estimated push probability, and if the target log data 5 is successfully matched with the operation 3 in multiple operations, 90% of the push probability corresponding to the operation 3 may be used as the estimated push probability.
TABLE 3
Figure BDA0002384135150000121
TABLE 4
Figure BDA0002384135150000122
Step 204: and adjusting the heartbeat frequency according to the pushing probability.
After the push probability of the service message is estimated, the server can adjust the heartbeat frequency according to the size of the push probability.
Illustratively, the server may compare the determined push probability with a reference probability, and adjust the heartbeat frequency according to the comparison result.
In one possible scenario, if the push probability is greater than the reference probability and the push probability is greater than the last estimated probability before the current time, the heartbeat frequency is increased.
It should be noted that any one of the push probabilities in the mapping table of the service duration ratio and the push probability may be configured as the reference probability. In addition, the server also stores the variation range of the heartbeat frequency corresponding to the unit variation range of the push probability, that is, each time the push probability increases the unit variation range, the heartbeat frequency can be increased by the corresponding range. On the basis, when the estimated push probability is greater than the reference probability and greater than the probability estimated last time before the current moment, the current heartbeat frequency can be increased according to the change amplitude of the heartbeat frequency corresponding to the unit change amplitude of the push probability.
In another possible case, when the estimated push probability is greater than the reference probability and equal to the last estimated probability before the current time, the current heartbeat frequency may not be adjusted. When the estimated push probability is greater than the reference probability and smaller than the last estimated probability before the current moment, the current heartbeat frequency may not be adjusted, and the current heartbeat frequency may be reduced according to the change range of the heartbeat frequency corresponding to the unit change range of the push probability.
In another possible case, the estimated push probability is smaller than or equal to the reference probability, and the current heartbeat frequency can be directly restored to the initial heartbeat frequency without comparing with the latest estimated probability before the current time, wherein the initial heartbeat frequency is smaller than the current heartbeat frequency.
It should be noted that, when the server establishes a connection with the first terminal, an initial heartbeat frequency may be set, and the server may send a heartbeat request to the first terminal at the initial heartbeat frequency until the push probability is greater than the reference probability, and then may adjust the heartbeat frequency. The initial heartbeat frequency is a minimum frequency of the heartbeat requests sent between the server and the first terminal, that is, a lower limit of the heartbeat frequency is reduced. Also, a maximum heartbeat frequency may be preset when establishing a connection, i.e., an upper limit of the heartbeat frequency is increased. In this way, the server can be prevented from increasing or decreasing the heartbeat frequency without limitation.
Illustratively, taking the estimated push probability of the viewing behavior monitoring service as an example, it is assumed that the initial heartbeat frequency is 0.033HZ, that is, the heartbeat request is sent every 30 seconds, the reference probability is 50%, and when the push probability is greater than 50%, the time interval for sending the heartbeat request is reduced by 5s every 10% increase. When the push probability 1 estimated by the server is 20%, since the push probability 1 is smaller than the reference probability, the current heartbeat frequency may be set to the initial heartbeat frequency. When the push probability 2 estimated by the server is 20%, since the push probability 2 is smaller than the reference probability, the current heartbeat frequency can be set as the initial heartbeat frequency. When the push probability 3 of the service message estimated by the server is 50%, since the push probability 3 is equal to the reference probability, at this time, it is inconvenient to keep the current heartbeat frequency. When the push probability 4 of the service message estimated by the server is 80%, since the push probability 4 is greater than the reference probability and greater than the push probability 3, and the push probability 4 is increased by 30% compared to the reference probability, the time interval for transmitting the heartbeat may be reduced by 15 seconds. The adjusted heartbeat frequency is 0.067HZ, i.e. a heartbeat request is sent every 15 seconds. When the push probability 5 of the service message estimated by the server is 90%, since the push probability 5 is greater than the reference probability and greater than the push probability 4, and the push probability 5 is increased by 10% compared with the push probability 4, the time interval for sending the heartbeat may be reduced by 5 seconds. At this time, the adjusted heartbeat frequency is 0.1HZ, that is, the heartbeat request is sent every 10 seconds.
As can be seen from the above description, the closer the current service progress is to the push time of the service message, that is, the higher the push probability is, the higher the heartbeat frequency is, and the smaller the time interval between the server and the first terminal for sending the heartbeat request is. In this way, once the connection between the server and the first terminal becomes unavailable, the server can more timely discover the problem in order to reestablish the connection, increasing the arrival rate of service messages.
When the service subscribed by the first terminal is completed, that is, when the time for pushing the service message to the first terminal arrives, the server may push the service message to the first terminal; and when receiving a message response fed back by the first terminal aiming at the service message, adjusting the current heartbeat frequency to be the initial heartbeat frequency, wherein the initial heartbeat frequency is less than the current heartbeat frequency.
When the server determines that the current service duration is equal to the total service duration according to the target log data, or the current operation is matched with the last operation in the operation list corresponding to the service subscribed by the first terminal, it may be determined that the current time is the time when the service message is pushed to the first terminal, and at this time, the server pushes the service message corresponding to the service to the first terminal. After the service message is pushed to the first terminal, the server may keep the current heartbeat frequency unchanged, send a heartbeat request to the first terminal, and receive a heartbeat response returned by the first terminal. When receiving a message response of the first terminal to the service message, the server may restore the current heartbeat frequency to the initial heartbeat frequency.
After receiving the message response fed back by the first terminal to the service message, the server recovers the heartbeat frequency to the initial heartbeat frequency, so that the problems that the server always sends a heartbeat request to the first terminal by using a higher heartbeat frequency, the load pressure of the server is too high, and the consumed flow is too high can be avoided.
Optionally, after the server receives a message response of the first terminal to the service message, the server may temporarily keep the current heartbeat frequency unchanged for a certain time duration, where the time duration may be preset. If the server does not push the message to the first terminal within the certain time length, the server can restore the current heartbeat frequency to the initial heartbeat frequency.
Alternatively, if the server does not receive the message response of the first terminal, the server may determine that the connection between the server and the first terminal is not available at this time. At this point, the server may reestablish the connection with the first terminal. And after the connection is reestablished successfully, pushing the service message to the first terminal, if the connection is reestablished unsuccessfully, temporarily storing the service message by the server, and after the connection is succeeded, pushing the service message to the first terminal again.
In the embodiment of the application, the heartbeat frequency can be adjusted according to the push probability by acquiring the target log data and pre-estimating the push probability of the service message pushed to the first terminal according to the target log data. Therefore, the center hop frequency can be adjusted according to the push probability, and compared with the fixed heartbeat frequency adopted in the related technology, the problems that when the adopted heartbeat frequency is high, the load pressure of a server is too high, and the consumed flow is too high can be avoided. Meanwhile, the problem that whether the connection is available or not cannot be detected in time when the adopted heartbeat frequency is low so that the arrival rate of message pushing is low can be solved. In addition, in the embodiment of the application, when the probability of pushing the service message is increased, the heartbeat frequency is also increased, whether the connection is available or not can be detected in time, the arrival rate of message pushing is improved, and when the probability of pushing the message is reduced, the heartbeat frequency is also reduced, so that the conditions that the load pressure of the server is too high and the consumed flow is too high are avoided.
Illustratively, the method for adjusting the heartbeat frequency described in the above embodiments is applied to a specific application scenario for example. Assuming that the first terminal is a smart phone and the second terminal is a smart television, the monitoring application is installed in the first terminal, and the monitoring application subscribes to a viewing behavior monitoring service from the server, and the service can be used for monitoring the viewing behavior on the second terminal. The second terminal can send the log data to the server in real time. When the server determines from the log data that the television is watched continuously at the second terminal for more than 30 minutes, a service message may be pushed to the monitoring application of the first terminal.
In the above scenario, the server may obtain the target log data from the log data sent by the second terminal by the method shown in step 202, and calculate the accumulated viewing duration according to the time included in the target log data. When the cumulative viewing time is less than 25 minutes, the server may send a heartbeat request to the first terminal at an initial heartbeat frequency of 0.033HZ, that is, every 30 seconds, and receive a heartbeat response of the first terminal, and when the heartbeat response of the first terminal is not received three times in succession, it may be determined that the connection is not available, and then the connection is reestablished. It follows that when the cumulative viewing period is less than 25 minutes, it takes 90 seconds to determine whether a connection is available.
When the cumulative viewing duration reaches 25 minutes, the heartbeat frequency between the server and the first terminal may be increased to 0.1HZ, that is, a heartbeat request is sent to the first terminal every 10 seconds. That is, when the cumulative viewing period reaches 25 minutes, it takes 30 seconds to determine whether or not the connection is available. When the accumulated watching time length reaches 28 minutes, the heartbeat frequency between the server and the first terminal can be further increased to 1HZ, that is, a heartbeat request is sent to the first terminal every 1 second, and at this time, it only needs 3 seconds to determine whether the connection is available.
As can be seen from the above example, as the accumulated duration gets closer to the total duration of the service, that is, as the probability of pushing messages gets larger, the heartbeat frequency gets larger, and thus, the time required for the server to determine whether the connection with the first terminal is available is shorter. Based on this, if the connection between the server and the first terminal is unavailable, the server can timely determine and reestablish the connection with the first terminal, so that when the server pushes the service message to the first terminal, the arrival rate of the service message can be improved.
When the accumulated watching duration reaches 30 minutes, the server pushes a service message to the first terminal, if the connection between the server and the first terminal is available at the moment, the first terminal can receive the service message pushed by the server and send a message response aiming at the service message to the server, and after receiving the message response, the server can restore the heartbeat frequency to the initial heartbeat frequency of 0.33 HZ. If the connection between the server and the first terminal is unavailable, the connection between the server and the first terminal needs to be reestablished, after the connection is successful, the service message is pushed to the first terminal, if the connection is failed, the server can temporarily store the service message, and after the connection is successful, the service message is pushed to the first terminal again.
Fig. 3 is a flowchart of a method for adjusting a heartbeat frequency according to an embodiment of the present application, where the method may be applied to the system shown in fig. 1. As shown in fig. 3, the method comprises the steps of:
step 301: the first terminal sends a connection request to the server.
The first terminal may send a connection request to the server after being powered on to request the server to establish a connection with the server. And then, the first terminal can perform information interaction with the server through the connection.
Step 302: and the server establishes connection with the first terminal according to the connection request.
After receiving the connection request sent by the first terminal, the server can establish connection with the first terminal. Wherein the connection may be a TCP connection. And after the TCP connection between the server and the terminal is successfully established, the server can carry out information interaction with the first terminal through the TCP.
Step 303: the first terminal sends subscription service information to the server.
The subscription service information is used for indicating the service provided by the server for the first terminal.
In this embodiment of the application, a specific implementation manner of subscribing to the server information may refer to the implementation manner of subscribing to the service information in step 201, which is not described herein again.
Step 304: and the server determines the service subscribed by the first terminal according to the subscription service information.
The specific implementation manner of this step may refer to the implementation manner of step 201, which is not described herein again.
Step 305: the server sends a heartbeat request to the first terminal at an initial heartbeat frequency.
The server may send a heartbeat request to the first terminal at the stored initial heartbeat frequency after determining the services to which the first terminal is subscribed. The heartbeat request is used for detecting whether the connection between the server and the first terminal is available or not, when the server receives a heartbeat response of the first terminal, the connection between the server and the first terminal is available, and when the server does not receive the heartbeat response of the first terminal for a preset number of times, the connection between the server and the first terminal is unavailable, and the connection between the server and the first terminal needs to be reestablished.
Step 306: the first terminal sends a heartbeat response to the server.
When the connection between the server and the first terminal is available, the first terminal may receive the heartbeat request sent by the server and send a heartbeat response to the server.
Step 307: the second terminal sends the log data to the server.
In this embodiment, the server may receive log data sent by a second terminal, where the second terminal is another terminal corresponding to a service provided by the server. The second terminal can send log data to the server in real time after being started, and the log data can include any plurality of contents such as time, data types, application identifications and operations.
Optionally, in the embodiment of the present application, the first terminal and the second terminal are only used as different terminals for example, that is, the service subscriber terminal and the log data reporting terminal are different.
Step 308: the server acquires target log data associated with the service indicated by the subscription service information from the plurality of log data according to the subscription service information.
For a specific implementation of this step, reference may be made to the implementation of step 202, which is not described herein again.
Step 309: and the server pre-estimates the push probability of the service message according to the target log data.
The specific implementation manner of this step may refer to the implementation manner of step 203, which is not described herein again.
Step 310: and the server adjusts the heartbeat frequency with the first terminal according to the push probability.
In the embodiment of the present application, reference may be made to the implementation manner of step 204 for a specific implementation manner of step 310, which is not described herein again.
Step 311: and the server sends a heartbeat request to the first terminal according to the adjusted heartbeat frequency.
The adjusted heartbeat frequency may be greater than the initial heartbeat frequency or less than the initial heartbeat frequency, and the server may send a heartbeat request to the first terminal at the adjusted heartbeat frequency. The specific implementation manner of sending the heartbeat request with the adjusted heartbeat frequency may refer to the implementation manner of step 305, and is not described herein again.
Step 312: the first terminal sends a heartbeat response to the server.
In this embodiment of the application, reference may be made to the implementation manner of step 306 for a specific implementation manner of step 312, which is not described herein again.
Step 313: the server pushes the service message to the first terminal.
When the server estimates that the push probability is 100% according to the target log data, the service subscribed by the first terminal is completed at this time, that is, the server can push the corresponding service message to the terminal when the time for pushing the service message to the first terminal is reached.
Specifically, when the server determines that the current service duration is equal to the total service duration according to the target log data, or when the current operation matches with the last operation in the operation list corresponding to the service subscribed by the first terminal, it may be determined that the current time is the time for pushing the service message to the first terminal, and at this time, the server pushes the service message corresponding to the service to the first terminal.
Step 314: the server sends a heartbeat request to the first terminal at an initial heartbeat frequency.
In the embodiment of the application, after the server pushes the service message to the first terminal, when a message response fed back by the first terminal for the service message is received, the current heartbeat frequency is adjusted to be the initial heartbeat frequency, the initial heartbeat frequency is smaller than the current heartbeat frequency, and a heartbeat request is sent to the first terminal by the initial heartbeat frequency.
After receiving the message response fed back by the first terminal for the service message, the server recovers the heartbeat frequency to the initial heartbeat frequency, so that the problems that the server always sends a heartbeat request to the first terminal by using a higher heartbeat frequency, the load pressure of the server is too high, and the consumed flow is too high can be avoided.
Optionally, after receiving the message response of the first terminal to the service message, the server may temporarily keep the current heartbeat frequency unchanged for a certain time duration, where the time duration may be preset. If the server does not push the message to the first terminal within the certain time length, the server can restore the current heartbeat frequency to the initial heartbeat frequency.
Alternatively, if the server does not receive the message response of the first terminal, the server may determine that the connection between the server and the first terminal is not available at that time. At this point, the server may reestablish the connection with the first terminal. And after the connection is reestablished successfully, pushing the service message to the first terminal, if the connection is reestablished unsuccessfully, temporarily storing the service message by the server, and after the connection is succeeded, pushing the service message to the first terminal again.
Step 315: the first terminal sends a heartbeat response to the server.
The specific implementation manner of this step may refer to the implementation manner of step 306, which is not described herein again.
In the embodiment of the application, the heartbeat frequency can be adjusted according to the push probability by acquiring the target log data and pre-estimating the push probability of pushing the service message to the first terminal according to the target log data. Therefore, the center hop frequency can be adjusted according to the push probability, and compared with the fixed heartbeat frequency adopted in the related technology all the time, the problems that when the adopted heartbeat frequency is high, the load pressure of a server is too high, and the consumed flow is too high can be avoided. Meanwhile, the problem that whether the connection is available or not cannot be detected in time when the adopted heartbeat frequency is low so that the arrival rate of message pushing is low can be solved. In addition, in the embodiment of the application, when the probability of pushing the service message is increased, the heartbeat frequency is also increased, whether the connection is available or not can be detected in time, the arrival rate of message pushing is improved, and when the probability of pushing the message is reduced, the heartbeat frequency is also reduced, so that the phenomenon that the load pressure of the server is too high and the consumed flow is too high is avoided.
Referring to fig. 4, an embodiment of the present application provides a server 400, where the server 400 includes:
an obtaining module 401, configured to obtain subscription service information of a first terminal, where the subscription service information is used to indicate a service provided by the server for the first terminal;
the obtaining module 401 is further configured to obtain, according to the subscription service information, target log data associated with a service indicated by the subscription service information from the plurality of log data;
an estimating module 402, configured to estimate, according to target log data, a pushing probability of a service message, where the service message is a message corresponding to a service provided for the first terminal;
the adjusting module 403 is further configured to adjust the heartbeat frequency according to the push probability, where the push probability and the heartbeat frequency are positively correlated.
Optionally, the subscription service information includes a subscription service type;
the obtaining module 401 is specifically configured to:
acquiring a target data type corresponding to the subscription service type from the mapping relation between the service type and the data type;
acquiring log data with a data type as a target data type from a plurality of log data;
and taking the acquired log data as target log data.
Optionally, the subscription service information includes a subscription service identifier;
The obtaining module 401 is specifically configured to:
acquiring a target application identifier corresponding to the subscription service identifier from the mapping relation between the service identifier and the application identifier;
acquiring log data of the target application identified by the target application identification from the plurality of log data;
and taking the acquired log data as target log data.
Optionally, the estimation module 402 is specifically configured to:
determining a current service progress according to the target log data, wherein the current service progress refers to the progress of the service corresponding to the target log data;
and determining the sending probability according to the current service progress.
Optionally, the adjusting module 403 is specifically configured to:
and if the push probability is greater than the reference probability and is greater than the probability estimated last time before the current moment, increasing the heartbeat frequency.
Optionally, referring to fig. 5, the server further includes:
a pushing module 404, configured to push a service message to a first terminal;
the adjustment module 403 is further configured to:
and when receiving a message response fed back by the first terminal aiming at the service message, adjusting the current heartbeat frequency to be the initial heartbeat frequency, wherein the initial heartbeat frequency is less than the current heartbeat frequency.
In summary, in the embodiment of the application, the heartbeat frequency can be adjusted according to the push probability by acquiring the target log data and predicting the push probability of pushing the service message to the first terminal according to the target log data. Therefore, the center hop frequency can be adjusted according to the push probability, and compared with the fixed heartbeat frequency adopted in the related technology all the time, the problems that when the adopted heartbeat frequency is high, the load pressure of a server is too high, and the consumed flow is too high can be avoided. Meanwhile, the problem that whether the connection is available or not cannot be detected in time when the adopted heartbeat frequency is low so that the arrival rate of message pushing is low can be solved. In addition, in the embodiment of the application, when the probability of pushing the service message is increased, the heartbeat frequency is also increased, whether the connection is available or not can be detected in time, the arrival rate of message pushing is improved, and when the probability of pushing the message is reduced, the heartbeat frequency is also reduced, so that the phenomenon that the load pressure of the server is too high and the consumed flow is too high is avoided.
It should be noted that: the server provided in the foregoing embodiment is only illustrated by dividing the functional modules, and in practical applications, the functions may be allocated by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above.
Fig. 6 shows a schematic structural diagram of a server 600 for adjusting a heartbeat frequency according to an embodiment of the present application. The functions of the server in the embodiment shown in fig. 2 can be implemented by the server shown in fig. 6. The server may be a server in a cluster of background servers. Specifically, the method comprises the following steps:
the server 600 includes a Central Processing Unit (CPU)601, a system memory 604 including a Random Access Memory (RAM)602 and a Read Only Memory (ROM)603, and a system bus 605 connecting the system memory 604 and the central processing unit 601. The server 600 also includes a basic input/output system (I/O system) 606, which facilitates the transfer of information between devices within the computer, and a mass storage device 607, which stores an operating system 613, application programs 614, and other program modules 615.
The basic input/output system 606 includes a display 608 for displaying information and an input device 609 such as a mouse, keyboard, etc. for a user to input information. Wherein a display 608 and an input device 609 are connected to the central processing unit 601 through an input output controller 610 connected to the system bus 605. The basic input/output system 606 may also include an input/output controller 610 for receiving and processing input from a number of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, input/output controller 610 also provides output to a display screen, a printer, or other type of output device.
The mass storage device 607 is connected to the central processing unit 601 through a mass storage controller (not shown) connected to the system bus 605. The mass storage device 607 and its associated computer-readable media provide non-volatile storage for the server 600. That is, mass storage device 607 may include a computer-readable medium (not shown), such as a hard disk or CD-ROM drive.
Without loss of generality, computer readable media may comprise computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, EPROM, EEPROM, flash memory or other solid state memory technology, CD-ROM, DVD, or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that computer storage media is not limited to the foregoing. The system memory 604 and mass storage 607 described above may be collectively referred to as memory.
According to various embodiments of the application, the server 600 may also operate as a remote computer connected to a network through a network, such as the Internet. That is, the server 600 may be connected to the network 612 through the network interface unit 611 connected to the system bus 605, or may be connected to other types of networks or remote computer systems (not shown) using the network interface unit 611.
The memory further includes one or more programs, and the one or more programs are stored in the memory and configured to be executed by the CPU. The one or more programs include instructions for performing the method of adjusting heartbeat frequency provided by embodiments of the present application.
Embodiments of the present application further provide a non-transitory computer-readable storage medium, where instructions in the storage medium, when executed by a processor of a server, enable the server to perform the method for adjusting a heartbeat frequency provided in the embodiment shown in fig. 2.
Embodiments of the present application further provide a computer program product containing instructions, which when run on a computer, cause the computer to execute the method for adjusting the heartbeat frequency provided in the embodiment shown in fig. 2.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk.
The above description is intended only to illustrate the alternative embodiments of the present application, and should not be construed as limiting the present application, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (8)

1. A method for adjusting a heartbeat frequency, applied to a server, the method comprising:
obtaining subscription service information of a first terminal, wherein the subscription service information is used for indicating a server to provide services for the first terminal;
acquiring target log data associated with the service indicated by the subscription service information from a plurality of log data according to the subscription service information;
determining a current service progress according to the target log data, wherein the current service progress refers to the progress of the service corresponding to the target log data; determining a push probability of a service message according to the current service progress, wherein the service message is a message corresponding to a service provided for the first terminal;
If the push probability is greater than the reference probability and the push probability is greater than the probability estimated at the last time before the current moment, increasing the heartbeat frequency, wherein the push probability and the heartbeat frequency are in positive correlation; the heartbeat frequency is greater than an initial heartbeat frequency and less than a maximum heartbeat frequency, the initial heartbeat frequency is a lower frequency limit for sending a heartbeat request between the server and the first terminal, and the maximum heartbeat frequency is an upper frequency limit for sending the heartbeat request between the server and the first terminal.
2. The method of claim 1, wherein the subscription service information comprises a subscription service type;
the obtaining, according to the subscription service information, target log data associated with a service indicated by the subscription service information from a plurality of log data includes:
acquiring a target data type corresponding to the subscription service type from the mapping relation between the service type and the data type;
obtaining log data with a data type as the target data type from the plurality of log data;
and taking the acquired log data as the target log data.
3. The method of claim 1, wherein the subscription service information comprises a subscription service identification;
The obtaining, according to the subscription service information, target log data associated with a service indicated by the subscription service information from a plurality of log data includes:
acquiring a target application identifier corresponding to the subscription service identifier from the mapping relation between the service identifier and the application identifier;
obtaining log data of the target application identified by the target application identification from the plurality of log data;
and taking the acquired log data as the target log data.
4. The method of claim 1, wherein after adjusting the heartbeat frequency according to the push probability, further comprising:
pushing the service message to the first terminal;
and when receiving a message response fed back by the first terminal aiming at the service message, adjusting the current heartbeat frequency to be an initial heartbeat frequency, wherein the initial heartbeat frequency is less than the current heartbeat frequency.
5. A server, characterized in that the server comprises:
the server comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring subscription service information of a first terminal, and the subscription service information is used for indicating the server to provide services for the first terminal;
the acquisition module is further used for acquiring target log data associated with the service indicated by the subscription service information from a plurality of log data according to the subscription service information;
The pre-estimation module is used for determining the current service progress according to the target log data, wherein the current service progress refers to the progress of the service corresponding to the target log data; determining a push probability of a service message according to the current service progress, wherein the service message is a message corresponding to a service provided for the first terminal;
the adjusting module is used for increasing the heartbeat frequency if the pushing probability is greater than the reference probability and is greater than the probability estimated last time before the current moment, wherein the pushing probability and the heartbeat frequency are in positive correlation; the heartbeat frequency is greater than an initial heartbeat frequency and less than a maximum heartbeat frequency, the initial heartbeat frequency is a lower frequency limit for sending a heartbeat request between the server and the first terminal, and the maximum heartbeat frequency is an upper frequency limit for sending the heartbeat request between the server and the first terminal.
6. The server according to claim 5, wherein the subscription service information includes a subscription service type;
the acquisition module is specifically configured to:
acquiring a target data type corresponding to the subscription service type from the mapping relation between the service type and the data type;
Obtaining log data with a data type as the target data type from the plurality of log data;
and taking the acquired log data as the target log data.
7. The server according to claim 5, wherein the subscription service information includes a subscription service identification;
the acquisition module is specifically configured to:
acquiring a target application identifier corresponding to the subscription service identifier from the mapping relation between the service identifier and the application identifier;
obtaining log data of the target application identified by the target application identification from the plurality of log data;
and taking the acquired log data as the target log data.
8. The server according to claim 5, further comprising:
the pushing module is used for pushing the service message to the first terminal;
the adjusting module is further configured to adjust a current heartbeat frequency to an initial heartbeat frequency when receiving a message response fed back by the first terminal for the service message, where the initial heartbeat frequency is smaller than the current heartbeat frequency.
CN202010092415.1A 2020-02-14 2020-02-14 Method and device for adjusting heartbeat frequency Active CN111343045B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010092415.1A CN111343045B (en) 2020-02-14 2020-02-14 Method and device for adjusting heartbeat frequency

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010092415.1A CN111343045B (en) 2020-02-14 2020-02-14 Method and device for adjusting heartbeat frequency

Publications (2)

Publication Number Publication Date
CN111343045A CN111343045A (en) 2020-06-26
CN111343045B true CN111343045B (en) 2022-06-28

Family

ID=71185136

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010092415.1A Active CN111343045B (en) 2020-02-14 2020-02-14 Method and device for adjusting heartbeat frequency

Country Status (1)

Country Link
CN (1) CN111343045B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112073257B (en) * 2020-07-31 2022-05-03 青岛海尔科技有限公司 Method, device and equipment for controlling equipment to upload data
CN111953569B (en) * 2020-08-27 2022-04-29 浪潮电子信息产业股份有限公司 State information reporting method, device, equipment and medium
CN115734323B (en) * 2020-09-25 2024-01-30 华为技术有限公司 Power consumption optimization method and device
CN113015203B (en) * 2021-03-22 2022-08-16 Oppo广东移动通信有限公司 Information acquisition method, device, terminal, system and storage medium
CN115334141B (en) * 2022-08-03 2024-08-30 上海艺赛旗软件股份有限公司 Bidirectional data transmission system, method and device based on heartbeat mechanism
CN117294750B (en) * 2023-11-27 2024-03-01 杭州涂鸦信息技术有限公司 Method and device for adjusting MQTT heartbeat frequency
CN118101751A (en) * 2024-02-28 2024-05-28 广东柠檬火互联网科技有限公司 A message push method and system
CN119450153B (en) * 2025-01-09 2025-04-11 浙江大华技术股份有限公司 Video stream pushing method and device and electronic equipment

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101783929A (en) * 2010-03-04 2010-07-21 北京惠信博思技术有限公司 Method for sending heartbeats to video server by set top box
CN105578515A (en) * 2014-10-15 2016-05-11 上海点艺信息技术有限公司 Heartbeat frequency parameter maintenance method and server
CN106230896A (en) * 2016-07-18 2016-12-14 深圳国泰安教育技术股份有限公司 A kind of information push method, Apparatus and system
CN107622084A (en) * 2017-08-10 2018-01-23 深圳前海微众银行股份有限公司 Log management method, system, and computer-readable storage medium
CN108052597A (en) * 2017-12-12 2018-05-18 百度在线网络技术(北京)有限公司 Method, apparatus, equipment and the computer-readable medium of news push
EP3401791A1 (en) * 2017-05-12 2018-11-14 Fujitsu Limited Log output control apparatus, log output control method, and database server
CN108924195A (en) * 2018-06-20 2018-11-30 郑州云海信息技术有限公司 A kind of unidirectional heartbeat mechanism implementation method, device, equipment and system
CN109327346A (en) * 2018-07-27 2019-02-12 上海电享信息科技有限公司 A kind of client palmic rate dynamic control method and system
CN109981745A (en) * 2019-02-28 2019-07-05 深圳市买买提信息科技有限公司 A kind of journal file processing method and server

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7539755B2 (en) * 2006-04-24 2009-05-26 Inventec Corporation Real-time heartbeat frequency regulation system and method utilizing user-requested frequency
US20150112765A1 (en) * 2013-10-22 2015-04-23 Linkedln Corporation Systems and methods for determining recruiting intent
CN104703146B (en) * 2013-12-09 2019-03-08 腾讯科技(深圳)有限公司 Information push method, client and system
CN110609777B (en) * 2018-06-15 2023-11-03 伊姆西Ip控股有限责任公司 Method, apparatus and computer program product for managing logs

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101783929A (en) * 2010-03-04 2010-07-21 北京惠信博思技术有限公司 Method for sending heartbeats to video server by set top box
CN105578515A (en) * 2014-10-15 2016-05-11 上海点艺信息技术有限公司 Heartbeat frequency parameter maintenance method and server
CN106230896A (en) * 2016-07-18 2016-12-14 深圳国泰安教育技术股份有限公司 A kind of information push method, Apparatus and system
EP3401791A1 (en) * 2017-05-12 2018-11-14 Fujitsu Limited Log output control apparatus, log output control method, and database server
CN107622084A (en) * 2017-08-10 2018-01-23 深圳前海微众银行股份有限公司 Log management method, system, and computer-readable storage medium
CN108052597A (en) * 2017-12-12 2018-05-18 百度在线网络技术(北京)有限公司 Method, apparatus, equipment and the computer-readable medium of news push
CN108924195A (en) * 2018-06-20 2018-11-30 郑州云海信息技术有限公司 A kind of unidirectional heartbeat mechanism implementation method, device, equipment and system
CN109327346A (en) * 2018-07-27 2019-02-12 上海电享信息科技有限公司 A kind of client palmic rate dynamic control method and system
CN109981745A (en) * 2019-02-28 2019-07-05 深圳市买买提信息科技有限公司 A kind of journal file processing method and server

Also Published As

Publication number Publication date
CN111343045A (en) 2020-06-26

Similar Documents

Publication Publication Date Title
CN111343045B (en) Method and device for adjusting heartbeat frequency
CN110688254B (en) Data synchronization method and device, electronic equipment and storage medium
CN105635180B (en) Information push method and device
CN110933178B (en) Method for adjusting node configuration in cluster system and server
CN108616429B (en) reconnection method and device for push service
CN106453231B (en) Signaling acquisition and transmission method and device
CN106790696B (en) Message transmission method and device
CN113032223B (en) Server state detection method and device
CN110209949B (en) Resource pushing method and device
US20080126492A1 (en) Pinging for the Presence of a Server in a Peer to Peer Monitoring System
CN102055644A (en) Method, device and system for load management in distributed directory service system
CN113965517A (en) Network transmission method, network transmission device, electronic equipment and storage medium
CN105634932B (en) Message pushing method, device, system and computer readable storage medium
CN112671897A (en) Access method, device, storage medium, equipment and product of distributed system
CN111885746B (en) Network connection method and device of terminal equipment
CN114051146A (en) Method and system for preventing repeated plug flow
CN110225395B (en) Program content display method, set top box terminal and program management system
CN113068226A (en) Flow control method, flow control rule synchronization method, terminal and server
CN109743379B (en) Multi-protocol distributed message service system based on communication between servers
CN108737460B (en) Connection processing method and client
CN113852866B (en) Media stream processing method, device and system
CN114760490B (en) Video stream processing method and device
CN111885097B (en) Network card processing method and device, electronic equipment and storage medium
CN110233744B (en) Conference state display method, conference state updating method and device
CN109327398B (en) Method and device for preventing packet loss

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant