Data collection method, device, equipment and storage medium

By adjusting the time granularity and order of the acquisition task indicators, the accuracy problem caused by changes in the acquisition task in the existing technology is solved, and efficient and accurate data acquisition in changing scenarios is achieved.

CN114816700BActive Publication Date: 2025-08-08SANGFOR TECH INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210406675.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-18
Publication Date
2025-08-08
Estimated Expiration
2042-04-18

AI Technical Summary

Technical Problem

In the changing acquisition task scenarios, event-triggered acquisition, multi-threaded/coroutine acquisition and fixed-time granularity acquisition methods are difficult to ensure acquisition accuracy, especially when emergencies or resource peaks occur, resulting in untimely acquisition or excessive resource overhead.

Method used

By obtaining multiple current acquisition task indicators, determining the current time granularity, traversing the collection task set in a predetermined order, adjusting the acquisition task indicators to obtain the target task allocation results, using this result to collect target data, adapt to changes in the acquisition task, and reduce the impact of overhead.

Benefits of technology

Under the changing of the acquisition task indicators, the optimal task allocation with low overhead and low impact is achieved, which improves the accuracy of host data acquisition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114816700B_ABST
    Figure CN114816700B_ABST
Patent Text Reader

Abstract

The present invention provides a data collection method, apparatus, device, and storage medium. The method obtains multiple current collection task indicators and determines a current time granularity based on the multiple current collection task indicators. The method then traverses the predetermined collection task indicators in a set of multiple collection tasks in a predetermined order and adjusts the predetermined collection task indicators from the current moment based on the current time granularity to obtain a target task allocation result. The target task allocation result is used to collect target data, which is then displayed in a display interface or processed. Because the method can achieve optimal collection task indicator allocation based on task changes while minimizing the impact on existing collection task indicators, it ensures optimal collection task indicator allocation in a low-overhead and low-impact manner, thereby improving the accuracy of host data collection when collection task indicators are increased or decreased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a data acquisition method, apparatus, device, and storage medium. Background Art

[0002] In related technologies, three methods are usually used to process host data collection:

[0003] (1) Event-triggered collection: This method requires monitoring task events. Event triggering has a certain overhead. Since the event arrival pattern cannot be predicted, the inability to respond in time in the event of an emergency may lead to event blocking or event loss. Therefore, the event-triggered collection method in the scenario of changing collection tasks will lead to untimely collection, which in turn affects the collection accuracy.

[0004] (2) Multithreaded / coroutine collection: This method can utilize the host's multitasking capabilities to collect multiple indicators simultaneously. However, in scenarios with changing collection tasks, it will significantly increase the host's collection resource overhead, causing resource peaks in the collection system, which may affect the collection accuracy.

[0005] (3) Fixed time granularity acquisition: This method divides tasks according to time granularity and assigns all acquisition tasks to corresponding moments for acquisition. However, once the task allocation of this method is given, it will not change and cannot adapt to changes in acquisition tasks. Therefore, it is still difficult to meet the acquisition system requirements in scenarios with changing acquisition tasks, resulting in a decrease in acquisition accuracy. Summary of the Invention

[0006] The embodiments of the present invention provide a data collection method, apparatus, device, and storage medium, which can improve the accuracy of host data collection in scenarios with changing collection tasks.

[0007] The technical solution of the present invention is achieved as follows:

[0008] An embodiment of the present invention provides a data collection method, including:

[0009] Acquire a plurality of current collection task indicators, wherein the plurality of current collection task indicators belong to a plurality of collection task sets; each collection task set includes at least one current collection task indicator of the same period; the plurality of current collection task indicators are existing collection task indicators after a collection task indicator is added or reduced to the plurality of collection task indicators;

[0010] Determining a current time granularity based on the multiple current acquisition task indicators;

[0011] Traversing the predetermined collection task indicators in the plurality of collection task sets in a predetermined order, adjusting the predetermined collection task indicators from the current moment based on the current time granularity to obtain a target task allocation result; the predetermined collection task indicator belongs to the plurality of current collection task indicators; the current moment is a collection moment pre-assigned by the predetermined collection task indicator;

[0012] Target data is collected using the target task allocation result and displayed in a display interface or processed with respect to the target data.

[0013] In the above solution, determining the current time granularity based on the multiple current acquisition task indicators includes:

[0014] If the multiple current collection task indicators are existing collection indicators after the multiple collection task indicators are reduced by the collection task indicators, determining the preset time granularity as the current time granularity;

[0015] The step of traversing the predetermined collection task indicators in the plurality of collection task sets in a predetermined order and adjusting the predetermined collection task indicators from the current moment based on the current time granularity to obtain a target task allocation result includes:

[0016] Traversing the multiple collection task sets in descending order of the periods, and traversing each current collection task indicator in each collection task set in descending order of the preset overhead ratio corresponding to each current collection task indicator; the predetermined collection task indicator includes: the multiple current collection task indicators;

[0017] Adjusting each current collection task indicator 2N times at each collection moment according to a preset integer N and the preset time granularity from the current moment, and determining 2N adjustment moments corresponding to each current collection task indicator after the 2N adjustments, and collection task indicators corresponding to each collection moment after the 2N adjustments; N is an integer greater than or equal to 1; each collection moment includes the collection moments pre-assigned to the multiple current collection task indicators within a preset period;

[0018] Calculating the adjusted cost change values corresponding to the 2N adjustment moments, respectively; the adjusted cost change value is the difference between the sum of the preset cost proportions corresponding to the corresponding adjustment moment after adjustment and the sum of the preset cost proportions corresponding to the adjustment moment before adjustment;

[0019] Based on the maximum adjustment overhead change value, the corresponding adjustment times are determined, and the collection task indicators corresponding to each collection moment after the adjustment of the corresponding adjustment times are respectively obtained to obtain multiple allocation results, so as to determine the target task allocation result through the multiple allocation results; the allocation result is the result of the multiple current collection task indicators being allocated to the corresponding moment after each current collection task indicator is adjusted for the corresponding adjustment times.

[0020] In the above solution, determining the current time granularity based on the multiple current acquisition task indicators includes:

[0021] If the multiple current collection task indicators are existing collection indicators after adding an additional collection task indicator to the multiple collection task indicators, the current time granularity is calculated by increasing the collection period, increasing the collection overhead, and the periods and preset overhead ratios corresponding to the multiple collection task sets respectively; the increasing the collection task indicator corresponds to increasing the collection period and increasing the collection overhead;

[0022] After determining the current time granularity based on the multiple current collection task indicators, traversing each current collection task indicator in the multiple collection task sets in a predetermined order, and adjusting each current collection task indicator from the current moment based on the current time granularity, before obtaining the target task allocation result, the method further includes:

[0023] The current time granularity is used to perform time slot division in a common multiple period to determine multiple feasible moments; the common multiple period is the least common multiple period of the periods corresponding to the multiple acquisition task sets.

[0024] In the above solution, traversing the predetermined collection task indicators in the plurality of collection task sets in a predetermined order, adjusting the predetermined collection task indicators from the current moment based on the current time granularity, and obtaining the target task allocation result includes:

[0025] Traversing the multiple collection task sets in descending order of the periods, and traversing each collection task indicator in each collection task set in descending order of the preset overhead proportion corresponding to each collection task indicator; the predetermined collection task indicators include: the multiple collection task indicators;

[0026] Adjust each of the acquisition task indicators 2N times from the current moment in the multiple feasible moments according to a preset integer N and the current time granularity, and determine 2N feasible adjustment moments corresponding to each of the acquisition task indicators after the 2N adjustments;

[0027] De-overlapping and merging the 2N feasible adjustment moments with each collection moment to obtain multiple new collection moments corresponding to each adjustment, and obtaining the collection task indicators assigned to each of the multiple new collection moments after each adjustment; each collection moment includes the multiple collection indicators and is a collection moment pre-assigned within a preset period;

[0028] Determining multiple intermediate new collection moments from the multiple new collection moments according to the increased collection cycle, and adding the increased collection overhead to the preset overhead proportions corresponding to the multiple intermediate new collection moments after each adjustment to obtain a sum of multiple new overhead proportions;

[0029] Multiple allocation results are determined by summing the multiple new overhead proportions and combining the collection task indicators corresponding to the multiple new collection moments after each adjustment, so as to determine the target task allocation result through the multiple allocation results.

[0030] In the above solution, each current collection task indicator is adjusted 2N times at each collection moment according to a preset integer N and the preset time granularity from the current moment, and 2N adjustment moments corresponding to each current collection task indicator after the 2N adjustments are determined, as well as the collection task indicators corresponding to each collection moment after the 2N adjustments, including:

[0031] Adjust each current collection task indicator from the current moment by M time granularities in the direction of the first time axis to obtain an M-th adjusted moment, and obtain the collection task indicators respectively assigned to each collection moment after the M-th adjustment, until each current collection task indicator is adjusted from the current moment by N time granularities in the direction of the first time axis to obtain N adjusted moments, and obtain the collection task indicators respectively assigned to each collection moment after the N-th adjustment in the direction of the first time axis; M is an integer greater than or equal to 1 and less than N;

[0032] Each current collection task indicator is adjusted from the current moment to the second time axis by K time granularities to obtain the Kth adjustment moment, and the collection task indicators corresponding to each collection moment after the Kth adjustment are obtained, until each current collection task indicator is adjusted from the current moment to the second time axis by N time granularities to obtain the 2N adjustment moments, and the collection task indicators corresponding to each collection moment after the Nth adjustment in the second time axis direction are obtained; K is an integer greater than or equal to 1 and less than N.

[0033] In the above solution, the corresponding adjustment times are determined based on the maximum adjustment cost change value, and the collection task indicators corresponding to the respective collection moments after the corresponding adjustment times are adjusted are used to obtain multiple allocation results, including:

[0034] Determine, among the 2N adjustment moments, a maximum adjustment moment corresponding to a maximum adjustment overhead change value;

[0035] Determine the first adjustment number corresponding to the maximum adjustment moment, and determine the allocation result corresponding to the first adjustment number through the collection task indicators corresponding to each collection moment after the first adjustment number is adjusted to obtain the multiple allocation results; the corresponding adjustment number includes: the first adjustment number.

[0036] In the above solution, the current time granularity is calculated by increasing the collection period, increasing the collection overhead, and calculating the period and preset overhead ratio corresponding to each of the multiple collection task information sets, including:

[0037] Calculating the ratio of the period corresponding to each collection task set to the number of collection task indicators in each collection task set, and determining the maximum integer between the ratio and a predetermined value;

[0038] Determine a smallest intermediate integer among the maximum integers corresponding to the plurality of collection task sets;

[0039] Dividing the periods corresponding to the plurality of acquisition task sets by the intermediate integer to obtain a calculation result;

[0040] The current time granularity is determined based on the calculation result.

[0041] In the above solution, adjusting each acquisition task indicator 2N times from the current moment in the multiple feasible moments according to a preset integer N and the current time granularity, and determining 2N feasible adjustment moments corresponding to each acquisition task indicator after the 2N adjustments, includes:

[0042] Adjust each of the acquisition task indicators from the current moment in the common multiple period by P time granularities in the direction of the first time axis of the common multiple period to obtain the Pth feasible adjustment moment, until each of the acquisition task indicators is adjusted from the current moment to the first time axis of the common multiple period by N time granularities to obtain N feasible adjustment moments; P is an integer greater than or equal to 1 and less than N;

[0043] Adjust each acquisition task indicator from the current moment in the common multiple period to the second time axis direction of the common multiple period by Q time granularities to obtain the Qth feasible adjustment moment, until each acquisition task indicator is adjusted from the current moment to the first time axis direction of the common multiple period by N time granularities to obtain the 2N feasible adjustment moments; Q is an integer greater than or equal to 1 and less than N.

[0044] In the above solution, multiple allocation results are determined by summing the multiple new overhead proportions and combining the collection task indicators corresponding to the multiple new collection moments after each adjustment, including:

