Heartbeat packet adjusting method and related product

By acquiring user behavior data to determine the optimal heartbeat cycle and uniformly scheduling the heartbeat packet sending time of the application, the problem of frequent modem wake-up in public network intercom systems is solved, and the extension of low-power sleep state and improvement of device energy efficiency are achieved.

CN121814828APending Publication Date: 2026-04-07HYTERA COMM CORP
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-27
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

The inconsistent heartbeat sending times of various applications cause the modem in the public network intercom system to wake up frequently, making it impossible to maintain a low-power sleep state, resulting in a significant increase in the overall power consumption.

Method used

By acquiring current user behavior data from each application, the optimal heartbeat matching model is determined and the corresponding current optimal heartbeat cycle is obtained. This cycle is then sent to the server corresponding to the application, and the system timer function is used to align the heartbeat packet sending time of each application.

Benefits of technology

It effectively reduces frequent wake-ups and resource waste caused by asynchronous heartbeat mechanisms, improves system resource utilization efficiency, significantly reduces overall power consumption, and extends the energy efficiency and battery life of devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121814828A_ABST
    Figure CN121814828A_ABST
Patent Text Reader

Abstract

The invention discloses a heartbeat packet adjustment method and a related product. The method comprises the following steps: acquiring current user behavior data of each application program; obtaining an optimal heartbeat matching model according to the current user behavior data, and obtaining a current optimal heartbeat period corresponding to the optimal heartbeat matching model; and issuing the current optimal heartbeat cycle to a server corresponding to the application program. Unified scheduling and time alignment are carried out on heartbeat packet sending moments of multiple pieces of application software, so that heartbeat information receiving and sending are completed at the same time node. According to the method, frequent wakeup and resource waste caused by an asynchronous heartbeat mechanism are effectively reduced, and the utilization efficiency of system resources is improved, so that the overall power consumption is remarkably reduced, and the energy efficiency performance and the cruising ability of equipment are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a heartbeat packet adjustment method and related products. Background Technology

[0002] With the rapid development of network communication technology, most applications need to start a heartbeat keep-alive timer to maintain a long connection with the backend server. This timer sends heartbeat packets to the server periodically to ensure that the public IP address and port used for Network Address Translation (NAT) traversal are not reclaimed by the gateway due to timeout.

[0003] In practical applications, such as public network intercom systems, multiple communication applications (APPs) are often installed simultaneously. These applications also need to maintain persistent connections with their respective backends. However, because the heartbeat mechanisms of each APP are independent and the heartbeat sending times are inconsistent, the modem in the public network intercom system is frequently woken up: after sending a heartbeat packet to one APP, the modem has just entered sleep mode when another APP immediately triggers a new keep-alive heartbeat request. This disordered heartbeat behavior prevents the system from maintaining a low-power sleep state, resulting in a significant increase in overall power consumption. Summary of the Invention

[0004] Based on the above problems, this application provides a heartbeat packet adjustment method and related products, the purpose of which is to align the heartbeat requests of multiple application software, increase the time the system is in a low-power sleep state, and thus reduce the power consumption of the system.

[0005] The embodiments of this application disclose the following technical solutions: The first aspect of this application provides a heartbeat packet adjustment method, which is applied to an analysis server, and the heartbeat packet adjustment method includes: Obtain current user behavior data for each application; The optimal heartbeat matching model is obtained based on the current user behavior data, and the current optimal heartbeat cycle corresponding to the optimal heartbeat matching model is obtained. The current optimal heartbeat cycle is sent to the server corresponding to the application.

[0006] Optionally, the application includes at least one of the following: Intercom applications, applications developed based on digital elevation models, and applications for managing mobile devices; The current user behavior data includes at least one of the following: Terminal type, application usage time period, network mode corresponding to application heartbeat sending, and application's corresponding business mode.

[0007] Optionally, obtaining the optimal heartbeat matching model based on the current user behavior data includes: If the current user behavior data includes the target behavior data, the optimal heartbeat matching model is determined to be the target heartbeat matching model.

