Data subscription method, device, electronic device and readable storage medium

By calculating the similarity of the subscription information of the device in the historical time period, data subscription is only initiated when the preset threshold is reached, which solves the problem of excessive device load and collector data backlog, and achieves the effects of load reduction and automation and intelligence.

CN115065621BActive Publication Date: 2024-09-03CHINA TELECOM CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210656591.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-10
Publication Date
2024-09-03
Estimated Expiration
2042-06-10

AI Technical Summary

Technical Problem

In network telemetry technology, the device continuously pushes data collection for a long time in the static subscription mode, resulting in excessive load on the device and backlog of collector data, which cannot effectively reduce the pressure on the device.

Method used

By calculating the similarity of the device's subscription information within the historical time period, data subscription is initiated to the collector only when the similarity reaches the preset threshold, thereby reducing the number of data subscriptions and reducing the load on the device.

Benefits of technology

It effectively reduces the load on the device and the data backlog of the collector, improves the automation and intelligence level of data subscription, and reduces the performance pressure on the collector.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115065621B
    Figure CN115065621B
Patent Text Reader

Abstract

The disclosed embodiment provides a data subscription method, device, electronic device and readable storage medium, which relates to the field of network monitoring technology. It includes: obtaining first subscription information, the first subscription information includes subscription information of the first device in a historical time period; obtaining second subscription information, the second subscription information includes subscription information of the second device in the same historical time period; calculating the similarity between the first subscription information and the second subscription information; when the similarity reaches a preset similarity threshold, initiating data subscription to the collector. It can reduce the pressure on the device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of network monitoring, and in particular to a data subscription method, device, electronic device and readable storage medium. Background Art

[0002] Telemetry is a network monitoring technology that collects data from devices remotely and at high speed. Subscribing to data is a very important part of Telemetry. There are two subscription mechanisms. One is static subscription, where the device acts as a client and the collector acts as a server. The device actively establishes a connection with the collector and pushes the collected data to the collector. The other is dynamic subscription, where the collector acts as a client and the device acts as a server. The collector actively establishes a connection with the device and the device pushes the collected data to the collector. Summary of the invention

[0003] The purpose of the embodiments of the present disclosure is to provide a data subscription method, device, electronic device and readable storage medium to reduce the pressure on the device. The specific technical solution is as follows:

[0004] In a first aspect, an embodiment of the present disclosure provides a data subscription method, including:

[0005] Acquire first subscription information, where the first subscription information includes subscription information of the first device within a historical time period;

[0006] Acquire second subscription information, where the second subscription information includes subscription information of the second device within the same historical time period;

[0007] Calculating the similarity between the first subscription information and the second subscription information;

[0008] When the similarity reaches a preset similarity threshold, data subscription is initiated to the collector.

[0009] Optionally, the obtaining the first subscription information includes:

[0010] Counting the number of subscriptions of the first device in a historical time period, and using the number of subscriptions of the first device in the historical time period as the first subscription information;

[0011] The obtaining of the second subscription information includes:

[0012] The number of subscriptions of the second device in the historical time period counted by the second device is obtained, and the number of subscriptions of the second device in the historical time period is used as second subscription information.

[0013] Optionally, the obtaining the first subscription information includes:

[0014] counting a first subscription frequency sequence of the first device in a historical time period, and using the first subscription frequency sequence of the first device in the historical time period as first subscription information, wherein the first subscription frequency sequence includes subscription frequencies of the first device at multiple time granularities, the time granularity being a time range divided based on the historical time period, and for each time granularity, the subscription frequency at the time granularity included in the first subscription frequency sequence includes: a proportion of the number of subscriptions of the first device in the time granularity to the number of subscriptions of the first device in the historical time period;

[0015] The obtaining of the second subscription information includes:

[0016] Obtain a second subscription frequency sequence of the second devices within the historical time period counted by multiple second devices, and use the second subscription frequency sequences of the multiple second devices within the historical time period as second subscription information, wherein, for each second device, the second subscription frequency sequence includes the subscription frequencies of the second device at multiple time granularities, and for each time granularity, the subscription frequencies at the time granularity included in the second subscription frequency sequence include: the proportion of the number of subscriptions of the second device within the time granularity to the number of subscriptions of the second device within the historical time period.

[0017] Optionally, the method further comprises:

[0018] For each similarity, determining whether the similarity reaches a preset similarity threshold;

[0019] Counting the proportion of multiple similarities that reach a preset similarity threshold as a similarity ratio;

[0020] Determine whether the similarity ratio reaches a preset similarity ratio threshold;

[0021] If so, determining that the similarity reaches a preset similarity threshold;

[0022] If not, it is determined that the similarity does not reach the preset similarity threshold.

[0023] Optionally, calculating the similarity between the first subscription information and the second subscription information includes:

[0024] For each time granularity, calculating a distance between a subscription frequency of the first device at the time granularity and a subscription frequency of the second device at the time granularity;