[0045] Determining a maximum sum of new overhead proportions from the sums of the multiple new overhead proportions, and determining a maximum intermediate new acquisition time corresponding to the maximum sum of new overhead proportions;

[0046] Allocating the increased collection task indicator to the maximum intermediate new collection moment, and then combining the collection task indicators corresponding to the multiple new collection moments after each adjustment to determine the intermediate allocation result after each adjustment, thereby obtaining 2N intermediate allocation results corresponding to each collection task indicator;

[0047] Establishing a corresponding relationship between the intermediate allocation result and the sum of the maximum new expenditure proportion;

[0048] The minimum sum of the maximum new overhead proportions is determined among the sums of the multiple maximum new overhead proportions, so as to determine that the intermediate allocation result corresponding to the minimum sum of the maximum new overhead proportions is the allocation result after each adjustment, so as to obtain the multiple allocation results.

[0049] In the above solution, determining the target task allocation result based on the multiple allocation results includes:

[0050] Determining a first maximum adjusted cost change value among the adjusted cost change values corresponding to each of the allocation results;

[0051] If the first maximum adjustment cost change value is greater than a preset optimization threshold, the target allocation result corresponding to the first maximum adjustment cost change value is determined as the target task allocation result.

[0052] In the above solution, determining the target task allocation result based on the multiple allocation results includes:

[0053] The minimum sum of the first new overhead proportions is determined from the sum of the maximum new overhead proportions corresponding to each allocation result, and the target allocation result corresponding to the minimum sum of the first new overhead proportions is determined as the target task allocation result.

[0054] An embodiment of the present invention further provides a data acquisition device, comprising:

[0055] A data acquisition unit is configured to acquire a plurality of current collection task indicators, wherein the plurality of current collection task indicators belong to a plurality of collection task sets; each collection task set includes at least one collection task indicator of the same period; the plurality of current collection task indicators are existing collection task indicators after a collection task indicator is added or reduced to the plurality of collection task indicators;

[0056] A determining unit, configured to determine a current time granularity based on the multiple current acquisition task indicators;

[0057] a traversal adjustment unit, configured to traverse the predetermined collection task indicators in the plurality of collection task sets in a predetermined order, and adjust the predetermined collection task indicators from a current moment based on the current time granularity to obtain a target task allocation result; the predetermined collection task indicator belongs to the plurality of current collection task indicators; and the current moment is a collection moment pre-assigned by the predetermined collection task indicator;

[0058] The collecting unit is used to collect target data using the target task allocation result, and display the target data in a display interface or process the target data.

[0059] An embodiment of the present invention further provides a data acquisition device, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and the processor implements the steps in the above method when executing the program.

[0060] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps in the above method when executed by a processor.

[0061] In an embodiment of the present invention, multiple current collection task indicators are obtained, wherein the multiple current collection task indicators belong to multiple collection task sets; each collection task set includes at least one current collection task indicator of the same period; the multiple current collection task indicators are existing collection task indicators after the multiple collection task indicators are newly added or reduced; the current time granularity is determined based on the multiple current collection task indicators; the predetermined collection task indicators in the multiple collection task sets are traversed in a predetermined order, and based on the current time granularity, the predetermined collection task indicators are adjusted from the current moment to obtain a target task allocation result; the current moment is the collection moment pre-assigned to each collection task indicator; the target data is collected using the target task allocation result, and is displayed in a display interface or processed for the target data. Since this solution can achieve optimal collection task indicator allocation based on the changes in the collection indicators while minimizing the impact on the existing collection task indicators, it ensures optimal collection task indicator allocation in a low-overhead and low-impact manner, thereby improving the accuracy of host data collection when the collection task indicators increase or decrease. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 An optional flow chart of a data acquisition method provided in an embodiment of the present invention;

[0063] Figure 2 A schematic diagram of an optional effect of the data acquisition method provided by an embodiment of the present invention;

[0064] Figure 3 An optional flow chart of a data acquisition method provided in an embodiment of the present invention;

[0065] Figure 4 An optional flow chart of a data acquisition method provided in an embodiment of the present invention;

[0066] Figure 5 An optional flow chart of a data acquisition method provided in an embodiment of the present invention;

[0067] Figure 6 An optional flow chart of a data acquisition method provided in an embodiment of the present invention;

[0068] Figure 7 An optional flow chart of a data acquisition method provided in an embodiment of the present invention;

[0069] Figure 8 A schematic structural diagram of a data acquisition device provided in an embodiment of the present invention;

[0070] Figure 9 A schematic diagram of a hardware entity of a data acquisition device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0071] In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention are further elaborated in detail below with reference to the accompanying drawings and embodiments. The described embodiments should not be regarded as limiting the present invention. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0072] Figure 1 An optional flow chart of the data collection method provided by the embodiment of the present invention is combined with Figure 1 The steps shown are explained.

[0073] S101. Acquire multiple current collection task indicators. The multiple current collection task indicators are existing collection task indicators after multiple collection task indicators are newly added or reduced.

[0074] In an embodiment of the present invention, a terminal obtains multiple current collection task indicators. The multiple current collection task indicators belong to multiple collection task sets. Each collection task set includes at least one current collection task indicator for the same period. The multiple current collection task indicators are the existing collection task indicators after the multiple collection task indicators are added or reduced.

[0075] In an embodiment of the present invention, after a terminal detects the addition or removal of multiple collection task indicators, it obtains multiple current collection task indicators. The terminal groups the multiple collection task indicators into multiple collection task sets according to a predetermined rule. The current collection task indicators within each collection task set have the same period. The collection task indicators within different collection task sets have different periods.

[0076] In an embodiment of the present invention, when a terminal detects that multiple collection task indicators have increased or decreased, it determines that the multiple collection task indicators have been updated. The terminal then obtains multiple current collection task indicators and a preset task allocation result. The preset task allocation result includes a set of collection task indicators allocated to each collection moment within a preset period. The preset task allocation result is determined based on the period and preset overhead ratio corresponding to each of the multiple collection task indicators. The allocation moment corresponding to each collection task indicator in the preset task allocation result is the current moment. For example, the collection moments may be seven collection moments within a 60-second period: 0 seconds, 10 seconds, 20 seconds, 30 seconds, 40 seconds, 50 seconds, and 60 seconds. The preset task allocation result includes a set of collection task indicators allocated to each of the seven collection moments. The number of collection task indicators allocated to each collection moment may be the same or different.

[0077] In an embodiment of the present invention, a terminal groups multiple collection task indicators according to the periods corresponding to the multiple collection task indicators, thereby obtaining multiple initial collection task sets. The terminal uses the periods corresponding to the multiple collection task sets to calculate a preset time granularity and a preset period. The terminal uses the preset time granularity to divide the preset period into time slots, thereby determining the respective collection moments. The terminal then traverses each collection task indicator in the multiple initial collection task sets in a predetermined order, and, based on the period corresponding to each collection task indicator and the preset overhead ratio, assigns each collection task indicator to a corresponding moment in the respective collection moments, thereby obtaining a preset task assignment result.

[0078] In an embodiment of the present invention, the collection task indicator may include: a script or instruction information for collecting hardware or software indicator information of the terminal. The preset overhead ratio may include: a central processing unit (CPU) overhead ratio, a memory overhead ratio, and an input / output (IO) overhead ratio when executing the corresponding collection task indicator, or a combination of these.

[0079] S102: Determine a current time granularity based on multiple current collection task indicators.

[0080] In the embodiment of the present invention, the terminal determines the current time granularity based on a plurality of current collection task indicators.

[0081] The current time granularity represents the optimal time granularity of the periods corresponding to the multiple current acquisition task indicators.

[0082] In an embodiment of the present invention, if the multiple current collection task indicators are existing collection indicators after the multiple collection task indicators are reduced by the collection task indicators, the terminal determines the preset time granularity as the current time granularity. The preset time granularity is the time granularity calculated when allocating the multiple collection task indicators to obtain the preset task allocation result.

[0083] In an embodiment of the present invention, if multiple current collection task indicators include a newly added increase collection task indicator, the terminal calculates the current time granularity by increasing the collection period, increasing the collection overhead, the periods corresponding to the multiple collection task sets, and the preset overhead ratio. Increasing the collection task indicator corresponds to increasing the collection period and increasing the collection overhead.

[0084] S103: traverse the predetermined collection task indicators in the plurality of collection task sets in a predetermined order, and adjust the predetermined collection task indicators from the current moment based on the current time granularity to obtain a target task allocation result.

[0085] In an embodiment of the present invention, a terminal traverses the predetermined collection task indicators in multiple collection task sets in a predetermined order and adjusts the predetermined collection task indicators from the current time based on the current time granularity to obtain a target task allocation result. The current time is the pre-assigned collection time for each collection task indicator, that is, the time at which each collection task indicator is assigned in the preset task allocation result.

[0086] In an embodiment of the present invention, the terminal traverses each scheduled collection task indicator in descending order according to the corresponding periods of multiple collection task sets and in descending order according to the preset overhead ratio of each scheduled collection task indicator. The terminal adjusts each scheduled collection task indicator from the current moment in the preset task allocation result to two directions of the time axis within the preset period for multiple times, and each adjustment will obtain an adjusted moment corresponding to each scheduled collection task indicator. The terminal then determines an optimal adjusted moment corresponding to each scheduled collection task indicator based on the overhead ratio of each scheduled collection task indicator. The terminal determines the collection task indicators corresponding to each collection moment after the adjustment number corresponding to the moment, so as to form an allocation result corresponding to each scheduled collection task indicator. The terminal then determines the target task allocation result based on the multiple allocation results corresponding to the multiple adjustments.

[0087] In an embodiment of the present invention, when multiple current collection task indicators are existing collection task indicators after the collection task indicators have been reduced, the terminal traverses multiple collection task sets in descending order of periodicity and traverses each current collection task indicator in each collection task set in descending order of preset overhead ratio. The terminal adjusts each current collection task indicator 2N times at each collection time point based on a preset integer N and a preset time granularity from the current time point, determines 2N adjustment times corresponding to each current collection task indicator after the 2N adjustments, and the collection task indicator assigned to each collection time point after the 2N adjustments. The terminal calculates the adjusted overhead change values corresponding to each of the 2N adjustment times. Based on the adjusted overhead change values and the collection task indicators assigned to each collection time point after the 2N adjustments, the terminal obtains an allocation result for each adjustment, thereby obtaining multiple allocation results. The terminal determines a first maximum adjusted overhead change value from the adjusted overhead change values corresponding to each allocation result. If the first maximum adjusted overhead change value is greater than a preset optimization threshold, the terminal determines the target allocation result corresponding to the first maximum adjusted overhead change value as the target task allocation result and uses the target task allocation result for data collection. N is an integer greater than or equal to 1;

[0088] In an embodiment of the present invention, when multiple current collection task indicators include a newly added collection task indicator, increasing the collection task indicator corresponds to increasing the collection period and the collection overhead. The terminal can first determine the latest time granularity by increasing the collection period, increasing the collection overhead, and the periods and preset overhead ratios corresponding to the multiple collection task sets. The terminal can then use the latest time granularity to divide the time slots within the common multiple period to determine multiple feasible time points.

[0089] The terminal then traverses multiple collection task sets in descending order of periodicity and traverses each collection task indicator (i.e., all other collection task indicators except the added collection task indicator) in each collection task set in descending order of preset overhead percentage. The terminal adjusts each collection task indicator 2N times from the current moment, based on a preset integer N and the latest time granularity, across multiple feasible moments, and determines 2N feasible adjustment moments corresponding to each collection task indicator after the 2N adjustments. The terminal de-duplicates and merges these 2N feasible adjustment moments with each collection moment to obtain multiple new collection moments, and obtains the collection task indicators assigned to each of the new collection moments after each adjustment. The terminal adds the increased collection overhead to the sum of the preset overhead percentages corresponding to each of the new collection moments after each adjustment, and determines the sum of multiple new overhead percentages corresponding to each collection task indicator after each adjustment. The terminal uses the sum of the multiple new overhead percentages, combined with the collection task indicators assigned to each of the new collection moments after each adjustment, to determine the allocation result for each adjustment, thereby obtaining multiple allocation results. The terminal determines the minimum sum of the first new overhead proportions from the sum of the maximum new overhead proportions corresponding to each allocation result, and determines the target allocation result corresponding to the minimum sum of the first new overhead proportions as the target task allocation result, and uses the target task allocation result to collect data.