[0008] Optionally, the optimal heartbeat matching model includes N time periods, each time period corresponding to a heartbeat cycle, where N is greater than or equal to 1; The step of obtaining the current optimal heartbeat cycle corresponding to the optimal heartbeat matching model includes: Determine the optimal heartbeat matching model time period in which the current time falls, and obtain the optimal heartbeat cycle corresponding to the current time.

[0009] Optionally, the method further includes: Upon receiving the update instruction, the system reacquires the latest user behavior data for each application and updates the heartbeat cycle of the optimal heartbeat matching model based on the latest user behavior data.

[0010] A second aspect of this application provides a heartbeat packet adjustment method, which is applied to a terminal device, and the heartbeat packet adjustment method includes: The server receives the current optimal heartbeat cycle, wherein the current optimal heartbeat cycle is obtained by the server based on the optimal heartbeat matching model obtained from the current user behavior data, and the current user behavior data is generated by the various applications of the terminal device. The system timer function is set based on the current optimal heartbeat cycle; The system timer function is used to align the heartbeat sending times of each application, so that the heartbeats are triggered at the same time by each application.

[0011] Optionally, setting the system timer function based on the current optimal heartbeat cycle includes: Based on the current optimal heartbeat cycle, the system timer function is extended to obtain a unified trigger identifier parameter; Write the current optimal heart rate cycle into the system timer function.

[0012] Optionally, aligning the heartbeat packet sending times of each application using the system timer function includes: The application calls the system timer function and sets the unified trigger identifier parameter to be available; When the application initiates a keep-alive heartbeat request, the system timer function is called, and the heartbeat is sent using the current optimal heartbeat period in the system timer function, thereby aligning the heartbeat packets sent by each application.

[0013] Optionally, the system timer function includes: the AlarmManager AIP function.

[0014] A third aspect of this application provides an electronic device, including at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can perform the steps involved in the heart rate packet adjustment method provided in the above embodiments of this application.

[0015] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps involved in the heartbeat packet adjustment method provided in the above-described embodiments of this application.

[0016] Compared with the prior art, this application has the following beneficial effects: This application includes obtaining current user behavior data of each application; obtaining an optimal heartbeat matching model based on the current user behavior data, and obtaining the current optimal heartbeat cycle corresponding to the optimal heartbeat matching model; and sending the current optimal heartbeat cycle to the server corresponding to the application.

[0017] This application conducts in-depth analysis based on the collected behavioral data to determine the optimal heartbeat matching model. The current optimal heartbeat cycle corresponding to the optimal heartbeat matching model is then sent to the server corresponding to the application. The timing of heartbeat packets sent by the application software is uniformly scheduled and aligned, ensuring that heartbeat information is received or sent at the same time. This effectively reduces frequent wake-ups and resource waste caused by asynchronous heartbeat mechanisms, improves the utilization efficiency of system resources, and thus significantly reduces overall power consumption, improving the energy efficiency and battery life of the device. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a schematic diagram of the traditional heartbeat packet sending method; Figure 2 This is a first flowchart of a heart rate adjustment method provided in an embodiment of this application; Figure 3 A second flowchart of a heart rate adjustment method provided in an embodiment of this application; Figure 4 This application provides an schematic diagram illustrating the use of a heart rate adjustment method. Figure 5 This is a first structural diagram of a heart rate adjustment device provided in an embodiment of this application; Figure 6 This is a second structural diagram of a heart rate adjustment device provided in an embodiment of this application. Detailed Implementation

[0020] As described earlier, the independent heartbeat mechanisms used by each application and the lack of unified coordination in heartbeat transmission times lead to frequent wake-ups of modems in public network intercom systems. For example, after sending a heartbeat packet for one application and the modem just entering sleep mode, another application immediately triggers a new keep-alive request, causing the device to be unable to stably maintain a low-power sleep mode. This disordered heartbeat scheduling behavior severely affects the overall energy efficiency of the system, resulting in a significant increase in device power consumption.