[0025] Sum the distances corresponding to each time granularity to obtain the cumulative distance sum;

[0026] The ratio of the cumulative sum of distances to the number of time granularities is calculated, and the ratio is used as the similarity between the first subscription information and the second subscription information.

[0027] In a second aspect, an embodiment of the present disclosure provides a data subscription device, including:

[0028] an acquisition module, configured to acquire first subscription information, the first subscription information comprising subscription information of the first device in a historical time period; and acquire second subscription information, the second subscription information comprising subscription information of the second device in the same historical time period;

[0029] A calculation module, used to calculate the similarity between the first subscription information and the second subscription information;

[0030] The subscription determination module is used to initiate data subscription to the collector when the similarity reaches a preset similarity threshold.

[0031] Optionally, the acquisition module is specifically used to count the number of subscriptions of the first device in a historical time period, and use the number of subscriptions of the first device in the historical time period as the first subscription information; obtain the number of subscriptions of the second device in the historical time period counted by the second device, and use the number of subscriptions of the second device in the historical time period as the second subscription information.

[0032] Optionally, the acquisition module is specifically used to count a first subscription frequency sequence of the first device within a historical time period, and use the first subscription frequency sequence of the first device within the historical time period as the first subscription information, wherein the first subscription frequency sequence includes the subscription frequencies of the first device at multiple time granularities, the time granularity is a time range divided based on the historical time period, and for each time granularity, the subscription frequency at the time granularity included in the first subscription frequency sequence includes: the proportion of the number of subscriptions of the first device within the time granularity to the number of subscriptions of the first device within the historical time period; obtain the second subscription frequency sequences of the second devices within the historical time period counted by multiple second devices, and use the second subscription frequency sequences of multiple second devices respectively within the historical time period as the second subscription information, wherein, for each second device, the second subscription frequency sequence includes the subscription frequencies of the second device at multiple time granularities, and for each time granularity, the subscription frequency at the time granularity included in the second subscription frequency sequence includes: the proportion of the number of subscriptions of the second device within the time granularity to the number of subscriptions of the second device within the historical time period.

[0033] Optionally, the device further comprises:

[0034] A first judgment module, used for judging, for each similarity, whether the similarity reaches a preset similarity threshold;

[0035] A statistical module, used to count the proportion of multiple similarities that reach a preset similarity threshold as a similarity ratio;

[0036] A second judgment module is used to judge whether the similarity ratio reaches a preset similarity ratio threshold;

[0037] The similarity determination module is configured to determine, if yes, that the similarity reaches a preset similarity threshold; if no, determine that the similarity does not reach the preset similarity threshold.

[0038] Optionally, the calculation module is specifically used to calculate, for each time granularity, the distance between the subscription frequency of the first device at the time granularity and the subscription frequency of the second device at the time granularity; sum the distances corresponding to each time granularity to obtain the cumulative distance; calculate the ratio of the cumulative distance sum to the number of time granularities, and use the ratio as the similarity between the first subscription information and the second subscription information.

[0039] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0040] Memory, used to store computer programs;

[0041] The processor is used to implement any method step described in the first aspect when executing a program stored in the memory.

[0042] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any method step described in the first aspect is implemented.

[0043] The embodiment of the present disclosure also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any one of the method steps described in the first aspect above.

[0044] Beneficial effects of the embodiments of the present disclosure:

[0045] In the embodiment of the present disclosure, the first device initiates data subscription to the collector only when the similarity between the subscription information of the first device and the second device within a historical time period reaches a preset similarity threshold, which can reduce the number of data subscriptions, reduce the load caused by data subscription on the first device, and alleviate the pressure on the first device.

[0046] Of course, it is not necessary to achieve all the advantages described above at the same time to implement any product or method of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present disclosure, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.

[0048] Figure 1 A flowchart of a data subscription method provided by an embodiment of the present disclosure;

[0049] Figure 2 A schematic diagram of a subscription frequency sequence in an embodiment of the present disclosure;

[0050] Figure 3 A system diagram for applying the data subscription method provided by an embodiment of the present disclosure;

[0051] Figure 4 A structural diagram of a data subscription device provided in an embodiment of the present disclosure;

[0052] Figure 5 Another structural diagram of a data subscription device provided by an embodiment of the present disclosure;

[0053] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0054] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field based on the present disclosure belong to the scope of protection of the present disclosure.

[0055] In the related technology, when the static subscription method is adopted, the device actively establishes a connection with the collector, and the device will continuously collect and send data. The continuous data collection and sending will cause long-term load on the device. The long-term load of the device will cause greater pressure on the device on the one hand, and on the other hand, it will also cause data backlog in the collector.

[0056] The present disclosure provides a data subscription method, which may include:

[0057] Acquire first subscription information, where the first subscription information includes subscription information of the first device within a historical time period;

[0058] Acquire second subscription information, where the second subscription information includes subscription information of the second device within the same historical time period;

[0059] Calculate the similarity between the first subscription information and the second subscription information;