[0090] S104: Target data is collected using the target task allocation result, and is displayed in a display interface or processed.

[0091] In the embodiment of the present invention, the terminal collects target data using the target task allocation result, and displays the target data in a display interface or processes the target data.

[0092] In this embodiment of the present invention, the terminal uses the task collection indicators in the target task allocation results to collect terminal indicator information at corresponding times within the corresponding cycle through a preset program. After collecting the target data, the terminal displays the target data on the display interface, issues alarms based on the target data, dynamically adjusts resources, and adds or deletes related modules and components.

[0093] For example, combined Figure 2, the embodiment of the present invention can be used in the scenario of host indicator collection, such as the need to collect indicator information of the operating system kernel 105, program 104 and component 103 in the host. In this scenario, the collector of the terminal collects different indicators through collection task 1, collection task 2...collection task n. The task monitoring module 102 monitors the resource overhead (including CPU, memory, IO, etc.) during the execution of different collection tasks. The task management module 101 adaptively adjusts the task scheduling time granularity according to the resource overhead of the collection task, and then dynamically adjusts the collection task execution time according to the resource demand constraints of the collector to perform optimal collection task management; the task management module realizes the actual management of the collection task through the scheduler 100.

[0094] In an embodiment of the present invention, the key to data collection lies in the adaptive adjustment of the collection time granularity in the task management module 101, which can automatically select the optimal time granularity according to the collection task set to achieve low-overhead task traversal. At the same time, the collection tasks are managed according to the overhead constraints of the collector, and the optimal allocation of collection tasks is achieved to solve the overhead "tidal" problem. The optimal adjustment of task allocation can also be achieved after the collection task is updated.

[0095] In an embodiment of the present invention, multiple current collection task indicators are obtained, wherein the multiple current collection task indicators belong to multiple collection task sets; each collection task set includes at least one current collection task indicator of the same period; the multiple current collection task indicators are existing collection task indicators after the multiple collection task indicators are newly added or reduced; the current time granularity is determined based on the multiple current collection task indicators; the predetermined collection task indicators in the multiple collection task sets are traversed in a predetermined order, and based on the current time granularity, the predetermined collection task indicators are adjusted from the current moment to obtain a target task allocation result; the current moment is the collection moment pre-assigned to each collection task indicator; the target data is collected using the target task allocation result, and is displayed in a display interface or processed for the target data. Since this solution can achieve optimal collection task indicator allocation based on the changes in the collection indicators while minimizing the impact on the existing collection task indicators, it ensures optimal collection task indicator allocation in a low-overhead and low-impact manner, thereby improving the accuracy of host data collection when the collection task indicators increase or decrease.

[0096] In some embodiments, see Figure 3 , Figure 3 An optional flow chart of a data acquisition method provided by an embodiment of the present invention is provided. Figure 1 S101 - S104 shown can be implemented through S201 to S204 , which will be described in conjunction with each step.

[0097] S201. The collector collects the current collection task indicators and the preset overhead ratio.

[0098] In an embodiment of the present invention, when a terminal's collector begins executing a collection function or a task status changes, the collector needs to collect the cycles of all collection tasks and group them according to different cycles for easier management. It also needs to collect the preset overhead percentages of the corresponding collection tasks, which may include CPU usage, memory overhead, and I / O occupancy, depending on requirements. The preset overhead percentages at the beginning of the collector's operation can be estimated based on historical collection statistics, and can be evaluated based on actual measurements after a period of subsequent collection operation.

[0099] S202, adaptive time granularity selection: select the optimal basic collection time granularity according to the collection task indicator cycle.

[0100] In an embodiment of the present invention, when the collector of the terminal needs to perform collection task management, it is first necessary to select the optimal time granularity based on the collection task set. The time granularity is the maximum basic time slice that can meet the collection cycle requirements of all collection tasks (such as: 10s and 20s collection cycles, the optimal time granularity is 10s), thereby reducing the management overhead of the collector while ensuring the effect of subsequent task management.

[0101] S203 , allocating collection tasks that meet overhead constraints: allocating collection moments of different collection tasks according to preset overhead ratios and time granularity.

[0102] In the embodiment of the present invention, the collector of the terminal allocates each collection task indicator to each collection moment in the collection cycle according to the preset overhead ratio of each collection task indicator and the determined time granularity.

[0103] S204, optimal adjustment of collection tasks: when collection tasks are increased or decreased, collection is adjusted based on the principle of minimal impact on the current collection tasks.

[0104] In an embodiment of the present invention, the collector update of the terminal can achieve optimal current task adjustment and allocation of new collection tasks based on task changes with minimal impact on existing collection tasks, thereby ensuring optimal allocation of collection tasks in a low-overhead and low-impact manner.

[0105] In an embodiment of the present invention, during the collection process, the terminal selects an appropriate preset time granularity as the basis for task scheduling based on the current set of collection tasks, thereby supporting the scheduling capabilities of collection management while reducing overhead. The terminal implements optimal collection task management based on the preset time granularity and in combination with resource constraints, and allocates collection tasks to different collection moments in the most appropriate manner, while minimizing the overhead "tide" phenomenon of the collection process as much as possible. The terminal monitors the preset overhead ratio of each collection task indicator in real time, and determines whether it is necessary to adjust the collection time of each collection task based on the monitoring results of the preset overhead ratio; when a new collection task indicator is added, the terminal selects an appropriate collection task from the preset task allocation results for adjustment, thereby minimizing the impact on existing collection task indicators as much as possible while ensuring collection constraints and reducing overhead "tides."

[0106] In some embodiments, Figure 1 S102 to S103 shown can be implemented through S105 to S109, which will be described in conjunction with each step.

[0107] S105: If the multiple current collection task indicators are existing collection indicators obtained by reducing the collection task indicators, determine the preset time granularity as the current time granularity.

[0108] In the embodiment of the present invention, if the multiple current collection task indicators are existing collection indicators obtained by reducing the collection task indicators, the terminal determines the preset time granularity as the current time granularity.

[0109] S106: traverse multiple collection task sets in descending order of period, and traverse each current collection task indicator in each collection task set in descending order of preset overhead proportion corresponding to each current collection task indicator.

[0110] In an embodiment of the present invention, if multiple current collection task indicators are existing collection indicators after the collection task indicators are reduced, the terminal traverses multiple collection task sets in descending order of period, and traverses each current collection task indicator in each collection task set in descending order of the preset overhead ratio corresponding to each current collection task indicator.

[0111] The scheduled collection task indicators include: multiple current collection task indicators.

[0112] In an embodiment of the present invention, since different collection task sets include collection task indicators for different periods, and since the periods vary in size, the terminal sorts the multiple collection task sets in descending order of period. Furthermore, since each current collection task indicator corresponds to a different preset overhead percentage, the terminal sorts each current collection task indicator in each collection task set in descending order of preset overhead percentage. The terminal then traverses each current collection task indicator in each collection task set in descending order of period and preset overhead percentage.

[0113] S107. Adjust each current collection task indicator 2N times at each collection moment based on a preset integer N and a preset time granularity from the current moment, determine 2N adjustment moments corresponding to each current collection task indicator after the 2N adjustments, and determine the collection task indicators corresponding to each collection moment after the 2N adjustments.

[0114] In an embodiment of the present invention, the terminal adjusts each current collection task indicator 2N times at each collection moment based on a preset integer N and a preset time granularity from the current moment, determining 2N adjustment moments corresponding to each current collection task indicator after the 2N adjustments, and the collection task indicator assigned to each collection moment after the 2N adjustments. N is an integer greater than or equal to 1. Each collection moment includes multiple collection moments pre-assigned within a preset period for the current collection task indicator.

[0115] In this embodiment of the present invention, each current collection task indicator corresponds to a current time in the preset task allocation result. The terminal adjusts each current collection task indicator N times from the current time along the time axis within a preset period, based on a preset integer N and a preset time granularity, at each collection time in a first time direction. Furthermore, the terminal adjusts each current collection task indicator N times at each collection time in a second time direction. After each adjustment, the terminal obtains an adjusted time and the collection task indicator corresponding to each collection time after the adjustment. Ultimately, the terminal obtains 2N adjusted time points, and each collection task indicator corresponding to each collection time after each adjustment.

[0116] The various collection moments within the preset period are obtained by dividing the preset period into time slots by the terminal according to a preset time granularity.

[0117] S108: Calculate the adjustment cost change values corresponding to the 2N adjustment moments.

[0118] In an embodiment of the present invention, the terminal calculates the adjusted overhead change values corresponding to the 2N adjustment moments, wherein the adjusted overhead change value is the difference between the sum of the preset overhead proportions corresponding to the corresponding adjustment moment after adjustment and the sum of the preset overhead proportions before adjustment.

[0119] In this embodiment of the present invention, after each adjustment, the terminal is assigned a collection task indicator at each adjustment time. The terminal adds the preset overhead percentages of the collection task indicators corresponding to each adjustment time to obtain the sum of the adjusted preset overhead percentages. The terminal then subtracts the pre-calculated sum of the preset overhead percentages before the adjustment from the sum of the adjusted preset overhead percentages to obtain the adjusted overhead change value for each adjustment time.

[0120] S109: Determine the corresponding adjustment times based on the maximum adjustment cost change value, and obtain multiple allocation results by respectively allocating the corresponding collection task indicators at each collection moment after adjusting the corresponding adjustment times.

[0121] In this embodiment of the present invention, the terminal determines a corresponding adjustment number based on the maximum adjustment cost change value, and obtains multiple allocation results by respectively allocating the collection task indicators corresponding to each collection moment after the corresponding adjustment number is adjusted. The allocation results are the results of allocating the multiple current collection task indicators to the corresponding moments after each current collection task indicator is adjusted by the corresponding adjustment number.

[0122] In the embodiment of the present invention, the terminal determines the maximum adjustment cost change value and the corresponding adjustment times of the adjustment time, and then combines the collection task indicators corresponding to the collection moments after the adjustment times are adjusted to obtain the allocation result of the adjustment times.

[0123] In an embodiment of the present invention, since this scheme can achieve the optimal allocation of collection task indicators while minimizing the impact on existing collection task indicators when the collection task indicators are reduced, it can ensure the optimal allocation of collection task indicators in a low-overhead and low-impact manner, thereby improving the accuracy of host data collection in the scenario of changing collection tasks.

[0124] In some embodiments, S107 shown can be implemented through S110 to S111 , which will be described in conjunction with each step.

[0125] S110. Adjust each current collection task indicator from the current moment to the first time axis by M time granularities to obtain the Mth adjustment moment, and obtain the collection task indicators corresponding to each collection moment after the Mth adjustment, until each current collection task indicator is adjusted from the current moment to the first time axis by N time granularities to obtain N adjustment moments, and obtain the collection task indicators corresponding to each collection moment after the Nth adjustment in the direction of the first time axis.

[0126] In an embodiment of the present invention, the terminal adjusts each current collection task indicator from the current moment by M time granularities in the direction of the first time axis to obtain the Mth adjusted moment, and obtains the collection task indicator corresponding to each collection moment after the Mth adjustment, until each current collection task indicator is adjusted from the current moment by N time granularities in the direction of the first time axis to obtain N adjusted moments, and obtains the collection task indicator corresponding to each collection moment after the Nth adjustment in the direction of the first time axis. Where M is an integer greater than or equal to 1 and less than N.