[0021] Figure 1 This is a schematic diagram of the traditional heartbeat packet sending method, such as... Figure 1 As shown, the terminal is equipped with a PoC APP, an MDM APP, and a DEM APP. These APPs need to maintain a long-term connection with their respective backend servers and require a heartbeat to maintain the IP address and port used for public network NAT traversal. After registering with the backend server, each APP starts a timer (the timer period is set according to the needs of each business) and periodically sends NAT traversal heartbeat packets to its respective server. Each backend server can send data to the terminal based on the IP address and port specified by each APP if it has information to send. Figure 1As shown, the MDM APP keep-alive heartbeat interval is 120 seconds. This means that after the MDM APP sends a keep-alive heartbeat request to the MDM server via the broadband base station / Wi-Fi, the terminal needs to send a heartbeat packet to the MDM APP every 120 seconds to maintain the connection. The DEM APP keep-alive heartbeat interval is 45 seconds. This means that after the DEM APP sends a keep-alive heartbeat request to the DEM server via the broadband base station / Wi-Fi, the terminal needs to send a heartbeat packet to the DEM APP every 45 seconds to ensure service continuity. The PoC keep-alive heartbeat interval is 30 seconds. This means that after the PoC sends a keep-alive heartbeat request to the P-PoC server via the broadband base station / Wi-Fi, the terminal needs to send a heartbeat packet to the PoC every 30 seconds to maintain active intercom communication. Because multiple APPs on the terminal need to maintain a long-term connection with the network, they need to send heartbeat packets frequently. However, the keep-alive cycle for each APP is different, which prevents the terminal from entering deep sleep mode, significantly impacting the terminal's standby time.

[0022] To address the problems of the prior art, this application proposes a heartbeat packet adjustment method, including acquiring current user behavior data of each application; obtaining an optimal heartbeat matching model based on the current user behavior data, and acquiring the current optimal heartbeat cycle corresponding to the optimal heartbeat matching model; and sending the current optimal heartbeat cycle to the server corresponding to the application. This application performs in-depth analysis based on the collected behavior data to determine the optimal heartbeat matching model, and sends the current optimal heartbeat cycle corresponding to the analyzed optimal heartbeat matching model to the server corresponding to the application. This unifies and aligns the timing of heartbeat packet sending by the application software, ensuring that heartbeat information is received or sent at the same time. This effectively reduces frequent wake-ups and resource waste caused by asynchronous heartbeat mechanisms, improves system resource utilization efficiency, and thus significantly reduces overall power consumption, improving device energy efficiency and battery life.

[0023] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0024] Figure 2 This application provides a first flowchart of a heartbeat packet adjustment method, which is applied to an analysis server. The heartbeat packet adjustment method includes: S201: Obtain current user behavior data for each application.

[0025] This application does not limit the type of application, such as intercom applications, applications developed based on digital elevation models, applications for managing mobile devices, etc.

[0026] This application does not limit the behavioral data and can set it according to the actual situation. For example, behavioral data includes the type of terminal, the time period of application use (such as whether it is a weekday, a certain time period on a weekday, etc.), the network mode corresponding to the application heartbeat sending (such as using WIFI connection or public network connection, using UDP or TCP connection, using IPv4 or IPv6), the business mode of the application software (such as whether there is instant communication requirement, whether a certain period of business delay is allowed, whether there are other high power consumption applications or services), and the business mode corresponding to the application (such as whether it is a small screen terminal or a large screen terminal, whether it is an Android system or an RTOS system, whether it is used on the go or always connected to the power supply, etc.).

[0027] This application does not limit the method of acquisition. For example, the communication behavior of each APP can be uniformly monitored and recorded through a system service module (such as JobScheduler in Android or Background Tasks in iOS).

[0028] The above is an optional embodiment and does not imply that the method of obtaining behavioral data in this application or that the behavioral data is limited to the data described above.