[0060] When the similarity reaches the preset similarity threshold, data subscription is initiated to the collector.

[0061] In the disclosed embodiment, only when the similarity between the subscription information of the first device and the second device in the historical time period reaches a preset similarity threshold, the first device initiates data subscription to the collector, which can reduce the number of data subscriptions, reduce the load caused by data subscription to the first device, and relieve the pressure on the first device. In addition, it can also reduce the data backlog of the collector.

[0062] In one example, different from general message subscriptions, such as subscriptions to weather forecasts and text messages, data subscription in the disclosed embodiment is used for network detection, that is, data subscription in the disclosed embodiment refers to data subscription in the network detection process, which can be data subscription in Telemetry using a static subscription method. For example, the device pushes the collected data to the collector through data subscription, and the collector stores the collected data. The analyzer reads the collected data from the collector, analyzes the collected data, obtains the analysis results, and sends the analysis results to the controller. The controller adjusts the network configuration based on the analysis results. The controller sends the configuration that needs to be adjusted to the device. After the configuration takes effect, the new collected data will be reported to the collector. At this time, the analyzer can analyze whether the network effect after tuning meets expectations until the tuning is completed. For example, the collected data includes device information, such as interface traffic statistics of the device. The analyzer analyzes this information to obtain traffic anomaly information. The controller adjusts the configuration for the device based on the traffic anomaly information and sends the configuration to the device. The device adjusts the traffic based on the configuration, so that real-time traffic tuning is achieved through data subscription.

[0063] Figure 1 A flowchart of a data subscription method provided by an embodiment of the present disclosure is shown in FIG. Figure 1 The data subscription method provided by the embodiment of the present disclosure may include:

[0064] S101: Obtain first subscription information.

[0065] The first subscription information includes subscription information of the first device in a historical time period. Simply put, the first subscription information is the subscription information corresponding to the first device.

[0066] The subscription information corresponding to the first device refers to information corresponding to data subscription performed by the first device for network detection, for example, information corresponding to Telemetry subscription performed by the first device. Telemetry subscription can be understood as data subscription for Telemetry.

[0067] The first device may be a network device or the like.

[0068] The historical time period can be determined based on actual needs or experience, such as 1 hour, 2 hours, 1 day, etc.

[0069] The subscription information can be the subscription quantity or the subscription frequency sequence.

[0070] Specifically, the first subscription information may be the number of subscriptions of the first device in the historical time period. The number of subscriptions may be the number of times the first device performs Telemetry subscriptions, specifically the number of times the first device sends collected data to the collector. Alternatively, the first subscription information may also be a subscription frequency sequence of the first device in the historical time period. The subscription frequency sequence includes the subscription frequencies of the first device at multiple time granularities obtained by dividing the historical time period, wherein the subscription frequency at a time granularity indicates the proportion of the number of subscriptions of the first device at the time granularity to the total number of subscriptions in the entire historical time period, and the total number of subscriptions in the entire historical time period is the sum of the number of subscriptions of all time granularities obtained by dividing the historical time period by the first device.

[0071] S102: Obtain second subscription information.

[0072] The second subscription information includes subscription information of the second device in the same historical time period. In simple terms, the subscription information corresponding to the second device.

[0073] The subscription information of the second device refers to information corresponding to data subscription performed by the second device for network detection, for example, information corresponding to Telemetry subscription performed by the second device.

[0074] The number of the second device may be one or more.

[0075] The second device may be another device different from the first device. For example, the second device may include another device different from the first device among the devices that subscribe to data with the collector.

[0076] In one possible implementation, the second device may be a device that is in communication connection with the first device, and may also be understood as a neighboring device of the first device, for example, a device that is in the same network as the first device and is in direct communication connection with the first device. Specifically, it may be determined whether the first device is physically connected to the other device, and if so, the other device is the second device.

[0077] In an example, when forwarding business traffic, if the traffic of the target device surges, even if the source comes from a non-adjacent device, the actual data message will be transmitted through the directly connected physical link. In actual applications, calculating the similarity between the second device directly physically connected to the first device and the first device can reduce the computational complexity. In addition, the second device communicates directly with the first device, that is, data can be directly transmitted, which makes it easier for the second device to obtain subscription information.

[0078] In actual application scenarios, when monitoring devices in the network, due to business traffic, specific range alarms, etc., the subscriptions of the device and its second device show convergence or specificity. For example, the subscriptions of the first device and its neighboring device (the device directly communicating with the device) have convergence or specificity. Judging whether to subscribe based on the subscription information of the neighboring device and the subscription information of the first device is more in line with the actual application scenario, making the judgment on data subscription more accurate.