[0127] S111. Adjust each current collection task indicator from the current moment to the second time axis by K time granularities to obtain the Kth adjustment moment, and obtain the collection task indicators corresponding to each collection moment after the Kth adjustment, until each current collection task indicator is adjusted from the current moment to the second time axis by N time granularities to obtain 2N adjustment moments, and obtain the collection task indicators corresponding to each collection moment after the Nth adjustment in the direction of the second time axis.

[0128] In an embodiment of the present invention, the terminal adjusts each current collection task indicator from the current moment by K time granularities in the direction of the second time axis to obtain the Kth adjusted moment, and obtains the collection task indicator corresponding to each collection moment after the Kth adjustment. This continues until each current collection task indicator is adjusted from the current moment by N time granularities in the direction of the second time axis to obtain 2N adjusted moments, and obtains the collection task indicator corresponding to each collection moment after the Nth adjustment in the direction of the second time axis. Where K is an integer greater than or equal to 1 and less than N.

[0129] In some embodiments, the illustrated S109 may be implemented through S112 to S113 , which will be described in conjunction with each step.

[0130] S112: Determine a maximum adjustment time corresponding to a maximum adjustment cost change value among the 2N adjustment times.

[0131] In the embodiment of the present invention, since the 2N adjustment moments respectively correspond to adjustment cost change values, the terminal can determine the maximum adjustment moment corresponding to the maximum adjustment cost change value among the 2N adjustment moments.

[0132] S113: Determine a first adjustment number corresponding to the maximum adjustment time, and determine an allocation result corresponding to the first adjustment number based on the corresponding collection task indicators allocated to each collection time after the first adjustment number is adjusted, so as to obtain multiple allocation results.

[0133] In an embodiment of the present invention, the terminal determines the first adjustment number corresponding to the maximum adjustment time, and determines the allocation result corresponding to the first adjustment number through the collection task indicators corresponding to each collection time after the first adjustment number is adjusted, so as to obtain multiple allocation results.

[0134] In an embodiment of the present invention, the terminal determines a first maximum adjusted cost change value from the adjusted cost change values corresponding to each allocation result. In this embodiment of the present invention, if the terminal detects that the first maximum adjusted cost change value is greater than a preset optimization threshold, the terminal determines the target allocation result corresponding to the first maximum adjusted cost change value as the target task allocation result.

[0135] In the embodiment of the present invention, the preset optimization threshold is a user-configured minimum value of the overhead peak decrease, and is used to evaluate whether the collection task adjustment should be performed.

[0136] In this embodiment of the present invention, the terminal determines the first adjustment number corresponding to the maximum change in adjusted overhead. This number is then combined with the collection task indicators assigned to each collection moment after this adjustment to form an allocation result. This is the allocation result corresponding to each current collection task indicator. The terminal then determines the target task allocation result based on the adjusted overhead change values corresponding to each allocation result, and then collects data. Because this solution reduces task overhead and algorithm complexity while ensuring effective allocation of collection task indicators, it avoids system crashes during terminal collection and improves collection efficiency.

[0137] In some embodiments, see Figure 4 , Figure 4 This is an optional flow chart of the data collection method provided by an embodiment of the present invention. S104-S113 shown can be implemented through S205 to S214, which will be described in conjunction with each step.

[0138] S205: Obtain the collection task allocation result after the collection task indicator is deleted.

[0139] In the embodiment of the present invention, the terminal obtains the collection task allocation result after the collection task indicator is deleted.

[0140] S206: Set the task impact factor N and optimize the threshold k.

[0141] In an embodiment of the present invention, the user of the terminal sets the collection impact factor N (i.e., the maximum number of moments before and after the collection task can be adjusted) and the optimization threshold k (i.e., the minimum value of the overhead peak drop, used to evaluate whether the collection task adjustment should be performed) according to the collection requirements.

[0142] S207. Traverse all collection task sets Oi in descending order of Ti.

[0143] In the embodiment of the present invention, the terminal traverses all collection task sets Oi according to the descending order of the periods Ti of all collection task sets.

[0144] S208: Is the Oi traversal completed?

[0145] In the embodiment of the present invention, the terminal determines whether all sets Oi have been traversed, and if so, executes S211 , and if not, executes S209 .

[0146] S209: Whether the collection task is traversed and completed.

[0147] In the embodiment of the present invention, the terminal determines whether the traversal of the collection task is completed, and if so, executes S208 ; if not, executes S210 .

[0148] S210 , obtaining the maximum cost peak reduction value of all moments of the collection task indicator shifted by at most N d moments, and the distribution result of the optimization result.

[0149] In the embodiment of the present invention, the terminal traverses all situations where the collection task indicator moves forward and backward by at most N d time points, and records the cost reduction value with the largest cost reduction peak value in these situations and the collection time allocation result of the task.

[0150] S211 . Select the allocation result with the largest decrease in overhead peak value among all collection task adjustment results.

[0151] In the embodiment of the present invention, the terminal selects and records the maximum value of the decrease in the overhead peak value of all acquisition tasks and the corresponding allocation results.

[0152] S212: Is the maximum peak drop ≥ k?

[0153] In the embodiment of the present invention, the terminal determines whether the maximum overhead peak decrease value is greater than or equal to the optimization threshold k.

[0154] S213. Return the allocation result.

[0155] In the embodiment of the present invention, if the peak value drops to be greater than or equal to k, the allocation result is determined to be the target task allocation result.

[0156] S214, end.

[0157] In the embodiment of the present invention, if the peak value decreases by less than k, the process is terminated directly without any adjustment.

[0158] In some embodiments, Figure 1 The steps S102 to S103 shown may also be performed through S114 to S120 , which will be described in conjunction with each step.

[0159] S114. If the multiple current collection task indicators are existing collection task indicators after the collection task indicators are newly added, the current time granularity is determined by increasing the collection cycle, increasing the collection overhead, and the cycles and preset overhead ratios corresponding to the multiple collection task sets.

[0160] In an embodiment of the present invention, if multiple current collection task indicators are existing collection task indicators after a new collection task indicator is added to the multiple collection task indicators, the terminal determines the current time granularity by increasing the collection cycle, increasing the collection overhead, and the cycles and preset overhead ratios corresponding to the multiple collection task sets.

[0161] In an embodiment of the present invention, if multiple current collection task indicators include a newly added collection task indicator, increasing the collection task indicator corresponds to increasing the collection period and increasing the collection overhead. The terminal determines the latest time granularity and the common multiple period based on the increased collection period, increased collection overhead, the periods corresponding to the multiple collection task sets, and the preset overhead ratios. The common multiple period is the lowest common multiple of the periods corresponding to the multiple collection task sets.

[0162] In an embodiment of the present invention, the terminal allocates the increased collection task indicators to the collection task sets with matching periods. The terminal then divides the period of each collection task set by the number of corresponding collection task indicators to obtain a ratio. The terminal takes the non-1 minimum integer value in the corresponding ratio of each collection task set. The terminal divides the period of each collection task set by the non-1 minimum integer value. If it is divisible, the terminal determines the latest time granularity based on the non-1 minimum integer value. If it is not divisible, the non-1 minimum integer value is subtracted by 1, and the integer division operation is performed again until the period of each collection task set can be divided evenly, and finally an integer is obtained. The terminal uses the integer to determine the current time granularity.

[0163] Accordingly, the terminal determines the least common multiple of the period characterizing values of each collection task set, and then determines the common multiple period using the least common multiple.

[0164] S115 , using the current time granularity to perform time slot division in a common multiple period, and determining multiple feasible time points.

[0165] In the embodiment of the present invention, the terminal uses the current time granularity to perform time slot division in a common multiple period to determine multiple feasible time points.

[0166] For example, the common multiple period may be 60 seconds, and the latest time granularity may be 15 seconds. The terminal may then perform time slot division within the common multiple period of 60 seconds according to the latest time granularity of 10, obtaining multiple feasible moments including: moments corresponding to 0 seconds, 15 seconds, 30 seconds, 45 seconds, and 60 seconds, respectively.

[0167] S116: traverse multiple collection task sets in descending order of period, and traverse each collection task indicator in each collection task set in descending order of preset overhead proportion corresponding to each collection task indicator.

[0168] In the embodiment of the present invention, the terminal traverses multiple collection task sets in descending order of period, and traverses each collection task indicator in each collection task set in descending order of preset overhead proportion corresponding to each collection task indicator.

[0169] The predetermined collection task indicators include: multiple collection task indicators.

[0170] In the embodiment of the present invention, the terminal groups the multiple collection task indicators and the additional collection task indicators into multiple collection task sets, and the terminal traverses each collection task indicator in the multiple collection task sets according to the above rules.

[0171] S117 , adjusting each collection task indicator 2N times from the current moment in multiple feasible moments according to a preset integer N and the current time granularity, and determining 2N feasible adjustment moments corresponding to each collection task indicator after the 2N adjustments.

[0172] In an embodiment of the present invention, the terminal adjusts each collection task indicator 2N times from the current moment in multiple feasible moments according to a preset integer N and the latest time granularity, and determines 2N feasible adjustment moments corresponding to each collection task indicator after the 2N adjustments.

[0173] In an embodiment of the present invention, the terminal adjusts each acquisition task indicator at the current moment in the common multiple period by P time granularities toward the first time axis of the common multiple period to obtain the Pth feasible adjustment moment, until each acquisition task indicator is adjusted from the current moment to the first time axis of the common multiple period by N time granularities to obtain N feasible adjustment moments; P is an integer greater than or equal to 1 and less than N.

[0174] In an embodiment of the present invention, the terminal adjusts each acquisition task indicator at the current moment in the common multiple period by Q time granularities in the direction of the second time axis of the common multiple period to obtain the Qth feasible adjustment moment, until each acquisition task indicator is adjusted from the current moment to the first time axis of the common multiple period by N time granularities to obtain 2N feasible adjustment moments; Q is an integer greater than or equal to 1 and less than N.

[0175] In this embodiment of the present invention, N may be 1, the latest time granularity may be 15 seconds, and the current time may be 20 seconds. The terminal adjusts each collection task indicator by 15 seconds in the first time direction based on the current time of 20 seconds in the preset task allocation result to obtain a feasible adjustment time of 35 seconds, and then adjusts it by 15 seconds in the second time direction to obtain a feasible adjustment time of 5 seconds, thereby obtaining two feasible adjustment times: 5 seconds and 35 seconds.

[0176] S118 , de-overlapping and merging the 2N feasible adjustment moments with each collection moment to obtain multiple new collection moments corresponding to each adjustment, and obtaining collection task indicators corresponding to the multiple new collection moments after each adjustment.

[0177] In this embodiment of the present invention, the terminal removes overlaps and merges the 2N feasible adjustment times with each collection time, obtaining multiple new collection times corresponding to each adjustment, and obtains collection task indicators assigned to each of the multiple new collection times after each adjustment. Each collection time includes multiple collection indicators and is a pre-assigned collection time within a preset period.

[0178] For example, the 2N feasible adjustment moments may include: 0 seconds, 5 seconds, 15 seconds, and 20 seconds. The respective collection moments may include: 0 seconds, 10 seconds, 20 seconds, 30 seconds, 40 seconds, 50 seconds, and 60 seconds. The terminal removes overlaps and merges the N feasible adjustment times: 0 seconds, 5 seconds, 15 seconds, and 20 seconds with the collection times: 0 seconds, 10 seconds, 20 seconds, 30 seconds, 40 seconds, 50 seconds, and 60 seconds, respectively, to obtain multiple new collection times for the first adjustment: 0 seconds, 10 seconds, 20 seconds, 30 seconds, 40 seconds, 50 seconds, and 60 seconds; multiple new collection times for the second adjustment: 0 seconds, 5 seconds, 10 seconds, 20 seconds, 30 seconds, 40 seconds, 50 seconds, and 60 seconds; multiple new collection times for the third adjustment: 0 seconds, 10 seconds, 15 seconds, 20 seconds, 30 seconds, 40 seconds, 50 seconds, and 60 seconds; and multiple new collection times for the fourth adjustment: 0 seconds, 10 seconds, 20 seconds, 30 seconds, 40 seconds, 50 seconds, and 60 seconds.