[0029] S202: Obtain the optimal heartbeat matching model based on the current user behavior data, and obtain the current optimal heartbeat cycle corresponding to the optimal heartbeat matching model.

[0030] This application does not limit the method for obtaining or determining the optimal heartbeat matching model, and can be flexibly implemented according to the actual business scenario. For example, if the current user behavior data includes target behavior data, the optimal heartbeat matching model is determined to be the target heartbeat matching model. Specifically, in the intercom service scenario, if the current user behavior data indicates that its terminal type is an intercom terminal (such as device model, application identifier, or communication protocol characteristics matching intercom service), then based on this behavior characteristic, a set of candidate models associated with "intercom service" can be selected from a set of preset heartbeat matching models. Furthermore, based on service performance indicators (such as connection stability, power consumption performance, message arrival rate, etc.) or predefined strategies (such as prioritizing models with shorter heartbeat cycles to ensure real-time performance), the target matching model with a shorter heartbeat cycle and more timely response is selected as the optimal heartbeat matching model. This process can be based on rule matching, machine learning scoring, historical effect feedback, or configurable strategies for dynamic decision-making, thereby optimizing terminal resource consumption and network load while ensuring communication quality.

[0031] This application does not limit the construction method of the preset relevant target heartbeat matching model. It uses a deep learning model to learn the linear mapping relationship between behavioral data and the optimal heartbeat cycle, and analyzes the behavioral data based on the deep learning model to determine the preset relevant target heartbeat matching model; or, it uses statistical analysis of the relationship between different data in the behavioral data, and determines the preset relevant target heartbeat matching model based on the statistical results.

[0032] Once the optimal heartbeat matching model is determined, the current user behavior data can be input into the optimal heartbeat matching model to obtain the current optimal heartbeat cycle output by the optimal heartbeat matching model.

[0033] This application does not limit the method for determining the current optimal heart rate cycle, for example: The optimal heartbeat matching model comprises N time periods, each corresponding to a heartbeat cycle, where N is greater than or equal to 1. The optimal heartbeat matching model time period in which the current time falls is determined, and the optimal heartbeat cycle corresponding to the current time is obtained.

[0034] For example, based on statistical data, an optimal user matching heartbeat mechanism can be derived for the entire terminal device: such as using a 30-second heartbeat from 7 am to 9 pm every day, and using a 60-second heartbeat from 9 pm to 7 am the next day, with the heartbeat of the PoC APP as the standard.

[0035] S203: Send the current optimal heartbeat cycle to the server corresponding to the application.

[0036] This application does not limit the number of applications and can be adjusted accordingly based on the actual situation. For example, if there are multiple applications with heartbeat packets to be adjusted, and each application with heartbeat packets to be adjusted corresponds to a different server, then the current optimal heartbeat period can be sent to the servers corresponding to the multiple applications with heartbeat packets to be adjusted.

[0037] This application also provides a newer alternative embodiment: Upon receiving the update instruction, the system reacquires the latest user behavior data for each application and updates the heartbeat cycle of the optimal heartbeat matching model based on the latest user behavior data.

[0038] The update process supports real-time or near real-time execution, ensuring that the heartbeat policy is always synchronized with the user's actual behavior, thereby achieving continuous optimization of terminal resources and network efficiency while ensuring service quality.

[0039] Figure 3 This is a second flowchart of a heartbeat packet adjustment method provided in an embodiment of this application. The heartbeat packet adjustment method is applied to a terminal device and includes: S301: Receive the current optimal heartbeat cycle sent by the server.

[0040] The current optimal heartbeat cycle is obtained by the server based on the optimal heartbeat matching model derived from the current user behavior data, which is generated by the various applications of the terminal device.

[0041] S302: Set the system timer function based on the current optimal heartbeat cycle.

[0042] This application does not limit the setting method. For example, the system timer function can be extended based on the current optimal heartbeat cycle to obtain a unified trigger identifier parameter.