[0079] Specifically, the second subscription information may be the number of subscriptions of the second device in the historical time period. The number of subscriptions may be the number of times the second device performs Telemetry subscriptions, specifically the number of times the second device sends collected data to the collector. Alternatively, the second subscription information may also be a subscription frequency sequence of the second device in the historical time period. The subscription frequency sequence includes the subscription frequencies of the second device at multiple time granularities obtained by dividing the historical time period, wherein the subscription frequency at a time granularity indicates the proportion of the number of subscriptions of the second device in the time granularity to the total number of subscriptions in the entire historical time period, and the total number of subscriptions in the entire historical time period is the sum of the number of subscriptions of the second device at all time granularities obtained by dividing the historical time period.

[0080] For example, if there is a second device, and the second device collects statistics about its subscription information in the historical time period, the first device may obtain the subscription information collected by the second device in the historical time period from the second device.

[0081] If there are multiple second devices, each second device may respectively count its own subscription information in the historical time period, and the first device obtains the subscription information in the historical time period counted by the second device from each second device.

[0082] S103: Calculate the similarity between the first subscription information and the second subscription information.

[0083] The similarity between the first subscription information and the second subscription information can be used to indicate the similarity between the first device and the second device. The similarity mentioned here can also be understood as subscription similarity, that is, the similarity between the data subscription between the first device and the second device. For a second device, the similarity between the subscription information of the second device and the subscription information of the first device can be calculated, which can also be understood as a corresponding similarity can be calculated for a second device.

[0084] Specifically, the similarity can be represented by the distance between the first subscription information and the second subscription information. The embodiment of the present disclosure does not limit the specific form of the distance, for example, the distance can be Euclidean distance, Manhattan distance, Mahalanobis distance, cosine distance, Hamming distance, etc.

[0085] S104: When the similarity reaches a preset similarity threshold, a data subscription is initiated to the collector.

[0086] When the similarity does not reach the preset similarity threshold, data subscription to the collector is not initiated.

[0087] In one possible implementation, a connection is established between the first device and the collector for the first device to push the collected data to the collector.

[0088] Initiating data subscription to the collector can also be understood as establishing a connection with the collector and pushing the collected data to the collector. When the similarity does not reach the preset similarity threshold, the first device can disconnect the connection with the collector to achieve not pushing the collected data to the collector.

[0089] In one possible implementation, when the similarity does not reach a preset similarity threshold, the process may return to obtain the first subscription information and the second subscription information, calculate the similarity between the first subscription information and the second subscription information, and when the calculated similarity reaches a preset similarity threshold, initiate data subscription to the collector.

[0090] The collected data may include device information, such as interface traffic statistics, central processing unit (CPU) or memory data of the device.

[0091] The preset similarity threshold can be determined according to actual subscription business needs.

[0092] In one possible implementation, in the disclosed embodiment, the first subscription information and the second subscription information can be obtained periodically (such as every 1 second, 2 seconds, 1 minute, 5 minutes, etc.), the similarity can be calculated, and it can be determined whether the similarity reaches a preset similarity threshold. Only when the similarity reaches the preset similarity threshold, data subscription is initiated to the collector.

[0093] In one possible implementation, when a similarity is obtained, for example, the second device has a second subscription information, which is the subscription information corresponding to the second device, a similarity is calculated for the second device. In this case, it is determined whether the similarity reaches a preset similarity threshold. When the similarity reaches the preset similarity threshold, data subscription is initiated to the collector; when the similarity does not reach the preset similarity threshold, data subscription to the collector is not initiated.

[0094] In another possible implementation, when multiple similarities are obtained, for example, there are multiple second devices, and the second subscription information includes subscription information corresponding to each second device, a corresponding similarity can be calculated for each second device. For each similarity, determine whether the similarity reaches a preset similarity threshold; count the proportion of multiple similarities that reach the preset similarity threshold as a similarity ratio; determine whether the similarity ratio reaches a preset similarity ratio threshold; if the similarity ratio reaches the preset similarity ratio threshold, determine that the similarity reaches the preset similarity threshold; if the similarity ratio does not reach the preset similarity ratio threshold, determine that the similarity does not reach the preset similarity threshold.

[0095] It can also be understood as calculating the similarity ratio among multiple similarities that reaches the preset similarity threshold, and then judging whether the similarity ratio reaches the preset similarity ratio threshold. When the similarity ratio reaches the preset similarity ratio threshold, data subscription is initiated to the collector. When the similarity ratio does not reach the preset similarity ratio threshold, data subscription to the collector is not initiated.

[0096] The similarity ratio may be the ratio of the number of similarities reaching a preset similarity threshold among multiple similarities to the total number of all similarities. Alternatively, the similarity ratio may be the ratio of the number of similarities reaching a preset similarity threshold among multiple similarities to the total amount of device data. The total amount of device data is the sum of the number of first devices and second devices. Because, for each second device, the similarity corresponding to the second device can be calculated, the number of similarities reaching the preset similarity threshold can also be understood as the sum of the number of second devices reaching the preset similarity threshold.