[0179] S119. Determine multiple intermediate new collection moments from the multiple new collection moments according to the increased collection cycle, and add the increased collection overhead to the preset overhead proportions corresponding to the multiple intermediate new collection moments after each adjustment to obtain the sum of the multiple new overhead proportions.

[0180] In an embodiment of the present invention, multiple intermediate new collection moments are determined among multiple new collection moments according to the increased collection cycle, and the increased collection overhead is added to the preset overhead proportions corresponding to the multiple intermediate new collection moments after each adjustment to obtain the sum of the multiple new overhead proportions.

[0181] In this embodiment of the present invention, the preset task allocation result includes the collection task indicators assigned to each collection time. The terminal determines multiple intermediate new collection times from the multiple new collection times according to the increased collection cycle. The terminal then adds all the overhead proportions corresponding to the multiple intermediate new collection times after allocation to the increased collection overhead, to obtain the sum of the multiple new overhead proportions for each collection task indicator after each adjustment.

[0182] S120 , determining multiple allocation results by summing the multiple new overhead proportions and combining the collection task indicators corresponding to the multiple new collection moments after each adjustment, and determining the target task allocation result by the multiple allocation results.

[0183] In an embodiment of the present invention, the terminal determines multiple allocation results by summing multiple new overhead proportions and combining the collection task indicators corresponding to the multiple new collection moments after each adjustment, so as to determine the target task allocation result through the multiple allocation results.

[0184] In an embodiment of the present invention, since this scheme can achieve the optimal allocation of collection task indicators while minimizing the impact on existing collection task indicators when the collection task indicators increase, it can ensure the optimal allocation of collection task indicators in a low-overhead and low-impact manner, thereby improving the accuracy of host data collection in the scenario of changing collection tasks.

[0185] In some embodiments, the illustrated S114 may also be implemented through S121 to S124 , which will be described in conjunction with each step.

[0186] S121. Calculate the ratio of the period corresponding to each collection task set to the number of collection task indicators in each collection task set, and determine the maximum integer between the ratio and a predetermined value.

[0187] In the embodiment of the present invention, the terminal calculates the ratio of the period corresponding to each new collection task set to the number of collection task indicators in each new collection task set, and determines the maximum integer between the ratio and a predetermined value.

[0188] In an embodiment of the present invention, if the terminal detects that the increased collection period matches the period corresponding to the increased collection task set, the terminal allocates the increased collection task indicator to the increased collection task set to obtain multiple collection task sets, wherein the increased collection task set belongs to the multiple collection task sets.

[0189] In the embodiment of the present invention, if the terminal detects that the added collection period does not match the periods corresponding to the multiple collection task sets, a new collection task set is constructed using the added collection task indicator to obtain multiple collection task sets.

[0190] For example, a collection task set has a period of 10 seconds. The collection task set includes three collection task indicators. The terminal divides 10 by 3 to obtain 3.3. The terminal determines the largest integer between 3.3 and 1, which is 3.

[0191] In an embodiment of the present invention, the predetermined value may be 1, and in other embodiments, the predetermined value may be other integers.

[0192] S122. Determine the smallest intermediate integer among the maximum integers corresponding to the multiple collection task sets.

[0193] In the embodiment of the present invention, the terminal determines the smallest intermediate integer among the maximum integers corresponding to the multiple collection task sets.

[0194] S123. Draw the periods corresponding to the multiple collection task sets by the middle integer to obtain a calculation result.

[0195] In the embodiment of the present invention, the terminal divides the periods corresponding to the plurality of collection task sets by an intermediate integer to obtain a calculation result.

[0196] S124: Determine the latest time granularity based on the calculation result.

[0197] In an embodiment of the present invention, if the calculation result indicates that the periods corresponding to the plurality of acquisition task sets are all divisible by an intermediate integer, the current time granularity is determined by the intermediate integer.

[0198] If the calculation result indicates that the period corresponding to any collection task set cannot be divided by the intermediate integer, then subtract a predetermined value from the intermediate integer to obtain a first intermediate integer, and then divide the periods corresponding to multiple collection task sets by the first intermediate integer, until the periods corresponding to multiple collection task sets are all divisible by the Tth intermediate integer, then the current time granularity is determined by the Tth intermediate integer; T is an integer greater than 1.

[0199] If the intermediate integer is equal to a predetermined value, the current time granularity is determined by the intermediate integer.

[0200] In the embodiment of the present invention, the terminal calculates the least common multiple of the periods corresponding to the plurality of collection task sets, and determines the common multiple period through the least common multiple.

[0201] For example, the periods corresponding to the multiple collection task sets may be 10 seconds, 20 seconds, and 30 seconds, respectively. The terminal finds that the least common multiple of 10, 20, and 30 is 60. The terminal can then determine that the least common multiple period is 60 seconds.

[0202] In an embodiment of the present invention, the terminal adaptively allocates the optimal collection time granularity (that is, the latest time granularity) according to the overhead characteristics of the collection task indicators, thereby reducing the collector's task maintenance overhead and algorithm complexity while ensuring the collection task allocation effect, thereby effectively improving the accuracy of data collection.

[0203] In some embodiments, the illustrated S120 may be implemented through S125 to S128 , which will be described in conjunction with each step.

[0204] S125 . Determine the maximum sum of new overhead proportions from the sums of the multiple new overhead proportions, and determine the maximum intermediate new collection time corresponding to the maximum sum of the new overhead proportions.

[0205] In the embodiment of the present invention, the terminal determines the maximum sum of new overhead proportions from the sums of multiple new overhead proportions, and determines the maximum intermediate new acquisition time corresponding to the maximum sum of new overhead proportions.

[0206] S126. Allocate the increased collection task indicator to the maximum intermediate new collection moment, and then combine the collection task indicators corresponding to the multiple new collection moments after each adjustment to determine the intermediate allocation result after each adjustment, thereby obtaining 2N intermediate allocation results corresponding to each collection task indicator.

[0207] In an embodiment of the present invention, the terminal allocates an increased collection task indicator to the maximum intermediate new collection moment, and then combines the collection task indicators corresponding to multiple new collection moments after each adjustment to determine the intermediate allocation result after each adjustment, thereby obtaining 2N intermediate allocation results corresponding to each collection task indicator.

[0208] S127. Establish a corresponding relationship between the intermediate allocation result and the sum of the maximum new expenditure proportion.

[0209] In the embodiment of the present invention, the terminal establishes a corresponding relationship between the intermediate allocation result and the sum of the maximum new overhead proportion.

[0210] S128. Determine the minimum sum of the maximum new expenditure ratios from the sums of the multiple maximum new expenditure ratios, and determine the intermediate allocation result corresponding to the minimum sum of the maximum new expenditure ratios as the allocation result after each adjustment, to obtain multiple allocation results.

[0211] In an embodiment of the present invention, the terminal determines the minimum sum of maximum new overhead proportions from the sum of multiple maximum new overhead proportions to determine that the intermediate allocation result corresponding to the minimum sum of maximum new overhead proportions is the allocation result after each adjustment to obtain multiple allocation results.

[0212] In an embodiment of the present invention, the terminal determines the minimum sum of the maximum new overhead ratios from the sum of multiple maximum new overhead ratios, and determines that the intermediate allocation result corresponding to the minimum sum of the maximum new overhead ratios is the allocation result after each adjustment of each collection task indicator, thereby realizing task allocation under the premise of ensuring the minimum overhead, thereby avoiding the occurrence of terminal crashes when collecting data and improving data collection accuracy.

[0213] In an embodiment of the present invention, the terminal determines the minimum sum of the first new overhead proportions from the sum of the maximum new overhead proportions corresponding to each allocation result, and determines the target allocation result corresponding to the minimum sum of the first new overhead proportions as the target task allocation result.

[0214] In some embodiments, see Figure 5 , Figure 5 This is an optional flow chart of the data collection method provided by an embodiment of the present invention. S114-S128 shown can be implemented through S215 to S220, which will be described in conjunction with each step.

[0215] S215: Obtain the current collection task allocation result and increase the collection cycle and increase the collection cost of the collection task indicator.

[0216] S216. New collection tasks are assigned to or created for a collection set. The latest common multiple period and the latest time granularity are calculated, and the collection tasks are expanded based on the results.

[0217] In an embodiment of the present invention, the terminal analyzes the increased collection period of the newly added collection task indicator. If there is an increased collection period in the existing collection task set period, the collection task indicator is assigned to the corresponding set; otherwise, a new collection task set is created, and the m and d values are updated. If the m or d values change, the collection time extension vectors of all existing tasks are updated.

[0218] S217. Generate the result of each acquisition task change according to the task impact factor N, and form a set of all the results.

[0219] In an embodiment of the present invention, the terminal traverses each collection task indicator according to a given task impact factor N, adjusts each collection task indicator before and after N d moments, generates a corresponding task allocation plan for each adjustment, and forms an adjusted collection task plan set with the adjustment results of all collection tasks.

[0220] S218: Check whether the traversal is completed.

[0221] In the embodiment of the present invention, the terminal determines whether all collection task indicators have been traversed and completed.

[0222] S219: According to the current task allocation plan, the new collection task traverses all feasible moments and records the allocation result of the new task collection moment with the smallest overhead peak.

[0223] In the embodiment of the present invention, the terminal traverses all feasible times in the acquisition scheme according to the acquisition time extension vector of the new task, and records the new task time allocation result with the minimum overhead peak.

[0224] S220 , selecting the task change result and allocation result with the smallest acquisition overhead peak as the target task allocation result and returning the result.

[0225] In the embodiment of the present invention, the terminal selects the task change result and allocation scheme with the smallest acquisition overhead peak as the target task allocation result and returns it.

[0226] When collection tasks change, the terminal needs to adjust collection allocation appropriately to achieve optimal allocation. Decreasing and increasing collection task metrics have different impacts on collection allocation. When collection task metrics decrease, the current collection allocation plan needs to be adjusted to minimize peak overhead. When collection task metrics increase, collection times for new tasks need to be allocated to meet overhead constraints while minimizing the impact on current tasks. Therefore, different solutions are needed to handle scenarios where collection tasks decrease or increase.

[0227] In some embodiments, Figure 1 The steps before S101 shown in the figure also include S129 to S132, which will be described in conjunction with each step.

[0228] S129 . Group the multiple acquisition task indicators according to the periods corresponding to the acquired multiple acquisition task indicators to obtain multiple initial acquisition task sets.

[0229] In the embodiment of the present invention, the terminal groups the multiple acquisition task indicators according to the periods corresponding to the acquired multiple acquisition task indicators to obtain multiple initial acquisition task sets.

[0230] S130: Calculate a preset time granularity and a preset period using the periods corresponding to the multiple initial acquisition task sets.

[0231] In the embodiment of the present invention, the terminal calculates the preset time granularity and the preset period by using the periods respectively corresponding to the multiple initial collection task sets.

[0232] S131 , using a preset time granularity to perform time slot division in a preset period to determine each collection moment.

[0233] In the embodiment of the present invention, the terminal uses a preset time granularity to perform time slot division in a preset period to determine each collection moment.

[0234] S132. Traverse each collection task indicator in the multiple initial collection task sets in a predetermined order, and allocate each collection task indicator to a corresponding moment in each initial collection moment in combination with the period corresponding to each collection task indicator and the preset overhead ratio to obtain a preset task allocation result.

[0235] In an embodiment of the present invention, the terminal traverses each collection task indicator in multiple initial collection task sets in a predetermined order, and allocates each collection task indicator to the corresponding moment in each collection moment in combination with the period corresponding to each collection task indicator and the preset overhead ratio to obtain the preset task allocation result.