[0043] The unified trigger identifier parameter indicates that the function of this application is enabled, that is, to realize a unified heartbeat trigger mechanism across different apps. The timer itself is used to time the heartbeat cycle triggering time.

[0044] Write the current optimal heart rate cycle into the system timer function.

[0045] S303: Use the system timer function to align the heartbeat packet sending times of each application, so that the heartbeat packets are triggered at the same time by each application.

[0046] Since the heartbeat adjustment method of this application can be applied to various compilable systems, this application does not limit the alignment method. For example, the Android system can use the AlarmManager AIP function or Work Manager as a system-level timer for unified scheduling; the iOS system can use the Background Task Scheduler as a system-level timer for centralized control; in Linux / embedded systems, it can be implemented through cron tasks or custom kernel modules. Specifically, the application calls the system timer function and sets the unified trigger flag parameter to be available (e.g., setting the unified trigger flag parameter to 1). When the application initiates a keep-alive heartbeat request, it calls the system timer function and sends the heartbeat using the current optimal heartbeat period in the system timer function, thereby achieving heartbeat packet sending time alignment for each application.

[0047] This application avoids frequent modem wake-ups caused by asynchronous heartbeats by uniformly scheduling the heartbeat packet sending times of multiple application software. After completing a heartbeat, the modem can maintain a low-power sleep state for a longer period, thus significantly reducing overall power consumption. Sending heartbeat packets to multiple application software at the same time allows network requests to be processed in a merged manner, reducing unnecessary concurrent operations and system context switching. The centralized management of system-level timers reduces the number of CPU wake-ups and improves overall operating efficiency. It is particularly suitable for mobile terminals or battery-powered IoT devices, effectively extending the standby time and usage cycle of the device by reducing the activity frequency of the communication module and processor.

[0048] This application provides a specific embodiment for expanding the parameters of the system timer function based on the current optimal heartbeat cycle to obtain a unified trigger identifier parameter: The system-level timer is extended to obtain a unified trigger identifier parameter.

[0049] The target application software is identified using a unified trigger identifier parameter, enabling the system platform to align the reception time of the heartbeat packets of the remaining application software with the reception time of the target application software based on the current optimal heartbeat cycle. The target application software can be any one of the multiple application software programs, and the remaining application software can be any one of the multiple application software programs other than the target application software.

[0050] This application does not limit the method for determining the target application software, and it can be set according to the actual situation; for example, a certain application software can be set as the target application software according to the user's needs, or the application software that first sends a keep-alive heartbeat request can be set as the target application software. Any method used to determine the target application software is acceptable, because the main purpose of this application in determining the target application software is to establish an alignment benchmark, and it is only necessary to ensure that this benchmark is accurate and effective. This application also does not limit the remaining application software; it can be simply understood that any application software other than the target application software can be considered as the remaining application software.

[0051] By assigning a unified trigger identifier parameter to any one of the multiple applications (i.e., the target application), and using this as a basis to synchronously control the heartbeat packet sending behavior of the remaining applications, the heartbeat packet receiving time of all applications can be uniformly aligned. This eliminates the resource waste caused by asynchronous heartbeat packet triggering between different applications; achieves coordinated consistency in network communication behavior among multiple applications; and reduces the increased power consumption caused by frequent modem wake-ups due to heartbeat packets.

[0052] Regarding S303's use of the system timer function to align the heartbeat packet sending times of each application, ensuring that the heartbeat packet triggering times of each application are consistent, this application also provides an optional specific embodiment: If the target application initiates a keep-alive heartbeat request and calls a system-level timer, the target application will be identified by a unified trigger identifier parameter, and heartbeat packets will be periodically sent to the target application at the current optimal heartbeat period corresponding to the target application.

[0053] If the remaining application software initiates a keep-alive heartbeat request and calls a system-level timer, then a heartbeat packet will be sent to the remaining application software based on the heartbeat packet reception time of the target application software.