[0097] In the disclosed embodiment, the first device initiates data subscription to the collector only when the similarity between the subscription information of the device and the second device in the historical time period reaches the preset similarity threshold, and when the similarity between the subscription information of the device and the second device in the historical time period does not reach the preset similarity threshold, the first device does not initiate data subscription to the collector, which can reduce the number of data subscriptions, reduce the load caused by data subscription to the first device, and relieve the pressure of the first device. In addition, the data backlog of the collector can also be reduced.

[0098] In addition, in the embodiment of the present disclosure, when the similarity between the subscription information of the first device and the second device in the historical time period reaches a preset similarity threshold, data subscription is automatically initiated, which can improve the automation and intelligence level of the subscription process. Furthermore, only the device side needs to execute the method steps of data subscription provided by the embodiment of the present disclosure, and there is no need to add functional modules in the collector, which reduces the performance pressure of the collector.

[0099] In an optional embodiment, S101 may include: counting the number of subscriptions of the first device in a historical time period, and using the number of subscriptions of the first device in the historical time period as the first subscription information.

[0100] S102 may include: acquiring the number of subscriptions of the second device in a historical time period counted by the second device, and using the number of subscriptions of the second device in the historical time period as second subscription information.

[0101] In this embodiment, subscription information is represented by subscription quantity.

[0102] In this way, for each second device, the similarity between the number of subscriptions of the first device in the historical time period and the number of subscriptions of the second device in the historical time period can be calculated to obtain the similarity between the first subscription information and the second subscription information.

[0103] In another optional embodiment, S101 may include:

[0104] A first subscription frequency sequence of the first device in a historical time period is counted, and the first subscription frequency sequence of the first device in the historical time period is used as first subscription information.

[0105] Among them, the first subscription frequency sequence includes the subscription frequencies of the first device at multiple time granularities, the time granularity is a time range divided based on historical time periods, and for each time granularity, the subscription frequencies at the time granularity included in the first subscription frequency sequence include: the proportion of the number of subscriptions of the first device within the time granularity to the number of subscriptions of the first device in the historical time period.

[0106] S102 may include:

[0107] Obtain a second subscription frequency sequence of the second devices within a historical time period, which is counted by multiple second devices, and use the second subscription frequency sequences of the multiple second devices within the historical time period as second subscription information, wherein, for each second device, the second subscription frequency sequence includes the subscription frequencies of the second device at multiple time granularities, and for each time granularity, the subscription frequencies at the time granularity included in the second subscription frequency sequence include: the proportion of the number of subscriptions of the second device within the time granularity to the number of subscriptions of the second device within the historical time period.

[0108] In this embodiment, subscription information is represented by a subscription frequency sequence.

[0109] For example, if the historical time period is ΔT, ΔT is divided into N equal parts, which is the time granularity Δt. The subscription frequency within the nth time granularity Δt is f n (1≤n≤N, n is an integer), the first subscription frequency sequence includes the subscription frequencies of the first device in the N time granularities Δt. For each second device, the second subscription frequency sequence includes the subscription frequencies of the second device in the N time granularities Δt. The subscription frequency sequences of the first device and its second device are as follows: Figure 2 As shown, Figure 2 Through f n Indicates the subscription frequency, f n The specific value is determined according to the actual situation. n The value of the second device's subscription frequency sequence is f n The value of can be different.

[0110] In the case where the subscription information is represented by a subscription frequency sequence, S103 may include:

[0111] For each time granularity, calculate the distance between the subscription frequency of the first device at the time granularity and the subscription frequency of the second device at the time granularity; sum the distances corresponding to each time granularity to obtain the cumulative distance; calculate the ratio of the cumulative distance sum to the number of time granularities, and use the ratio as the similarity between the first subscription information and the second subscription information.

[0112] For example, for N Δt respectively, calculate the distance between the subscription frequency of the first device within the time granularity Δt and the subscription frequency of the second device within the time granularity Δt; sum the distances corresponding to the N time granularities Δt to obtain the cumulative distance sum, and then calculate the ratio of the cumulative distance sum to N, and use the ratio as the similarity between the first subscription information and the second subscription information.

[0113] As described above, the distance in the embodiments of the present disclosure may be Euclidean distance, Manhattan distance, Mahalanobis distance, cosine distance, Hamming distance, etc.

[0114] Taking the Euclidean distance metric as an example,

[0115] Among them, Distance[f n (R),f n (Neighbor)] represents the distance measure of the subscription frequency between the first device R and the second device at the nth time granularity Δt; f n (R) represents the subscription frequency of the first device R at the nth time granularity in the entire time period ΔT; similarly, f n (Neighbor) represents the telemetry subscription frequency of the second device of the first device R at the nth time granularity within the entire time period ΔT.

[0116] S (R,Neighbor) represents the similarity between the first device R and the second device, that is, the similarity between the first subscription information and the second subscription information, as shown in the following formula:

[0117]

[0118] In this way, the similarity between the first device and the second device can be determined by the subscription frequency of the first device at multiple time granularities and the subscription frequency of the second device at the same multiple time granularities.