[0236] The terminal selects the best preset time granularity based on the initial collection task set. The preset time granularity is the maximum basic time slice that can meet the periodic requirements of all collection task indicators, thereby reducing the management overhead of the collector while ensuring the effect of subsequent task management.

[0237] In some embodiments, the illustrated S130 may also be implemented through S133 to S137 , which will be described in conjunction with each step.

[0238] S133. Calculate the ratio of the period corresponding to each initial collection task set to the first number of the collection task index in each initial collection task set, and determine a first maximum integer between the ratio of the first number and a predetermined value.

[0239] In the embodiment of the present invention, the terminal calculates the ratio of the period corresponding to each initial collection task set to the first number of the collection task index in each initial collection task set, and determines the first maximum integer between the ratio of the first number and the predetermined value.

[0240] S134. Determine the smallest secondary middle integer among the first maximum integers corresponding to the multiple initial acquisition task sets.

[0241] In the embodiment of the present invention, the terminal determines the smallest second-middle integer from the first largest integers corresponding to the multiple initial collection task sets.

[0242] S135. Compare the periods corresponding to the multiple initial acquisition task sets with the previous intermediate integer to obtain a first calculation result.

[0243] In the embodiment of the present invention, the terminal compares the periods corresponding to the multiple collection task sets with the previous intermediate integer to obtain a first calculation result.

[0244] S136: Determine a preset time granularity based on the first calculation result.

[0245] In the embodiment of the present invention, the terminal determines a preset time granularity based on the first calculation result.

[0246] If the first calculation result indicates that the periods corresponding to the multiple initial acquisition task sets are all divisible by the next middle integer, the preset time granularity is determined by the next middle integer.

[0247] If the first calculation result indicates that the period corresponding to any initial acquisition task set cannot be divided by the second intermediate integer, then the second intermediate integer is subtracted by a predetermined value to obtain a first intermediate integer, and then the periods corresponding to the multiple initial acquisition task sets are divided by the first intermediate integer, until the periods corresponding to the multiple initial acquisition task sets are all divisible by the Lth intermediate integer, and the preset time granularity is determined by the Lth intermediate integer; L is an integer greater than 1.

[0248] If the first calculation result indicates that the second middle integer is equal to a predetermined value, the preset time granularity is determined according to the second middle integer.

[0249] S137 . Calculate the least common multiple of the periods corresponding to the multiple collection task sets, and determine the preset period through the least common multiple.

[0250] In the embodiment of the present invention, the terminal calculates the least common multiple of the periods corresponding to the plurality of collection task sets, and determines the preset period through the least common multiple.

[0251] In some embodiments, see Figure 6 , Figure 6 This is an optional flow chart of the data collection method provided by an embodiment of the present invention. S133-S137 shown can be implemented through S221 to S227, which will be explained in conjunction with each step.

[0252] S221: Collect the period of all acquisition task indicators.

[0253] S222: Group the collection task indicators with the same period into a set Oi.

[0254] In the embodiment of the present invention, the terminal analyzes the periods of all collection task indicators and divides the collection task indicators into different sets according to different periods. The collection tasks in each set have the same collection period Ti, and the set is defined as Oi.

[0255] S223 , calculating the task interval ti = max([Ti / |Oi|], 1) of each initial acquisition task set.

[0256] In an embodiment of the present invention, the terminal calculates the task interval of each set (the feasible task execution interval when executing all acquisition tasks in the set) for each initial collection task set. The task interval is defined as ti = max([Ti / |Oi|], 1), that is, the maximum value between the maximum integer of the period divided by the number of tasks and 1, and the task interval is required to be at least 1.

[0257] S224. Select the minimum value d=min(ti) of all ti.

[0258] The minimum value d in ti is selected as the initial time granularity standard.

[0259] S225: Are all periods divisible by d or d == 1?

[0260] If it is not divisible, execute S226; if it is divisible, execute S227.

[0261] S226, d=d-1.

[0262] S227: Return d as the preset time granularity.

[0263] In some embodiments, the illustrated S132 may be implemented through S138 to S141 , which will be described in conjunction with each step.

[0264] S138 , traversing to the Rth collection task set among the multiple initial collection task sets in descending order of period.

[0265] In the embodiment of the present invention, the terminal traverses to the Rth collection task set among the multiple initial collection task sets in descending order of period, where R is an integer greater than or equal to 1.

[0266] S139. Determine, from each collection moment, X collection extension vector moments that match the period of the Rth initial collection task set.

[0267] In the embodiment of the present invention, the terminal determines, at each collection moment, X collection extension vector moments that match the period of the Rth initial collection task set. X is an integer greater than or equal to 2;

[0268] S140. Allocate the X collection task indicators in the Rth initial collection task set to the X collection extension vector moments in descending order of the preset overhead ratio. Then, allocate the remaining collection task indicators to the collection extension vector moments with the smallest sum of the current overhead ratios, until all the collection task indicators in the Rth initial collection task set are allocated, thereby obtaining the Rth task allocation result.

[0269] In an embodiment of the present invention, the terminal sequentially allocates X collection task indicators in the Rth initial collection task set to X collection extension vector moments in descending order of preset overhead ratios, and then sequentially allocates the remaining collection task indicators to the collection extension vector moments with the smallest sum of the current overhead ratios, until all the collection task indicators in the Rth initial collection task set are allocated, thereby obtaining the Rth task allocation result.

[0270] S141. Based on the Rth task allocation result, the collection task indicators in the R+1th initial collection task set are allocated, until the collection task indicators in multiple initial collection task sets are allocated, and a preset task allocation result is obtained.

[0271] In an embodiment of the present invention, the terminal allocates the collection task indicators in the R+1th initial collection task set based on the Rth task allocation result, until the collection task indicators in multiple initial collection task sets are allocated, and the preset task allocation result is obtained.

[0272] In some embodiments, see Figure 7 , Figure 7 This is an optional flow chart of the data collection method provided by an embodiment of the present invention. S139 to S141 shown can be implemented through S228 to S235, which will be explained in conjunction with each step.

[0273] S228. Collect the preset overhead ratios of all collection task indicators.

[0274] In the embodiment of the present invention, the terminal collects the preset overhead ratios of all current acquisition task indicators, which may include different dimensions such as CPU, memory, IO, etc. according to different requirements.

[0275] S229: Calculate the least common multiple m of all collection task set periods Ti.

[0276] In the embodiment of the present invention, the terminal calculates the least common multiple m of all Ti values according to the analyzed collection task set period Ti.

[0277] S230 , periodically expand each collection task based on m with a granularity of d.

[0278] In an embodiment of the present invention, the terminal divides each acquisition task into time slots according to the minimum time granularity d and extends the period according to m. For example, if the period of an acquisition task is 10s, the minimum time granularity is d = 2s, and the lowest common multiple m = 20s, then the period extension result of the task is x = [5d, 10d]. In the subsequent task allocation process, the x vector is used as the allocation unit of the acquisition task.

[0279] S231 , arranging the tasks in each collection task set Oi in descending order according to a preset overhead ratio.

[0280] In the embodiment of the present invention, for each collection task set Oi, the terminal sorts all collection task indicators in descending order according to the size of the preset overhead proportion.

[0281] S232. Traverse all collection task sets Oi in descending order of Ti.

[0282] In the embodiment of the present invention, the terminal pole traverses all collection task sets Oi according to the descending order of all collection set periods Ti.

[0283] S233: Check whether the Oi traversal is completed.

[0284] In the embodiment of the present invention, if the traversal of Oi is completed, S236 is executed; if the traversal of Oi is not completed, S234 is executed.

[0285] S234: Check whether the sequential traversal of the collection task indicators is completed.

[0286] In the embodiment of the present invention, if the traversal of the collection task indicators is completed, S233 is executed; if the traversal of the collection task indicators is not completed, S235 is executed.

[0287] S235 , traverse all feasible moments of the extended period collection task, and select the moment with the smallest overhead peak as the collection time allocation for the task.

[0288] In the embodiment of the present invention, the terminal traverses all feasible collection moments according to the time axis divided by m and d and the collection moment extension vector of the collection task indicator, and selects the result with the smallest time overhead peak as the collection moment allocation for the task.

[0289] S236. Return the current collection task allocation as the optimal allocation.

[0290] The allocation results of all current collection tasks are taken as the optimal allocation results and returned.

[0291] Based on the collection overhead constraints, the terminal reasonably allocates the collection task indicators to different collection times to reduce the "tidal" situation of the collection overhead as much as possible while meeting the collection overhead. In the process of collection task allocation, the optimal time granularity is used as the basis for optimal task allocation for all tasks.

[0292] In some embodiments, see Figure 8 , Figure 8 A schematic structural diagram of a data acquisition device provided in an embodiment of the present invention.

[0293] The embodiment of the present invention further provides a data acquisition device 800 , comprising: a data acquisition unit 803 , a determination unit 804 , a traversal adjustment unit 805 and a collection unit 806 .

[0294] The data acquisition unit 803 is configured to acquire a plurality of current collection task indicators, wherein the plurality of current collection task indicators belong to a plurality of collection task sets; each collection task set includes at least one collection task indicator of the same period; the plurality of current collection task indicators are existing collection task indicators after a collection task indicator is added or reduced to the plurality of collection task indicators;

[0295] A determining unit 804 is configured to determine a current time granularity based on the multiple current acquisition task indicators;

[0296] A traversal adjustment unit 805 is configured to traverse the predetermined collection task indicators in the plurality of collection task sets in a predetermined order, and adjust the predetermined collection task indicators from a current moment based on the current time granularity to obtain a target task allocation result; the predetermined collection task indicators belong to the plurality of current collection task indicators; and the current moment is a collection moment pre-assigned to each collection task indicator.

[0297] The collecting unit 806 is configured to collect target data using the target task allocation result, and display the target data in a display interface or process the target data.

[0298] In the embodiment of the present invention, the determining unit 803 in the data collection device 800 is configured to determine the preset time granularity as the current time granularity if the multiple current collection task indicators are existing collection indicators after the multiple collection task indicators are reduced by the collection task indicators.

[0299] In an embodiment of the present invention, the traversal adjustment unit 805 in the data acquisition device 800 is used to traverse the multiple acquisition task sets in descending order of the cycles, and traverse each current acquisition task indicator in each acquisition task set in descending order of the preset overhead ratio corresponding to each current acquisition task indicator; the predetermined acquisition task indicators include: the multiple current acquisition task indicators; adjusting each current acquisition task indicator 2N times at each acquisition moment from the current moment according to the preset integer N and the preset time granularity, determining 2N adjustment moments corresponding to each current acquisition task indicator after the 2N adjustments, and the acquisition task indicators corresponding to each acquisition moment after the 2N adjustments; N is an integer greater than or equal to 1; The various collection moments include the collection moments to which the multiple current collection task indicators are pre-assigned within a preset period; the adjustment overhead change values corresponding to the 2N adjustment moments are calculated; the adjustment overhead change value is the difference between the sum of the corresponding preset overhead proportions after the corresponding adjustment moment is adjusted and the sum of the corresponding preset overhead proportions before the adjustment; the corresponding adjustment times are determined based on the maximum adjustment overhead change value, and multiple allocation results are obtained through the collection task indicators corresponding to the various collection moments after the adjustment of the corresponding adjustment times, so as to determine the target task allocation result through the multiple allocation results; the allocation result is the result of the multiple current collection task indicators being allocated to the corresponding moments after each current collection task indicator is adjusted for the corresponding adjustment times.

[0300] In an embodiment of the present invention, the determining unit 803 in the data acquisition device 800 is configured to calculate the current time granularity by increasing the acquisition period, increasing the acquisition overhead, and the periods and preset overhead ratios corresponding to the multiple acquisition task sets, respectively, if the multiple current acquisition task indicators are existing acquisition task indicators after an additional acquisition task indicator is added to the multiple acquisition task indicators; the increased acquisition task indicator corresponds to an increased acquisition period and an increased acquisition overhead;

