Background
In a network system, the client presence detection is generally implemented by a heartbeat detection technique. For example, in a network system composed of a server and a plurality of clients, a heartbeat message is usually acquired at a certain heartbeat cycle to determine whether the client is in place.
In the implementation process, the inventor finds that at least the following problems exist in the conventional technology: in the traditional heartbeat detection, the accuracy of selecting the heartbeat period is low, and the consumption of computing resources is large.
Disclosure of Invention
Therefore, it is necessary to provide a heartbeat cycle adjusting method, device and system for solving the problems of low accuracy of selecting heartbeat cycles and high consumption of computing resources in the conventional heartbeat detection.
In order to achieve the above object, an embodiment of the present invention provides a method for adjusting a heartbeat cycle, including the following steps:
obtaining cache data of a corresponding client group of a client to be adjusted in each dimension; the cache data comprises reference heartbeat cycle data and historical bit rate data; each dimension includes one or more client groups;
respectively multiplying the benchmark heartbeat cycle data and the historical bit rate data of the corresponding client group under each dimension to obtain a product corresponding to each dimension; accumulating the products corresponding to the dimensions to obtain an initial heartbeat cycle of the client to be adjusted;
and adding the initial heartbeat period to a preset minimum heartbeat period to obtain an optimal heartbeat period, and updating the current heartbeat period of the client to be adjusted to the optimal heartbeat period.
In one embodiment, the step of adding the initial heartbeat cycle to a preset minimum heartbeat cycle to obtain an optimal heartbeat cycle includes:
based on the following formula, the optimal heartbeat cycle is obtained:
t is the optimal heartbeat period, N is the total dimensionality of the multi-dimensional client group heartbeat period database, TiReference heartbeat cycle data, K, of the client group corresponding to the client in the ith dimension for the client to be adjustediHistorical bit rate data of a client group corresponding to the client to be adjusted in the ith dimension; a is a preset minimum heartbeat period.
In one embodiment, the step of updating the current heartbeat cycle of the client to be adjusted to the optimal heartbeat cycle includes:
when the change amplitude value is larger than a preset threshold amplitude value, updating the current heartbeat cycle of the client to be adjusted to be the optimal heartbeat cycle; the variation amplitude value is a value of the variation amplitude of the optimal heartbeat cycle relative to the current heartbeat cycle.
In one embodiment, the step of obtaining the cache data of the corresponding client group of the client to be adjusted in each dimension includes:
inquiring a multidimensional grouping heartbeat cycle database to obtain corresponding client groups of the clients to be adjusted under each dimension; the multidimensional grouping heartbeat cycle database is used for storing cache data of each client group under each dimension;
the dimensions include any one or any combination of the following: device type, deployment area, and monitoring level.
In one embodiment, the method further comprises the following steps:
acquiring historical bit rate data of each client in a client group;
and carrying out average value processing on the historical bit rate data of each client to obtain the historical bit rate data of the corresponding client group.
On the other hand, an embodiment of the present invention further provides a device for adjusting a heartbeat cycle, including:
the data acquisition unit is used for acquiring cache data of a corresponding client group of the client to be adjusted in each dimension; the cache data comprises reference heartbeat cycle data and historical bit rate data; each dimension includes one or more client groups;
the heartbeat cycle processing unit is used for multiplying the benchmark heartbeat cycle data and the historical bit rate data of the corresponding client group under each dimension respectively to obtain the product corresponding to each dimension; accumulating the products corresponding to the dimensions to obtain an initial heartbeat cycle of the client to be adjusted;
and the heartbeat cycle updating unit is used for adding the initial heartbeat cycle to a preset minimum heartbeat cycle to obtain an optimal heartbeat cycle, and updating the current heartbeat cycle of the client to be adjusted to the optimal heartbeat cycle.
On the other hand, the embodiment of the invention also provides a heartbeat cycle adjusting system, which comprises a server and all clients connected with the server;
the server is configured to perform the steps of the heartbeat cycle adjusting method described above.
In one embodiment, each client is respectively connected with the server through a communication interface;
the communication interface is an SPI interface, an I2C interface, a UART interface, a CANBUS interface or an Ethernet interface.
On the other hand, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a controller, implements the steps of any one of the above-mentioned heartbeat cycle adjusting methods.
One of the above technical solutions has the following advantages and beneficial effects:
obtaining cache data of a corresponding client group of a client to be adjusted in each dimension; the cache data comprises reference heartbeat cycle data and historical bit rate data; each dimension includes one or more client groups; respectively multiplying the benchmark heartbeat cycle data and the historical bit rate data of the corresponding client group under each dimension to obtain a product corresponding to each dimension; accumulating the products corresponding to the dimensions to obtain an initial heartbeat cycle of the client to be adjusted; and adding the initial heartbeat period to a preset minimum heartbeat period to obtain an optimal heartbeat period, and updating the current heartbeat period of the client to be adjusted to the optimal heartbeat period. . And then can come dynamic adjustment heartbeat cycle according to the characteristic and the actual running condition of client, make the heartbeat detect the resource can be concentrated to the most required client, improved resource utilization ratio and heartbeat cycle and selected the precision to reach the optimal balance between resource consumption and detection effect.
Detailed Description
To facilitate an understanding of the present application, the present application will now be described more fully with reference to the accompanying drawings. Preferred embodiments of the present application are shown in the drawings. This application may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
The traditional heartbeat detection technology mainly comprises the following steps: 1. presetting a fixed heartbeat cycle: the server and the client preset a fixed heartbeat cycle, and then perform heartbeat detection in the fixed heartbeat cycle. Or the position information of the client side is considered when the heartbeat period is preset, but the heartbeat detection is still carried out in a fixed heartbeat period after the heartbeat period is set, but the heartbeat detection can be carried out only in the fixed heartbeat period by adopting the first method, and the first method cannot be dynamically adjusted according to the attribute and the state of the client side; 2. presetting a plurality of different heartbeat cycles, and then selecting one heartbeat cycle as an optimal heartbeat cycle: the server or the client side is preset with a plurality of heartbeat cycles, after the operation is tried according to the plurality of heartbeat cycles, an optimal heartbeat cycle is selected according to an operation result, and then the optimal heartbeat cycle is used for carrying out heartbeat detection, but the second method is adopted to provide a plurality of heartbeat cycles for selection in advance, so that the accuracy is not enough, and the resource consumption is high; 3. adjusting the heartbeat cycle according to the CPU load and the network link congestion condition: the method mainly adjusts the heartbeat period dynamically through judging the conditions of CPU load and network link congestion, but the third method considers the conditions of CPU load and network resource utilization, and has low detection effectiveness and accuracy.
In the heartbeat cycle adjusting method of each embodiment of the invention, the heartbeat cycle can be dynamically adjusted according to the characteristics and the actual running condition of the client, so that heartbeat detection resources can be concentrated to the client which is most in need, the resource utilization rate and the heartbeat detection effectiveness are improved, and the optimal balance between resource consumption and detection effect is achieved.
The method for adjusting the heartbeat cycle provided by the present application may be applied to an application environment as shown in fig. 1, in which a server 102 is connected to each client 104. Where the server 102 may be used for signal processing, signal transmission, etc., and the client 104 may transmit a heartbeat status message to the server. The server 102 may be implemented as a stand-alone server or a server cluster composed of a plurality of servers.
In one embodiment, as shown in fig. 2, a method for adjusting a heartbeat cycle is provided, which is described by taking the method as an example applied to the server 102 in fig. 1, and includes the following steps:
step S210, obtaining cache data of a corresponding client group of the client to be adjusted in each dimension; the cache data comprises reference heartbeat cycle data and historical bit rate data; each dimension includes one or more client groups.
The reference heartbeat cycle data refers to a reference cycle of a client group to which the client to be adjusted belongs in the corresponding dimension. The reference heart cycle data may be preset based on historical experience. The historical bit rate data value is the bit rate data of the client group to which the client to be adjusted belongs under the corresponding dimension. The initial value of the historical bit rate data may be 1 (i.e., 100%), after which the historical bit rate data may be dynamically maintained and updated based on the actual in-place behavior of the client. The client group refers to the grouping of the corresponding clients to be adjusted in the corresponding dimension. A client group corresponds to a baseline heartbeat cycle data and a historical bit rate data. It should be noted that one or more dimensions may be included, one or more client groups may be included in the same dimension, and one client group may correspond to one or more clients. The clients to be adjusted have corresponding client groups in different dimensions. The client groups of clients to be tuned may be grouped according to the characteristics of the clients. For example, grouping is based on the similarity of the characteristics or categories of the clients in that dimension.
Specifically, according to the client group corresponding to the client to be adjusted in each dimension, the server may obtain the cache data (including the reference heartbeat cycle data and the historical bit rate data) of the client to be adjusted in each dimension.
Step S220, multiplying the benchmark heartbeat cycle data and the historical bit rate data of the corresponding client group under each dimension respectively to obtain the product corresponding to each dimension; and accumulating the products corresponding to the dimensions to obtain the initial heartbeat period of the client to be adjusted.
Wherein, the initial heartbeat cycle refers to intermediate result data obtained by calculating the optimal heartbeat cycle process.
Specifically, the reference heartbeat cycle data and the historical bit rate data of the corresponding client group of the client to be adjusted in each dimension are multiplied respectively to obtain the product corresponding to each dimension. And accumulating the products corresponding to the dimensions, so as to obtain the initial heartbeat period of the client to be adjusted.
And step S230, adding the initial heartbeat cycle to a preset minimum heartbeat cycle to obtain an optimal heartbeat cycle, and updating the current heartbeat cycle of the client to be adjusted to the optimal heartbeat cycle.
The minimum heartbeat cycle refers to a preset heartbeat cycle constant. The heartbeat period refers to a period of transmitting a heartbeat state message to the server by the client to be adjusted. The optimal heartbeat period refers to the optimal period for the client to be adjusted to transmit the heartbeat state message to the server.
Specifically, the server adds the intermediate heartbeat cycle to a preset minimum heartbeat cycle, so as to obtain an optimal heartbeat cycle of the client to be adjusted. And updating the current heartbeat cycle of the client to be adjusted to the optimal heartbeat cycle, thereby realizing the optimal adjustment of the heartbeat cycle of the client to be adjusted.
In a specific embodiment, the step of adding the initial heartbeat cycle to a preset minimum heartbeat cycle to obtain an optimal heartbeat cycle includes:
obtaining the optimal heartbeat cycle of the client to be adjusted based on the following formula:
t is the optimal heartbeat period, N is the total dimensionality of the multi-dimensional client group heartbeat period database, TiReference heartbeat cycle of client group corresponding to client to be adjusted in ith dimensionData, KiHistorical bit rate data of a client group corresponding to the client to be adjusted in the ith dimension; a is a preset minimum heartbeat period.
In a specific embodiment, as shown in fig. 3, the method further comprises the steps of:
step S310, historical bit rate data of each client in the client group is obtained.
Where the initial value of the client's historical bitrate data may be 1.0 (i.e., 100%).
Specifically, by acquiring the historical bit rate data of each client in the client group, the historical bit rate data of the client group can be dynamically maintained and updated according to the actual running in-place situation of the client.
Step S320, averaging the historical bit rate data of each client to obtain the historical bit rate data of the corresponding client group.
Specifically, the historical bit rate data of each client is accumulated and added to obtain the total of the historical bit rate data under the client group, and the total of the historical bit rate data is divided by the number of the clients to obtain the historical bit rate data corresponding to the client group. Through dynamic maintenance and updating of historical bit rate data of the client group in the corresponding dimension, the heartbeat cycle can be dynamically adjusted according to the actual running condition of the client, heartbeat detection resources can be concentrated to the client with the most need, and the resource utilization rate and the heartbeat detection effectiveness are improved.
In the above embodiment, cache data of a corresponding client group of the client to be adjusted in each dimension is obtained; the cache data comprises reference heartbeat cycle data and historical bit rate data; each dimension includes one or more client groups; respectively multiplying the benchmark heartbeat cycle data and the historical bit rate data of the corresponding client group under each dimension to obtain a product corresponding to each dimension; accumulating the products corresponding to the dimensions to obtain an initial heartbeat cycle of the client to be adjusted; and adding the initial heartbeat period to a preset minimum heartbeat period to obtain an optimal heartbeat period, and updating the current heartbeat period of the client to be adjusted to the optimal heartbeat period. . And then can come dynamic adjustment heartbeat cycle according to the characteristic and the actual running condition of client, make the heartbeat detect the resource can be concentrated to the most required client, improved resource utilization ratio and heartbeat cycle and selected the precision to reach the optimal balance between resource consumption and detection effect.
In one embodiment, as shown in fig. 4, a method for adjusting a heartbeat cycle is provided, which is described by taking the method as an example applied to the server 102 in fig. 1, and includes the following steps:
step S410, obtaining cache data of a corresponding client group of the client to be adjusted in each dimension; the cache data comprises reference heartbeat cycle data and historical bit rate data; each dimension includes one or more client groups.
The specific content process of step S410 may refer to the above content, and is not described herein again.
Step S420, multiplying the benchmark heartbeat cycle data and the historical bit rate data of the corresponding client group under each dimension respectively to obtain the product corresponding to each dimension; and accumulating the products corresponding to the dimensions to obtain the initial heartbeat period of the client to be adjusted.
The specific content process of step S420 may refer to the above content, and is not described herein again.
And step S430, adding the initial heartbeat cycle to a preset minimum heartbeat cycle to obtain an optimal heartbeat cycle.
The specific content process of step S430 may refer to the above content, and is not described herein again.
Step S440, when the change amplitude value is larger than a preset threshold amplitude value, updating the current heartbeat cycle of the client to be adjusted to the optimal heartbeat cycle; the variation amplitude value is a value of the variation amplitude of the optimal heartbeat cycle relative to the current heartbeat cycle.
Specifically, after the server obtains the optimal heartbeat cycle of the client to be adjusted, the server can calculate the variation amplitude of the optimal heartbeat cycle relative to the current heartbeat cycle, so as to obtain the variation amplitude value corresponding to the optimal heartbeat cycle. When the change amplitude value is larger than the preset threshold amplitude value, the server updates the current heartbeat cycle of the client to be adjusted to the optimal heartbeat cycle, so that the heartbeat cycle is prevented from being adjusted too frequently, the heartbeat cycle selection efficiency is improved, and the optimal balance between resource consumption and detection effect is achieved.
Further, a threshold amplitude value is set, when the optimal heartbeat period is larger than the change amplitude value of the current heartbeat period, the current heartbeat period of the client to be adjusted is updated to be the optimal heartbeat period, and otherwise, the current heartbeat period of the client to be adjusted is kept unchanged. For example, the threshold amplitude value may be set to 20%, assuming that the current heartbeat cycle of the client to be adjusted is 5s (seconds), if the calculated optimal heartbeat cycle is 5.5s, and the variation amplitude of 5.5s with respect to 5s is (5.5-5)/5 ═ 10%, which is less than the threshold amplitude value (20%), the heartbeat cycle of the client to be adjusted remains unchanged (still 5s), and no adjustment is made. And if the calculated optimal heartbeat cycle is 7s, and the variation amplitude of 7s relative to 5s is (7-5)/5-40%, and is greater than the threshold amplitude value (20%), updating the current heartbeat cycle of the client to be adjusted to the optimal heartbeat cycle (7 s).
Based on the embodiment, the optimal heartbeat cycle of the client to be adjusted is calculated in a combined mode according to the reference heartbeat cycle data and the historical bit rate data of the client groups with different dimensions and different client groups, the characteristic that the similar clients have similarity is fully utilized, and a more accurate heartbeat cycle is provided for the clients.
In one embodiment, as shown in fig. 5, a method for adjusting a heartbeat cycle is provided, which is described by taking the method as an example applied to the server 102 in fig. 1, and includes the following steps:
step S510, inquiring a multidimensional grouping heartbeat cycle database to obtain corresponding client groups of the clients to be adjusted under each dimension; the multidimensional grouping heartbeat cycle database is used for storing cache data of each client group under each dimension; the dimensions include any one or any combination of the following: device type, deployment area, and monitoring level.
The multi-dimensional grouping client group heartbeat cycle database refers to a heartbeat cycle database for grouping clients according to different dimensions and client characteristics. The heartbeat cycle database is respectively stored with reference heartbeat cycle data and historical bit rate data corresponding to the client group.
Specifically, the server may obtain, by querying a preset multidimensional packet heartbeat cycle database, a client group corresponding to the client to be adjusted in each dimension, and may further obtain reference heartbeat cycle data and historical bit rate data of the corresponding client group.
Further, each dimension may establish a particular number of groups. For example, the device type dimension: the type A client is a group, and the type B client is a group; deployment area dimension: client groups can be performed according to geographic positions, for example, a client placed in a certain building is a client group, and a client deployed in another building is a client group; monitoring level dimension: the monitoring level can be divided into three monitoring levels, namely a high monitoring level and a medium monitoring level.
Step S520, cache data of a corresponding client group of the client to be adjusted in each dimension are obtained; the cache data comprises reference heartbeat cycle data and historical bit rate data; each dimension includes one or more client groups.
The specific content process of step S520 may refer to the above content, and is not described herein again.
Step S530, the benchmark heartbeat cycle data and the historical bit rate data of the corresponding client group under each dimension are multiplied respectively to obtain the product corresponding to each dimension; and accumulating the products corresponding to the dimensions to obtain the initial heartbeat period of the client to be adjusted.
The specific content process of step S530 may refer to the above content, and is not described herein again.
Step S540, adding the initial heartbeat cycle to a preset minimum heartbeat cycle to obtain an optimal heartbeat cycle, and updating the current heart state cycle of the client to be adjusted to the optimal heartbeat cycle
The specific content process of step S540 may refer to the above content, and is not described herein again.
Based on the embodiment, the heartbeat cycle of the client is calculated by combining the benchmark heartbeat cycle data and the historical bit rate data of different client groups with different dimensions, the characteristics of similarity of similar clients are fully utilized, more accurate heartbeat cycle setting is provided for the client, the heartbeat cycle can be dynamically adjusted according to the actual running condition of the client, the heartbeat detection resources can be concentrated to the client with the most needs, and the resource utilization rate and the heartbeat detection effectiveness are improved.
In one embodiment, as shown in fig. 6, a diagram of a multidimensional client group for a heartbeat cycle adjustment method is shown. Each dimension may establish a particular number of groups. Contain 5 client groups as dimension 1 (G11, G12, G13, G14, and G15); dimension 2 contains 6 client groups (G21, G22, G23, G24, G25, and G26) and dimension 3 contains 3 client groups (G31, G32, and G33).
Specifically, heartbeat cycle reference data can be respectively established from dimensions such as a device type, a deployment area, a monitoring level and the like, each dimension can establish a specific number of groups, and different groups can set different reference heartbeat cycles. The initial value of the historical bit rate of different client groups can be set to 100%, and then the historical bit rate data is maintained and updated dynamically according to the actual running in-place situation of the client.
Taking three dimensions of the device type, the deployment area, and the monitoring level as examples, as shown in fig. 7, the device type is the 1 st dimension, the deployment area is the 2 nd dimension, and the monitoring level is the 3 rd dimension. The 1 st dimension device type is divided into 5 groups (G11, G12, G13, G14, G15), the 2 nd dimension deployment region is divided into 6 groups (G21, G22, G23, G24, G25, G26), and the 3 rd dimension monitoring level is divided into 3 groups (G31, G32, G33). The value of the reference period can be set according to the actual situation, the initial value of the historical bit rate can be set to 100%, and then the historical bit rate data is dynamically maintained and updated according to the actual running in-place situation of the client.
According to the characteristics of the client, matched client groups are distributed in different dimensions and stored in the database. E.g., a client to be tuned, which belongs to the G11 client group in the device type dimension; it belongs to the G23 client group in the deployment area dimension; at the monitoring levelThe other dimension belongs to the G33 client group, then its corresponding client groups are G11, G23, and G33, respectively, as shown in fig. 8. The reference period and the historical bit rate corresponding to the corresponding client group are respectively TG11、TG23、TG33、KG11、KG23And KG33. I.e. the client T to be tuned1=TG11,T2=TG23,T3=TG33,K1=KG11,K2=KG23And K3=KG33. The optimal heartbeat cycle of the client to be adjusted is as follows:
let A be 0.5s and the bit rate of the history at a certain time be KG11=0.55、KG23=0.95、KG33If it is 0.9, then the optimal heartbeat cycle of the client to be adjusted at this time is:
T=2*0.55+1.0*0.85+1.0*0.9+0.5=3.35s。
rounding off retains 1 bit after the decimal point (i.e., 0.1s precision), yielding 3.4 s.
Assuming that the current heartbeat cycle of the client to be adjusted is 3s, the variation amplitude of the optimal heartbeat cycle 3.4s relative to the current heartbeat cycle is (3.4-3)/13.3%, which is smaller than the threshold amplitude (20%), the heartbeat cycle is kept unchanged (still 5s), and no adjustment is needed.
After a period of time, the historical bit rate at a certain time is KG11=0.85、KG23=0.98、KG33When the heartbeat period of the ue is equal to 0.9, the optimal heartbeat period of the ue is then
T=TG11×KG11+TG23×KG23+TG33×KG33+A
=2*0.95+1.0*0.98+1.0*0.9+0.5=4.28s。
Rounding off retains 1 bit after the decimal point (i.e., precision of 0.1 s), yielding 4.3 s. The variation amplitude of the optimal heartbeat cycle 4.3s relative to the current heartbeat cycle is (4.3-3)/3 is 43%, and is greater than the threshold amplitude (20%), and the heartbeat cycle of the client to be adjusted is adjusted to be 4.3 s.
Based on the embodiment, the heartbeat cycle of the client is calculated by combining the benchmark heartbeat cycle data and the historical bit rate data of different client groups with different dimensions, the characteristics of similarity of similar clients are fully utilized, more accurate heartbeat cycle setting is provided for the client, the heartbeat cycle can be dynamically adjusted according to the actual running condition of the client, the heartbeat detection resources can be concentrated to the client with the most needs, and the resource utilization rate and the heartbeat detection effectiveness are improved.
It should be understood that, although the steps in the flowcharts of fig. 2 to 5 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-5 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 9, there is provided a heart cycle adjusting apparatus including:
a data obtaining unit 910, configured to obtain cache data of a corresponding client group of a client to be adjusted in each dimension; the cache data comprises reference heartbeat cycle data and historical bit rate data; each dimension includes one or more client groups.
A heartbeat cycle processing unit 920, configured to multiply the reference heartbeat cycle data of the corresponding client group in each dimension with the historical bit rate data, respectively, to obtain a product corresponding to each dimension; and accumulating the products corresponding to the dimensions to obtain the initial heartbeat period of the client to be adjusted.
The heartbeat cycle updating unit 930 is configured to add the initial heartbeat cycle to a preset minimum heartbeat cycle to obtain an optimal heartbeat cycle, and update the current heartbeat cycle of the client to be adjusted to the optimal heartbeat cycle.
For the specific definition of the heart cycle adjusting device, reference may be made to the above definition of the heart cycle adjusting method, which is not described herein again. The modules in the above-mentioned heart cycle adjusting device can be wholly or partially implemented by software, hardware and their combination. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, as shown in fig. 10, there is provided a heartbeat cycle adjusting system, a server 110 and clients 120 connected to the server 110, where the server 110 is configured to perform the steps of the heartbeat cycle adjusting method of any one of the above methods:
obtaining cache data of a corresponding client group of a client to be adjusted in each dimension; the cache data comprises reference heartbeat cycle data and historical bit rate data; each dimension includes one or more client groups;
respectively multiplying the benchmark heartbeat cycle data and the historical bit rate data of the corresponding client group under each dimension to obtain a product corresponding to each dimension; accumulating the products corresponding to the dimensions to obtain an initial heartbeat cycle of the client to be adjusted;
and adding the initial heartbeat period to a preset minimum heartbeat period to obtain an optimal heartbeat period, and updating the current heartbeat period of the client to be adjusted to the optimal heartbeat period.
Further, the server 110 is further configured to implement the following steps:
when the change amplitude value is larger than a preset threshold amplitude value, updating the current heartbeat cycle of the client to be adjusted to be the optimal heartbeat cycle; the variation amplitude value is a value of the variation amplitude of the optimal heartbeat cycle relative to the current heartbeat cycle.
Further, the server 210 is further configured to implement the following steps:
inquiring a multidimensional grouping heartbeat cycle database to obtain corresponding client groups of the clients to be adjusted under each dimension; the multidimensional grouping heartbeat cycle database is used for storing cache data of each client group under each dimension;
the dimensions include any one or any combination of the following: device type, deployment area, and monitoring level.
Further, the server 210 is further configured to implement the following steps:
acquiring historical bit rate data of each client in a client group;
and carrying out average value processing on the historical bit rate data of each client to obtain the historical bit rate data of the corresponding client group.
In a specific embodiment, each client is respectively connected with the server through a communication interface; the communication Interface is an SPI (Serial Peripheral Interface), an I2C (Inter-Integrated Circuit) Interface, a UART (Universal Asynchronous Receiver/Transmitter) Interface, a CANBUS (Controller Area network-word Bus) Interface, or an ethernet Interface.
Specifically, the server and the client are connected through a communication link for interaction of heartbeat status messages. The communication link between the server and the client can be a TCP/IP network communication link, and can also be other communication links such as SPI, I2C, UART, CANBUS and the like. And establishing a multidimensional client group heartbeat cycle database (comprising reference heartbeat cycle data and historical bit rate data of different client groups with different dimensions) on the server according to different characteristics of the clients. The server acquires corresponding reference heartbeat period data and historical bit rate data from the multidimensional client group heartbeat period database based on the client group to which the client belongs, and obtains the optimal heartbeat period after calculation processing, so that the heartbeat period corresponding to the client is dynamically adjusted.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
obtaining cache data of a corresponding client group of a client to be adjusted in each dimension; the cache data comprises reference heartbeat cycle data and historical bit rate data; each dimension includes one or more client groups;
respectively multiplying the benchmark heartbeat cycle data and the historical bit rate data of the corresponding client group under each dimension to obtain a product corresponding to each dimension; accumulating the products corresponding to the dimensions to obtain an initial heartbeat cycle of the client to be adjusted;
and adding the initial heartbeat period to a preset minimum heartbeat period to obtain an optimal heartbeat period, and updating the current heartbeat period of the client to be adjusted to the optimal heartbeat period.
Further, the computer program when executed by the processor performs the steps of:
when the change amplitude value is larger than a preset threshold amplitude value, updating the current heartbeat cycle of the client to be adjusted to be the optimal heartbeat cycle; the variation amplitude value is a value of the variation amplitude of the optimal heartbeat cycle relative to the current heartbeat cycle.
Further, the computer program when executed by the processor performs the steps of:
inquiring a multidimensional grouping heartbeat cycle database to obtain corresponding client groups of the clients to be adjusted under each dimension; the multidimensional grouping heartbeat cycle database is used for storing cache data of each client group under each dimension;
the dimensions include any one or any combination of the following: device type, deployment area, and monitoring level.
Further, the computer program when executed by the processor performs the steps of:
acquiring historical bit rate data of each client in a client group;
and carrying out average value processing on the historical bit rate data of each client to obtain the historical bit rate data of the corresponding client group.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the division methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.