[0119] Figure 3 A system diagram for applying the data subscription method provided by the embodiment of the present disclosure. Figure 3 , a detailed description is given by taking the first device R2 executing the data subscription method provided in the embodiment of the present disclosure as an example.

[0120] In the disclosed embodiment, the data subscription is specifically a Telemetry subscription, the subscription frequency is a Telemetry subscription frequency, and the similarity is a subscription similarity.

[0121] Set the similarity threshold T according to the subscription business requirements s , that is, the similarity threshold and similarity ratio threshold T are preset in the above embodiment. p , that is, the similarity ratio threshold is preset in the above embodiment.

[0122] R2 counts its own Telemetry subscription frequency in a time period to form a subscription frequency sequence of R2; the second devices (R1 / R3 / R4) also count their own Telemetry subscription frequencies in the same time period to form subscription frequency sequences of R1, R3 and R4 respectively.

[0123] R2 obtains the subscription frequency sequences of R1, R3 and R4, and calculates the similarity between the subscription frequency sequence of R2 and the subscription frequency sequences of R1, R3 and R4 respectively.

[0124] Then, R2 evaluates the subscription similarity S (R,Neighbor) , determine whether the similarity threshold T is reached s ; R2 evaluates the similarity ratio P, which can also be understood as the subscription similarity ratio, and determines whether the similarity ratio threshold T is reached p When the subscription similarity S reaches the similarity threshold T s , and the subscription similarity ratio P reaches the similarity ratio threshold T p When R2 initiates the Telemetry subscription, it will initiate the Telemetry subscription. Otherwise, it will not initiate the Telemetry subscription.

[0125] Specifically, it is determined whether the similarity between the subscription frequency sequence of R2 and the subscription frequency sequence of R1 reaches the similarity threshold T s , determine whether the similarity between the subscription frequency sequence of R2 and the subscription frequency sequence of R3 reaches the similarity threshold T s , determine whether the similarity between the subscription frequency sequence of R2 and the subscription frequency sequence of R4 reaches the similarity threshold T s .

[0126] The sum of the number of second devices that reach the similarity threshold is counted, and the similarity ratio is calculated. The similarity ratio here is represented by the ratio of the number of similarities that reach the preset similarity threshold among multiple similarities to the total data volume of the device, that is, the sum of the number of second devices that reach the preset similarity threshold to the total data volume of the device is used to represent the similarity ratio. The total data volume of the device is the sum of the number of the first device and the second device.

[0127] A counter m may be set to indicate the total number of second devices that have reached the similarity threshold, that is, the number of devices that have reached the similarity threshold. (R,Neighbor) ≥T s When , m increases by 1, and then calculates the similarity ratio (M≥1 and m≥0), where M represents the sum of the number of first devices and their second devices, that is, the total data volume of the devices.

[0128] Determine whether the similarity ratio P reaches the similarity ratio threshold T p , if the similarity ratio P reaches the similarity ratio threshold T p , then initiate data subscription to the collector; if the similarity ratio P does not reach the similarity ratio threshold T p , then no data subscription to the collector is initiated.

[0129] In one example, the network behavior of devices in the same network can be monitored. Specifically, the number of device telemetry subscriptions may be similar or specific due to business traffic, specific range alarms, etc. Figure 3 For R1, R2, R3, and R4 in the example, if the traffic in a specific period is concentrated on the path R1-R2-R3, in order to obtain more detailed traffic data of R1, R2, and R3, R1, R2, and R3 need to subscribe to data more frequently, while R4 does not need to subscribe to data more frequently. In this case, it can be understood that the number of subscriptions of R1, R2, and R3 is relatively similar. For R2, the number of subscriptions of R2 in these periods is similar to that of R1 and R3, and is quite different from that of R4. The number of subscriptions can also be understood as subscription information, that is, for R2, the subscription information of R2 in these periods is similar to that of R1 and R3, and is quite different from that of R4. In view of this situation, the similarity between the subscription information corresponding to R2 and R1, R3, and R4 is calculated. The similarity between the subscription information corresponding to R2 and R1 and R3 is high, while the similarity between the subscription information corresponding to R2 and R4 is low. When the similarity is high, data subscription is initiated, and when the similarity is low, subscription is not initiated.

[0130] In the disclosed embodiments, the idea of ​​using distance to measure individual similarities in machine learning is combined, that is, the similarity between the first device and the second device is calculated using the distance between the subscription information, which can improve the accuracy of the determined similarity, and can also be understood as the high credibility of the determined similarity. By determining whether to initiate data subscription based on similarity, the automation of device Telemetry subscription collection can be improved, the pressure of long-term load on the device can be reduced, and the data backlog of the collector can be reduced. And this function can be implemented on the device side without the need for the collector to add functional modules, which can reduce the performance pressure of the collector.

[0131] Corresponding to the data subscription method provided in the above embodiment, the embodiment of the present disclosure also provides a data subscription device, such as Figure 4 As shown, this may include:

[0132] The acquisition module 401 is used to acquire first subscription information, the first subscription information includes subscription information of the first device in a historical time period; and acquire second subscription information, the second subscription information includes subscription information of the second device in the same historical time period;

[0133] A calculation module 402, configured to calculate the similarity between the first subscription information and the second subscription information;

[0134] The subscription determination module 403 is used to initiate data subscription to the collector when the similarity reaches a preset similarity threshold.

[0135] Optionally, the acquisition module 401 is specifically used to count the number of subscriptions of the first device in a historical time period, and use the number of subscriptions of the first device in the historical time period as the first subscription information; obtain the number of subscriptions of the second device in the historical time period counted by the second device, and use the number of subscriptions of the second device in the historical time period as the second subscription information.

[0136] Optionally, the acquisition module 401 is specifically used to count a first subscription frequency sequence of the first device within a historical time period, and use the first subscription frequency sequence of the first device within the historical time period as the first subscription information, wherein the first subscription frequency sequence includes the subscription frequencies of the first device at multiple time granularities, the time granularity is a time range divided based on the historical time period, and for each time granularity, the subscription frequencies at the time granularity included in the first subscription frequency sequence include: the proportion of the number of subscriptions of the first device within the time granularity to the number of subscriptions of the first device within the historical time period; obtain the second subscription frequency sequences of the second devices within the historical time period counted by multiple second devices, and use the second subscription frequency sequences of the multiple second devices within the historical time period as the second subscription information, wherein, for each second device, the second subscription frequency sequence includes the subscription frequencies of the second device at multiple time granularities, and for each time granularity, the subscription frequencies at the time granularity included in the second subscription frequency sequence include: the proportion of the number of subscriptions of the second device within the time granularity to the number of subscriptions of the second device within the historical time period.

[0137] Alternatively, if Figure 5 As shown, the device also includes:

[0138] The first judgment module 501 is used to judge whether the similarity reaches a preset similarity threshold for each similarity;

[0139] A statistical module 502, used to count the proportion of multiple similarities that reach a preset similarity threshold as a similarity ratio;

[0140] The second judgment module 503 is used to judge whether the similarity ratio reaches a preset similarity ratio threshold;

[0141] The similarity determination module 504 is configured to determine that if yes, the similarity reaches a preset similarity threshold; if no, the similarity does not reach the preset similarity threshold.

[0142] Optionally, the calculation module 402 is specifically used to calculate, for each time granularity, the distance between the subscription frequency of the first device at the time granularity and the subscription frequency of the second device at the time granularity; sum the distances corresponding to each time granularity to obtain the cumulative distance; calculate the ratio of the cumulative distance sum to the number of time granularities, and use the ratio as the similarity between the first subscription information and the second subscription information.

[0143] The present disclosure also provides an electronic device, such as Figure 6 As shown, it includes a processor 601 , a communication interface 602 , a memory 603 and a communication bus 604 , wherein the processor 601 , the communication interface 602 , and the memory 603 communicate with each other via the communication bus 604 .

[0144] Memory 603, used for storing computer programs;

[0145] The processor 601 is used to implement the method steps of the data subscription method in the above embodiment when executing the program stored in the memory 603.

[0146] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0147] The communication interface is used for communication between the above electronic device and other devices.

[0148] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0149] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0150] In another embodiment provided by the present disclosure, a computer-readable storage medium is further provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps of any of the above-mentioned data subscription methods are implemented.

[0151] In another embodiment provided by the present disclosure, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any one of the data subscription methods in the above embodiments.

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

[0153] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0154] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, electronic device, computer-readable storage medium, and computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0155] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the protection scope of the present disclosure. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure are included in the protection scope of the present disclosure.

Claims

1. A data subscription method, characterized in that: Applied to a first device, comprising: Acquire first subscription information, where the first subscription information includes subscription information of the first device within a historical time period, and the first subscription information is information corresponding to data subscription for network detection performed by the first device; Acquire second subscription information, where the second subscription information includes subscription information of a second device in the same historical time period, where the second subscription information is information corresponding to data subscription for network detection by the second device, and the second device is directly connected to the first device for communication; Calculating the similarity between the first subscription information and the second subscription information; When the similarity reaches a preset similarity threshold, a data subscription is initiated to the collector, so that the first device sends the collected data to the collector; The first device and the second device are used to send the collected data to the collector in data subscription.

2. The method according to claim 1, characterized in that The obtaining of the first subscription information includes: Counting the number of subscriptions of the first device in a historical time period, and using the number of subscriptions of the first device in the historical time period as the first subscription information; The obtaining of the second subscription information includes: The number of subscriptions of the second device in the historical time period counted by the second device is obtained, and the number of subscriptions of the second device in the historical time period is used as second subscription information.