[0301] In an embodiment of the present invention, the determination unit 803 in the data acquisition device 800 is used to use the current time granularity to perform time slot division in a common multiple period to determine multiple feasible moments; the common multiple period is the least common multiple period of the periods corresponding to the multiple acquisition task sets.

[0302] In an embodiment of the present invention, the traversal adjustment unit 805 in the data acquisition device 800 is used to traverse the multiple acquisition task sets in descending order of the cycles, and traverse each acquisition task indicator in each acquisition task set in descending order of the preset overhead ratio corresponding to each acquisition task indicator; the predetermined acquisition task indicators include: the multiple acquisition task indicators; adjusting each acquisition task indicator 2N times from the current moment in the multiple feasible moments according to the preset integer N and the current time granularity, and determining 2N feasible adjustment moments corresponding to each acquisition task indicator after the 2N adjustments; de-duplicating and merging the 2N feasible adjustment moments with each acquisition moment to obtain the corresponding time. Adjust multiple new collection moments, and obtain the collection task indicators corresponding to the multiple new collection moments after each adjustment; each collection moment includes the multiple collection indicators, which are pre-assigned collection moments within a preset period; according to the increased collection period, multiple intermediate new collection moments are determined, and the increased collection overhead is added to the preset overhead proportions corresponding to the multiple intermediate new collection moments after each adjustment to obtain the sum of multiple new overhead proportions; through the sum of the multiple new overhead proportions, combined with the collection task indicators corresponding to the multiple new collection moments after each adjustment, multiple allocation results are determined, so as to determine the target task allocation result through the multiple allocation results.

[0303] In an embodiment of the present invention, the traversal adjustment unit 805 in the data acquisition device 800 is configured to adjust each current acquisition task indicator from the current moment by M time granularities in the direction of the first time axis to obtain the Mth adjusted moment, and obtain the acquisition task indicators respectively assigned to each acquisition moment after the Mth adjustment, until each current acquisition task indicator is adjusted from the current moment by N time granularities in the direction of the first time axis to obtain N adjusted moments, and obtain the acquisition task indicators respectively assigned to each acquisition moment after the Nth adjustment in the direction of the first time axis; M is an integer greater than or equal to 1 and less than N; each current collection task indicator is adjusted from the current moment to the second time axis direction by K time granularities to obtain the Kth adjustment moment, and the collection task indicators corresponding to each collection moment after the Kth adjustment are obtained, until each current collection task indicator is adjusted from the current moment to the second time axis direction by N time granularities to obtain the 2N adjustment moments, and the collection task indicators corresponding to each collection moment after the Nth adjustment in the second time axis direction are obtained; K is an integer greater than or equal to 1 and less than N.

[0304] In an embodiment of the present invention, the traversal adjustment unit 805 in the data acquisition device 800 is used to determine the maximum adjustment moment corresponding to the maximum adjustment overhead change value among the 2N adjustment moments; determine the first adjustment number corresponding to the maximum adjustment moment, and determine the allocation result corresponding to the first adjustment number through the acquisition task indicators corresponding to each acquisition moment after the first adjustment number is adjusted, so as to obtain the multiple allocation results; the corresponding adjustment number includes: the first adjustment number.

[0305] In an embodiment of the present invention, the determination unit 804 in the data acquisition device 800 is used to calculate the ratio of the period corresponding to each acquisition task set to the number of acquisition task indicators in each acquisition task set, and determine the maximum integer between the ratio and a predetermined value; determine the minimum intermediate integer among the maximum integers corresponding to the multiple acquisition task sets; divide the periods corresponding to the multiple acquisition task sets by the intermediate integer to obtain a calculation result; and determine the current time granularity based on the calculation result.

[0306] Among them, if the calculation result indicates that the periods corresponding to the multiple acquisition task sets are all divisible by the intermediate integer, the current time granularity is determined by the intermediate integer; if the calculation result indicates that the period corresponding to any acquisition task set is not divisible by the intermediate integer, the intermediate integer is subtracted from the predetermined value to obtain a first intermediate integer, and then the periods corresponding to the multiple acquisition task sets are divided by the first intermediate integer, until the periods corresponding to the multiple acquisition task sets are all divisible by the Tth intermediate integer, and the current time granularity is determined by the Tth intermediate integer; T is an integer greater than 1; if the intermediate integer is equal to the predetermined value, the current time granularity is determined by the intermediate integer.

[0307] In an embodiment of the present invention, the traversal adjustment unit 805 in the data acquisition device 800 is used to adjust each acquisition task indicator at the current moment in the common multiple period toward the first time axis direction of the common multiple period by P time granularities to obtain the Pth feasible adjustment moment, until each acquisition task indicator is adjusted from the current moment to the first time axis direction of the common multiple period by N time granularities to obtain N feasible adjustment moments; P is an integer greater than or equal to 1 and less than N; adjust each acquisition task indicator at the current moment in the common multiple period toward the second time axis direction of the common multiple period by Q time granularities to obtain the Qth feasible adjustment moment, until each acquisition task indicator is adjusted from the current moment to the first time axis direction of the common multiple period by N time granularities to obtain the 2N feasible adjustment moments; Q is an integer greater than or equal to 1 and less than N.

[0308] In an embodiment of the present invention, the traversal adjustment unit 805 in the data acquisition device 800 is used to determine the maximum sum of the new overhead proportions in the sum of the multiple new overhead proportions, and determine the maximum intermediate new acquisition moment corresponding to the maximum sum of the new overhead proportions; assign the increased acquisition task indicator to the maximum intermediate new acquisition moment, and then combine the acquisition task indicators corresponding to the multiple new acquisition moments after each adjustment to determine the intermediate allocation result after each adjustment, and then obtain 2N intermediate allocation results corresponding to each acquisition task indicator; establish a corresponding relationship between the intermediate allocation result and the sum of the maximum new overhead proportions; determine the minimum sum of the maximum new overhead proportions in the multiple sums of the maximum new overhead proportions, so as to determine that the intermediate allocation result corresponding to the minimum sum of the maximum new overhead proportions is the allocation result after each adjustment, so as to obtain the multiple allocation results.

[0309] In an embodiment of the present invention, the traversal adjustment unit 805 in the data acquisition device 800 is used to determine a first maximum adjustment cost change value among the adjustment cost change values corresponding to each of the allocation results; if the first maximum adjustment cost change value is greater than a preset optimization threshold, the target allocation result corresponding to the first maximum adjustment cost change value is determined to be the target task allocation result.

[0310] In an embodiment of the present invention, the traversal adjustment unit 805 in the data acquisition device 800 is used to determine the minimum sum of the first new overhead ratios in the sum of the maximum new overhead ratios corresponding to each of the allocation results, and determine the target allocation result corresponding to the minimum sum of the first new overhead ratios as the target task allocation result. In an embodiment of the present invention, the traversal adjustment unit 805 in the data acquisition device 800 is used to group the multiple acquisition task indicators according to the periods corresponding to the multiple acquired acquisition task indicators to obtain the multiple initial acquisition task sets; calculate the preset time granularity and the preset period using the periods corresponding to the multiple initial acquisition task sets; perform time slot division in the preset period using the preset time granularity to determine each acquisition moment; traverse each acquisition task indicator in the multiple initial acquisition task sets in a predetermined order, and allocate each acquisition task indicator to the corresponding moment in the various acquisition moments in combination with the period and preset overhead ratio corresponding to each acquisition task indicator to obtain the preset task allocation result.

[0311] In an embodiment of the present invention, the traversal adjustment unit 805 in the data acquisition device 800 is used to calculate the ratio of the period corresponding to each initial acquisition task set to the first number of the acquisition task indicator in each initial acquisition task set, and determine the first maximum integer between the ratio of the first number and the predetermined value; determine the smallest secondary intermediate integer among the first maximum integers corresponding to the multiple initial acquisition task sets; compare the periods corresponding to the multiple initial acquisition task sets with the secondary intermediate integer to obtain a first calculation result; determine the preset time granularity based on the first calculation result; calculate the least common multiple of the periods corresponding to the multiple initial acquisition task sets, and determine the preset period through the least common multiple.

[0312] Among them, if the first calculation result indicates that the periods corresponding to the multiple initial acquisition task sets are all divisible by the second intermediate integer, the preset time granularity is determined by the second intermediate integer; if the first calculation result indicates that the period corresponding to any initial acquisition task set is not divisible by the second intermediate integer, the second intermediate integer is subtracted from the predetermined value to obtain the first intermediate integer, and then the periods corresponding to the multiple initial acquisition task sets are divided by the first intermediate integer, until the periods corresponding to the multiple initial acquisition task sets are all divisible by the Lth intermediate integer, and the preset time granularity is determined by the Lth intermediate integer; L is an integer greater than 1; if the first calculation result indicates that the second intermediate integer is equal to the predetermined value, the preset time granularity is determined by the second intermediate integer.

[0313] In an embodiment of the present invention, the traversal adjustment unit 805 in the data acquisition device 800 is configured to traverse to the Rth initial acquisition task set among the multiple initial acquisition task sets in descending order of the period; R is an integer greater than or equal to 1; determine, in each of the acquisition moments, X acquisition extension vector moments that match the period of the Rth initial acquisition task set; X is an integer greater than or equal to 2; allocate the X acquisition task indicators in the Rth initial acquisition task set to the X acquisition extension vector moments in descending order of the preset overhead ratio, and then allocate the remaining acquisition task indicators to the acquisition extension vector moments with the smallest sum of the current overhead ratios, until all the acquisition task indicators in the Rth initial acquisition task set are allocated, thereby obtaining an Rth task allocation result; based on the Rth task allocation result, allocate the acquisition task indicators in the R+1th initial acquisition task set, until all the acquisition task indicators in the multiple initial acquisition task sets are allocated, thereby obtaining the preset task allocation result.

[0314] In an embodiment of the present invention, a data acquisition unit 803 acquires multiple current collection task indicators, wherein the multiple current collection task indicators belong to multiple collection task sets; each collection task set includes at least one collection task indicator of the same period; the multiple current collection task indicators are existing collection task indicators after a collection task indicator is added or reduced to the multiple collection task indicators; a determination unit 804 determines a current time granularity based on the multiple current collection task indicators; a traversal adjustment unit 805 traverses the predetermined collection task indicators in the multiple collection task sets in a predetermined order, and adjusts the predetermined collection task indicators from the current time granularity based on the current time granularity to obtain a target task allocation result; the current time is the pre-assigned collection time for each collection task indicator; and a collection unit 806 uses the target task allocation result to collect target data, which is displayed in a display interface or processed specifically for the target data. Because this solution can achieve optimal collection task indicator allocation based on task changes while minimizing the impact on existing collection task indicators, it ensures optimal collection task indicator allocation in a low-overhead and low-impact manner, thereby improving the accuracy of host data collection when adding or reducing collection task indicators.