[0054] It should be noted that the premise for aligning multiple applications in this application is that all applications call the system-level timer. If an application does not call the system-level timer, it will not be able to align with other applications.

[0055] If the remaining application software initiates a keep-alive heartbeat request and calls a system-level timer, a heartbeat packet will be sent to the remaining application software based on the reception time of the target application software's heartbeat packet. This application also provides a specific implementation: If the remaining application software initiates a keep-alive heartbeat request and calls a system-level timer, then the time when the remaining application software initiates the keep-alive heartbeat request and the time when the target application software will receive the next heartbeat packet are determined.

[0056] Based on the time when the remaining application software initiates the keep-alive heartbeat request and the current optimal heartbeat cycle corresponding to the remaining application software, the time when the remaining application software will receive the next heartbeat packet is determined.

[0057] If the time when the remaining application software receives the next heartbeat packet is the same as the time when the target application software receives the next heartbeat packet, it indicates that the heartbeat packet receiving times of the target application software and the remaining application software are aligned. Heartbeat packets are then sent to the remaining application software and the target application software based on the current optimal heartbeat cycle corresponding to the target application software.

[0058] If the time when the remaining application software receives the next heartbeat packet is inconsistent with the time when the target application software receives the next heartbeat packet, it indicates that the heartbeat packet receiving times of the target application software and the remaining application software are not aligned. Heartbeat packets are then sent to the remaining application software and the target application software based on the current optimal heartbeat cycle corresponding to the target application software and the time when the target application software receives the next heartbeat packet.

[0059] When a remaining application initiates a keep-alive heartbeat request and invokes a system-level timer, the system first determines the trigger time of the request and, combined with the application's current optimal heartbeat cycle, further predicts the reception time of its next heartbeat packet. By comparing this with the target application's next heartbeat reception time, the system can accurately determine whether the two are aligned. This achieves fine-grained control over the heartbeat behavior of multiple applications; improves the system's response accuracy to asynchronous heartbeat requests; and effectively avoids resource waste and communication conflicts caused by asynchrony.

[0060] If the next heartbeat packet reception time of the remaining applications matches that of the target application, they are considered aligned, and the system will uniformly send heartbeat packets based on the target application's heartbeat cycle. If they do not match, it is considered misaligned, and the system will readjust the heartbeat triggering plan of the remaining applications according to the target application's heartbeat cycle and its next reception time to achieve dynamic synchronization. This supports dynamic adjustment of heartbeat behavior in real-time; ensures the consistency and stability of the overall system scheduling; and enhances the flexibility and intelligence of terminal devices in managing background tasks.

[0061] Through the above mechanism, the system can extend the sleep time of critical hardware modules such as the modem and CPU as much as possible after each heartbeat event, thereby reducing unnecessary wake-ups. This significantly reduces the overall power consumption of terminal devices; improves battery life, especially suitable for mobile devices and IoT terminals; reduces the risk of congestion caused by concurrent network communication, and improves communication efficiency.

[0062] To illustrate the technical solution of this application in more detail, this application also provides a specific embodiment with the Android system as the execution body and the AlarmManager AIP function as the system-level timer: Figure 4 This is an application diagram of a heart rate adjustment method provided in this application, such as... Figure 4 As shown, each Android app reports behavioral data to the application server (e.g., the MDM app reports behavioral data to the MDM server via a broadband base station / Wi-Fi; the DEM app reports behavioral data to the DEM server via a broadband base station / Wi-Fi; and the PoC app reports behavioral data to the P-PoC server via a broadband base station / Wi-Fi).

[0063] User behavior data analysis servers (such as analysis servers) collect behavioral data from various application servers to analyze user behavior and determine the current optimal heartbeat cycle (e.g., if a user uses the application less than 5 times on average from 10 pm to 5 am the next day, it is determined that the user is in a resting state and uses the application less from 10 pm to 5 am the next day, and the current optimal heartbeat cycle is determined based on this). The current optimal heartbeat cycle (e.g., 120 seconds) is sent to the corresponding server (e.g., P-PoC server).