3. The method according to claim 1, characterized in that The obtaining of the first subscription information includes: counting a first subscription frequency sequence of the first device in a historical time period, and using the first subscription frequency sequence of the first device in the historical time period as first subscription information, wherein the first subscription frequency sequence includes subscription frequencies of the first device at multiple time granularities, the time granularity being a time range divided based on the historical time period, and for each time granularity, the subscription frequency at the time granularity included in the first subscription frequency sequence includes: a proportion of the number of subscriptions of the first device in the time granularity to the number of subscriptions of the first device in the historical time period; The obtaining of the second subscription information includes: Obtain a second subscription frequency sequence of the second devices within the historical time period counted by multiple second devices, and use the second subscription frequency sequences of the multiple second devices within the historical time period as second subscription information, wherein, for each second device, the second subscription frequency sequence includes the subscription frequencies of the second device at multiple time granularities, and for each time granularity, the subscription frequencies at the time granularity included in the second subscription frequency sequence include: the proportion of the number of subscriptions of the second device within the time granularity to the number of subscriptions of the second device within the historical time period.

4. The method according to claim 1, characterized in that: The method further comprises: For each similarity, determining whether the similarity reaches a preset similarity threshold; Counting the proportion of multiple similarities that reach a preset similarity threshold as a similarity ratio; Determine whether the similarity ratio reaches a preset similarity ratio threshold; If so, determining that the similarity reaches a preset similarity threshold; If not, it is determined that the similarity does not reach the preset similarity threshold.

5. The method according to any one of claims 1 to 4, characterized in that: The calculating the similarity between the first subscription information and the second subscription information includes: For each time granularity, calculating a distance between a subscription frequency of the first device at the time granularity and a subscription frequency of the second device at the time granularity; Sum the distances corresponding to each time granularity to obtain the cumulative distance sum; The ratio of the cumulative sum of distances to the number of time granularities is calculated, and the ratio is used as the similarity between the first subscription information and the second subscription information.

6. A data subscription device, characterized in that: Applied to a first device, comprising: an acquisition module, configured to acquire first subscription information, the first subscription information including subscription information of a first device within a historical time period, the first subscription information being information corresponding to data subscription for network detection by the first device; and acquiring second subscription information, the second subscription information including subscription information of a second device within the same historical time period, the second device being directly connected to the first device in communication, the second subscription information being information corresponding to data subscription for network detection by the second device; A calculation module, used to calculate the similarity between the first subscription information and the second subscription information; The subscription determination module is used to initiate data subscription to the collector when the similarity reaches a preset similarity threshold, so that the first device sends the collected data to the collector; wherein the first device and the second device are used to send the collected data to the collector in the data subscription.

7. The device according to claim 6, characterized in that The acquisition module is specifically used to count the number of subscriptions of the first device in a historical time period, and use the number of subscriptions of the first device in the historical time period as the first subscription information; obtain the number of subscriptions of the second device in the historical time period counted by the second device, and use the number of subscriptions of the second device in the historical time period as the second subscription information.

8. The device according to claim 6, characterized in that The acquisition module is specifically used to count the first subscription frequency sequence of the first device in the historical time period, and use the first subscription frequency sequence of the first device in the historical time period as the first subscription information, wherein the first subscription frequency sequence includes the subscription frequencies of the first device at multiple time granularities, the time granularity is a time range divided based on the historical time period, and for each time granularity, the subscription frequency at the time granularity included in the first subscription frequency sequence includes: the proportion of the number of subscriptions of the first device in the time granularity to the number of subscriptions of the first device in the historical time period; obtain the second subscription frequency sequences of the second devices in the historical time period counted by multiple second devices, and use the second subscription frequency sequences of the multiple second devices in the historical time period as the second subscription information, wherein, for each second device, the second subscription frequency sequence includes the subscription frequencies of the second device at multiple time granularities, and for each time granularity, the subscription frequency at the time granularity included in the second subscription frequency sequence includes: the proportion of the number of subscriptions of the second device in the time granularity to the number of subscriptions of the second device in the historical time period.

9. The device according to claim 6, characterized in that The device also includes: A first judgment module, used for judging, for each similarity, whether the similarity reaches a preset similarity threshold; A statistical module, used to count the proportion of multiple similarities that reach a preset similarity threshold as a similarity ratio; A second judgment module is used to judge whether the similarity ratio reaches a preset similarity ratio threshold; The similarity determination module is configured to determine, if yes, that the similarity reaches a preset similarity threshold; if no, determine that the similarity does not reach the preset similarity threshold.

10. The device according to any one of claims 6 to 9, characterized in that The calculation module is specifically configured to calculate, for each time granularity, a distance between a subscription frequency of the first device at the time granularity and a subscription frequency of the second device at the time granularity; summing the distances corresponding to each time granularity to obtain a distance accumulation sum; The ratio of the cumulative sum of distances to the number of time granularities is calculated, and the ratio is used as the similarity between the first subscription information and the second subscription information.

11. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor The device, communication interface, and memory communicate with each other through a communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 5 when executing a program stored in a memory.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 5 are implemented.