[0315] It should be noted that, in the embodiment of the present invention, if the above-mentioned data acquisition method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a data acquisition device (which can be a personal computer, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiment of the present invention is not limited to any specific combination of hardware and software.

[0316] Correspondingly, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which implements the steps in the above method when executed by a processor.

[0317] Correspondingly, an embodiment of the present invention provides a data acquisition device 900, including a memory 902 and a processor 901, wherein the memory 902 stores a computer program that can be run on the processor 901, and the processor 901 implements the steps in the above method when executing the program.

[0318] It should be noted that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of the present invention, please refer to the description of the method embodiments of the present invention for understanding.

[0319] It should be noted that Figure 9 A hardware entity diagram of a data acquisition device provided by an embodiment of the present invention, such as Figure 9 As shown, the hardware entity of the data acquisition device 900 includes: a processor 901 and a memory 902, wherein;

[0320] The processor 901 generally controls the overall operation of the data acquisition device 900 .

[0321] The memory 902 is configured to store instructions and applications executable by the processor 901, and can also cache data to be processed or processed by the processor 901 and each module in the data acquisition device 900 (for example, image data, audio data, voice communication data and video communication data), which can be implemented through flash memory (FLASH) or random access memory (Random Access Memory, RAM).

[0322] The above description is merely an embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A data collection method, characterized in that: include: Acquire multiple current collection task indicators, wherein the multiple current collection task indicators belong to multiple collection task sets; each collection task set includes at least one current collection task indicator of the same period; the multiple current collection task indicators are existing collection task indicators after the multiple collection task indicators are newly added or reduced; the collection task indicators include scripts or instruction information for collecting indicator information of the terminal's hardware or software; If the multiple current collection task indicators are existing collection indicators after the multiple collection task indicators are reduced by the collection task indicators, the preset time granularity is determined to be the current time granularity; or if the multiple current collection task indicators are existing collection indicators after the multiple collection task indicators are increased by the collection task indicators, the current time granularity is calculated by increasing the collection cycle, increasing the collection overhead, and the periods and preset overhead ratios corresponding to the multiple collection task sets respectively; Traversing the predetermined collection task indicators in the plurality of collection task sets in a predetermined order, adjusting the predetermined collection task indicators from the current moment based on the current time granularity to obtain a target task allocation result; the predetermined collection task indicator belongs to the plurality of current collection task indicators; the current moment is a collection moment pre-assigned by the predetermined collection task indicator; Target data is collected using the target task allocation result and displayed in a display interface or processed with respect to the target data.

2. The data collection method according to claim 1, characterized in that: If the multiple current collection task indicators are existing collection indicators after the multiple collection task indicators are reduced by the collection task indicators, determining the preset time granularity as the current time granularity; The step of traversing the predetermined collection task indicators in the plurality of collection task sets in a predetermined order and adjusting the predetermined collection task indicators from the current moment based on the current time granularity to obtain a target task allocation result includes: Traversing the multiple collection task sets in descending order of the periods, and traversing each current collection task indicator in each collection task set in descending order of the preset overhead ratio corresponding to each current collection task indicator; the predetermined collection task indicator includes: the multiple current collection task indicators; Adjusting each current collection task indicator 2N times at each collection moment according to a preset integer N and the preset time granularity from the current moment, and determining 2N adjustment moments corresponding to each current collection task indicator after the 2N adjustments, and collection task indicators corresponding to each collection moment after the 2N adjustments; N is an integer greater than or equal to 1; each collection moment includes the collection moments pre-assigned to the multiple current collection task indicators within a preset period; Calculating the adjusted cost change values corresponding to the 2N adjustment moments, respectively; the adjusted cost change value is the difference between the sum of the preset cost proportions corresponding to the corresponding adjustment moment after adjustment and the sum of the preset cost proportions corresponding to the adjustment moment before adjustment; Based on the maximum adjustment overhead change value, the corresponding adjustment times are determined, and the collection task indicators corresponding to each collection moment after the adjustment of the corresponding adjustment times are respectively obtained to obtain multiple allocation results, so as to determine the target task allocation result through the multiple allocation results; the allocation result is the result of the multiple current collection task indicators being allocated to the corresponding moment after each current collection task indicator is adjusted for the corresponding adjustment times.

3. The data collection method according to claim 1, wherein: If the multiple current collection task indicators are existing collection indicators after the collection task indicators are added, the current time granularity is calculated by increasing the collection period, increasing the collection overhead, the periods corresponding to the multiple collection task sets, and the preset overhead ratios; Increasing the acquisition task index corresponds to increasing the acquisition cycle and increasing the acquisition overhead; Before traversing the predetermined collection task indicators in the plurality of collection task sets in a predetermined order and adjusting the predetermined collection task indicators from the current moment based on the current time granularity to obtain the target task allocation result, the method further includes: Using the current time granularity to perform time slot division in a common multiple period, a plurality of feasible moments are determined; The common multiple period is the least common multiple period of the periods corresponding to the multiple acquisition task sets.

4. The data collection method according to claim 3, characterized in that: The step of traversing the predetermined collection task indicators in the plurality of collection task sets in a predetermined order and adjusting the predetermined collection task indicators from the current moment based on the current time granularity to obtain a target task allocation result includes: Traversing the multiple collection task sets in descending order of the periods, and traversing each collection task indicator in each collection task set in descending order of the preset overhead proportion corresponding to each collection task indicator; the predetermined collection task indicators include: the multiple collection task indicators; Adjust each of the acquisition task indicators 2N times from the current moment in the multiple feasible moments according to a preset integer N and the current time granularity, and determine 2N feasible adjustment moments corresponding to each of the acquisition task indicators after the 2N adjustments; De-overlapping and merging the 2N feasible adjustment moments with each collection moment to obtain multiple new collection moments corresponding to each adjustment, and obtaining the collection task indicators corresponding to each of the multiple new collection moments after each adjustment; each collection moment includes the multiple collection task indicators and is a collection moment pre-assigned within a preset period; Determining multiple intermediate new collection moments from the multiple new collection moments according to the increased collection cycle, and adding the increased collection overhead to the preset overhead proportions corresponding to the multiple intermediate new collection moments after each adjustment to obtain a sum of multiple new overhead proportions; Multiple allocation results are determined by summing the multiple new overhead proportions and combining the collection task indicators corresponding to the multiple new collection moments after each adjustment, so as to determine the target task allocation result through the multiple allocation results.

5. The data collection method according to claim 2, characterized in that: The step of adjusting each current collection task indicator 2N times at each collection moment according to a preset integer N and the preset time granularity from the current moment, determining 2N adjustment moments corresponding to each current collection task indicator after the 2N adjustments, and the collection task indicators corresponding to each collection moment after the 2N adjustments, includes: Adjust each current collection task indicator from the current moment by M time granularities in the direction of the first time axis to obtain an M-th adjusted moment, and obtain the collection task indicators respectively assigned to each collection moment after the M-th adjustment, until each current collection task indicator is adjusted from the current moment by N time granularities in the direction of the first time axis to obtain N adjusted moments, and obtain the collection task indicators respectively assigned to each collection moment after the N-th adjustment in the direction of the first time axis; M is an integer greater than or equal to 1 and less than N; Each current collection task indicator is adjusted from the current moment to the second time axis by K time granularities to obtain the Kth adjustment moment, and the collection task indicators corresponding to each collection moment after the Kth adjustment are obtained, until each current collection task indicator is adjusted from the current moment to the second time axis by N time granularities to obtain the 2N adjustment moments, and the collection task indicators corresponding to each collection moment after the Nth adjustment in the second time axis direction are obtained; K is an integer greater than or equal to 1 and less than N.

6. The data collection method according to claim 2, characterized in that: The corresponding adjustment times are determined based on the maximum adjustment overhead change value, and multiple allocation results are obtained by respectively allocating the collection task indicators corresponding to the respective collection moments after the corresponding adjustment times are adjusted, including: Determine, among the 2N adjustment moments, a maximum adjustment moment corresponding to a maximum adjustment overhead change value; Determine the first adjustment number corresponding to the maximum adjustment moment, and determine the allocation result corresponding to the first adjustment number through the collection task indicators corresponding to each collection moment after the first adjustment number is adjusted to obtain the multiple allocation results; the corresponding adjustment number includes: the first adjustment number.

7. The data collection method according to claim 3, characterized in that: The current time granularity is calculated by increasing the collection period, increasing the collection overhead, and calculating the periods and preset overhead ratios corresponding to the multiple collection task information sets, including: Calculating the ratio of the period corresponding to each collection task set to the number of collection task indicators in each collection task set, and determining the maximum integer between the ratio and a predetermined value; Determine a smallest intermediate integer among the maximum integers corresponding to the plurality of collection task sets; Dividing the periods corresponding to the plurality of acquisition task sets by the intermediate integer to obtain a calculation result; The current time granularity is determined based on the calculation result.

8. The data collection method according to claim 4, characterized in that: Adjusting each of the acquisition task indicators 2N times from the current moment in the multiple feasible moments according to a preset integer N and the current time granularity, and determining 2N feasible adjustment moments corresponding to each of the acquisition task indicators after the 2N adjustments, includes: Adjust each of the acquisition task indicators from the current moment in the common multiple period by P time granularities in the direction of the first time axis of the common multiple period to obtain the Pth feasible adjustment moment, until each of the acquisition task indicators is adjusted from the current moment to the first time axis of the common multiple period by N time granularities to obtain N feasible adjustment moments; P is an integer greater than or equal to 1 and less than N; Adjust each acquisition task indicator from the current moment in the common multiple period to the second time axis direction of the common multiple period by Q time granularities to obtain the Qth feasible adjustment moment, until each acquisition task indicator is adjusted from the current moment to the second time axis direction of the common multiple period by N time granularities to obtain the 2N feasible adjustment moments; Q is an integer greater than or equal to 1 and less than N.

9. The data collection method according to claim 4, characterized in that: The sum of the multiple new overhead proportions is combined with the collection task indicators corresponding to the multiple new collection moments after each adjustment to determine multiple allocation results, including: Determining a maximum sum of new overhead proportions from the sums of the multiple new overhead proportions, and determining a maximum intermediate new acquisition time corresponding to the maximum sum of new overhead proportions; Allocating the increased collection task indicator to the maximum intermediate new collection moment, and then combining the collection task indicators corresponding to the multiple new collection moments after each adjustment to determine the intermediate allocation result after each adjustment, thereby obtaining 2N intermediate allocation results corresponding to each collection task indicator; Establishing a corresponding relationship between the intermediate allocation result and the sum of the maximum new expenditure proportion; The minimum sum of the maximum new overhead proportions is determined among the sums of the multiple maximum new overhead proportions, so as to determine that the intermediate allocation result corresponding to the minimum sum of the maximum new overhead proportions is the allocation result after each adjustment, so as to obtain the multiple allocation results.

10. The data collection method according to claim 6, characterized in that: Determining a target task allocation result based on the multiple allocation results includes: Determining a first maximum adjusted cost change value among the adjusted cost change values corresponding to each of the allocation results; If the first maximum adjustment cost change value is greater than a preset optimization threshold, the target allocation result corresponding to the first maximum adjustment cost change value is determined as the target task allocation result.

11. The data collection method according to claim 9, characterized in that: Determining a target task allocation result based on the multiple allocation results includes: The minimum sum of the first new overhead proportions is determined from the sum of the maximum new overhead proportions corresponding to each allocation result, and the target allocation result corresponding to the minimum sum of the first new overhead proportions is determined as the target task allocation result.

12. A data acquisition device, characterized in that: include: A data acquisition unit is configured to acquire a plurality of current collection task indicators, wherein the plurality of current collection task indicators belong to a plurality of collection task sets; each collection task set includes at least one collection task indicator of the same period; the plurality of current collection task indicators are existing collection task indicators after a plurality of collection task indicators are added or reduced; the collection task indicators include scripts or instruction information for collecting indicator information of hardware or software of the terminal; a determining unit configured to determine the preset time granularity as the current time granularity if the multiple current collection task indicators are existing collection indicators after the multiple collection task indicators are reduced by the collection task indicators, or to calculate the current time granularity by increasing the collection period, increasing the collection overhead, and the periods and preset overhead ratios corresponding to the multiple collection task sets, respectively, if the multiple current collection task indicators are existing collection indicators after the multiple collection task indicators are increased by the collection task indicators; a traversal adjustment unit, configured to traverse the predetermined collection task indicators in the plurality of collection task sets in a predetermined order, and adjust the predetermined collection task indicators from a current moment based on the current time granularity to obtain a target task allocation result; the predetermined collection task indicator belongs to the plurality of current collection task indicators; and the current moment is a collection moment pre-assigned by the predetermined collection task indicator; The collecting unit is used to collect target data using the target task allocation result, and display the target data in a display interface or process the target data.

13. A data acquisition device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, the steps in the method according to any one of claims 1 to 11 are implemented.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.

Citation Information

Patent Citations

  • Double-queue data collecting and developing method

    CN103885781A

  • Capacity monitoring method and device and computer readable storage medium

    CN111311086A