[0064] The application server sends the current optimal heartbeat period to the corresponding APP (e.g., the P-PoC server sends the current optimal heartbeat period (120 seconds) to the PoC application software).

[0065] The Android system extends the system-level timer AlarmManager AIP function with a unified trigger identifier parameter to implement a unified timer triggering mechanism.

[0066] The PoC APP initiates a keep-alive heartbeat request and simultaneously starts a baseline heartbeat synchronization timer via the AlarmManager AIP function, setting the current optimal heartbeat period (obtained from the PoC application server) to the Android system.

[0067] If other apps (such as MDM App / DEM App) need to trigger heartbeat services and call the AlarmManager AIP function, the Android system will uniformly and synchronously trigger the heartbeat services of all applications according to the baseline heartbeat period set by the PoC App.

[0068] This application significantly reduces the overall energy consumption of terminal devices; improves battery life, especially suitable for mobile devices and IoT terminals; reduces the risk of congestion caused by concurrent network communication, and improves communication efficiency.

[0069] Figure 5 A structural diagram of a heart rate adjustment device provided in an embodiment of this application is shown below. Figure 5 As shown, based on the heartbeat packet adjustment method provided in the preceding embodiments, this application also provides a heartbeat packet adjustment device, which is applied to an analysis server. The heartbeat packet adjustment device includes: The acquisition module is used to acquire current user behavior data for each application.

[0070] The analysis module is used to obtain the optimal heartbeat matching model based on the current user behavior data, and to obtain the current optimal heartbeat cycle corresponding to the optimal heartbeat matching model.

[0071] The distribution module is used to distribute the current optimal heartbeat cycle to the server corresponding to the application.

[0072] As an optional embodiment, the application includes at least one of the following: Intercom application, application developed based on digital elevation model, application for managing mobile devices.

[0073] Current user behavior data includes at least one of the following: Terminal type, application usage time period, network mode corresponding to application heartbeat sending, and application's corresponding business mode.

[0074] As an optional embodiment, obtaining the optimal heartbeat matching model based on the current user behavior data includes: If the current user behavior data includes the target behavior data, the optimal heartbeat matching model is determined to be the target heartbeat matching model.

[0075] As an optional embodiment, the optimal heartbeat matching model includes N time periods, each time period corresponding to a heartbeat cycle, where N is greater than or equal to 1; The step of obtaining the current optimal heartbeat cycle corresponding to the optimal heartbeat matching model includes: Determine the optimal heartbeat matching model time period in which the current time falls, and obtain the optimal heartbeat cycle corresponding to the current time.

[0076] As an optional embodiment, the apparatus further includes: The update module is used to reacquire the latest user behavior data of each application after receiving the update instruction, and update the heartbeat cycle of the best heartbeat matching model based on the latest user behavior data.

[0077] Figure 6 A structural diagram of a heart rate adjustment device provided in an embodiment of this application is shown below. Figure 6 As shown, based on the heart rate adjustment method provided in the preceding embodiments, this application also provides a heart rate adjustment device, which is applied to a terminal device and includes: The receiving module is used to receive the current optimal heartbeat cycle sent by the server, wherein the current optimal heartbeat cycle is obtained by the server based on the optimal heartbeat matching model obtained from the current user behavior data, and the current user behavior data is generated by the various applications of the terminal device.

[0078] An extension module is used to set the system timer function based on the current optimal heartbeat cycle.

[0079] The alignment module is used to align the heartbeat packet sending times of each application using the system timer function, so that the heartbeat packets are triggered at the same time by each application.

[0080] As an optional embodiment, the extension module is specifically used for: The system timer function is extended based on the current optimal heartbeat cycle to obtain a unified trigger identifier parameter; the current optimal heartbeat cycle is then written into the system timer function.

[0081] As an optional embodiment, the alignment module is specifically used for: The application calls the system timer function and sets the unified trigger identifier parameter to be available; when the application initiates a keep-alive heartbeat request, it calls the system timer function and sends the heartbeat using the current optimal heartbeat period in the system timer function, thereby aligning the heartbeat packets sent by each application.

[0082] As an optional embodiment, the system timer function includes: the AlarmManager AIP function.

[0083] This application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement a heartbeat adjustment method.

[0084] This application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a heartbeat adjustment method.

[0085] This application provides a computer program product, including a computer program that, when executed by a processor, implements a heartbeat packet adjustment method.

[0086] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for the device and equipment embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments. The device and equipment embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components indicated as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the solution in this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0087] The above description is merely one specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for adjusting heart rate, characterized in that, The heartbeat packet adjustment method is applied to the analysis server, and the heartbeat packet adjustment method includes: Obtain current user behavior data for each application; The optimal heartbeat matching model is obtained based on the current user behavior data, and the current optimal heartbeat cycle corresponding to the optimal heartbeat matching model is obtained. The current optimal heartbeat cycle is sent to the server corresponding to the application.

2. The heart rate adjustment method according to claim 1, characterized in that, The application includes at least one of the following: Intercom applications, applications developed based on digital elevation models, and applications for managing mobile devices; The current user behavior data includes at least one of the following: Terminal type, application usage time period, network mode corresponding to application heartbeat sending, and application's corresponding business mode.

3. The heart rate adjustment method according to claim 1 or 2, characterized in that, The step of obtaining the optimal heartbeat matching model based on the current user behavior data includes: If the current user behavior data includes the target behavior data, the optimal heartbeat matching model is determined to be the target heartbeat matching model.

4. The heart rate adjustment method according to any one of claims 1-3, characterized in that, The optimal heartbeat matching model includes N time periods, each time period corresponding to a heartbeat cycle, where N is greater than or equal to 1. The step of obtaining the current optimal heartbeat cycle corresponding to the optimal heartbeat matching model includes: Determine the optimal heartbeat matching model time period in which the current time falls, and obtain the optimal heartbeat cycle corresponding to the current time.

5. The heart rate adjustment method according to claim 1, characterized in that, The method further includes: Upon receiving the update instruction, the system reacquires the latest user behavior data for each application and updates the heartbeat cycle of the optimal heartbeat matching model based on the latest user behavior data.

6. A method for adjusting heart rate, characterized in that, The heartbeat packet adjustment method is applied to a terminal device, and the heartbeat packet adjustment method includes: The server receives the current optimal heartbeat cycle, wherein the current optimal heartbeat cycle is obtained by the server based on the optimal heartbeat matching model obtained from the current user behavior data, and the current user behavior data is generated by the various applications of the terminal device. The system timer function is set based on the current optimal heartbeat cycle; The system timer function is used to align the heartbeat sending times of each application, so that the heartbeats are triggered at the same time by each application.

7. The heart rate adjustment method according to claim 6, characterized in that, The setting of the system timer function based on the current optimal heartbeat cycle includes: Based on the current optimal heartbeat cycle, the system timer function is extended to obtain a unified trigger identifier parameter; Write the current optimal heart rate cycle into the system timer function.

8. The heart rate adjustment method according to claim 7, characterized in that, The step of aligning the heartbeat packet sending times of each application using the system timer function includes: The application calls the system timer function and sets the unified trigger identifier parameter to be available; When the application initiates a keep-alive heartbeat request, the system timer function is called, and the heartbeat is sent using the current optimal heartbeat period in the system timer function, thereby aligning the heartbeat packets sent by each application.

9. The heart rate adjustment method according to claim 6, characterized in that, The system timer functions include: the AlarmManager AIP function.

10. An electronic device, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program to enable the electronic device to implement the heart rate adjustment method as described in any one of claims 1-5 or 6-9.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the heartbeat packet adjustment method as described in any one of claims 1-9.