Data reporting method, data monitoring method, device, equipment and storage medium
By determining the target data reporting time and generating indicator reporting data packets, the distortion problem caused by the degradation of indicator data sampling accuracy in the microservice architecture is solved, achieving accurate monitoring of indicator data and reducing the number of reporting times.
Patent Information
- Application Number
- CN202111226511.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-21
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-10-21
AI Technical Summary
In the microservice architecture, the degradation of sampling accuracy of monitoring indicator data leads to distortion of indicator data, making it impossible to achieve accurate monitoring.
By determining the target data reporting time, obtaining the indicator cumulative value, generating an indicator reporting data package, and estimating the indicator cumulative value at the intermediate time on the data monitoring end, ensuring accurate reporting and monitoring of indicator data.
It achieves the goal of not losing the indicator change information without reducing the throughput of the indicator data receiver, ensuring accurate monitoring of indicator data and reducing the number of indicator data reporting times.
Smart Images

Figure CN113900901B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to a data reporting method, a data monitoring method, a device, a equipment and a storage medium. Background Art
[0002] In a microservice architecture, in order to observe the operating status of a microservice cluster, it is usually necessary to monitor the operating indicators of microservices. Common indicator reporting and collection methods include active reporting by services and passive collection by monitoring centers. When the number of monitoring indicators is too large, the microservice load is high, or the monitoring center resources are insufficient, it may be necessary to downgrade the sampling accuracy of the indicator data. The sampling accuracy downgrade here may include reducing the sampling density of the indicator data on the timeline.
[0003] In the related art, the degradation of the sampling accuracy of indicator data is generally manual and may be achieved by actively discarding indicator data samples, which leads to distortion of the reported indicator data and inability to accurately monitor the reported indicators. Summary of the invention
[0004] The present disclosure provides a data reporting method, a data monitoring method, an apparatus, a device and a storage medium to at least solve the problem in the related art that the reported indicator data is distorted due to the reduction of sampling accuracy, and the reported indicator cannot be accurately monitored. The technical solution of the present disclosure is as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, a data reporting method is provided, including:
[0006] When the indicator reporting confirmation information is received, determining the indicator to be reported at the target data reporting time; the target data reporting time is determined based on the time when the indicator reporting confirmation information is received and the preset reporting time;
[0007] Obtaining the cumulative value of the indicator to be reported at the target data reporting time; the cumulative value of the indicator is used to represent the cumulative value of the value change of the indicator to be reported from the initial time to the target data reporting time;
[0008] Generate an indicator reporting data packet based on the indicator cumulative value of the indicator to be reported at the target data reporting time;
[0009] Report the indicator reporting data packet; the indicator reporting data packet is used to instruct the data monitoring end to estimate the indicator cumulative value of the indicator to be reported at an intermediate time based on the indicator cumulative value of the indicator to be reported at the historical data reporting time and the indicator cumulative value of the indicator to be reported at the target data reporting time; the intermediate time is determined based on the historical data reporting time and the target data reporting time.
[0010] In an exemplary embodiment, the method further comprises:
[0011] Get the indicator set at each reporting start time;
[0012] During each round of data reporting, based on the indicator set at each reporting start time, multiple indicator subsets corresponding to each round of data reporting are generated;
[0013] The starting time of each report is the time when each round of data reporting starts.
[0014] In an exemplary embodiment, when the indicator reporting confirmation information is received, determining the indicator to be reported at the target data reporting time includes:
[0015] When the indicator reporting confirmation information is received, determining an unreported indicator subset of the current data reporting round; the unreported indicator subset is at least one subset of multiple indicator subsets corresponding to the current data reporting round;
[0016] Based on the unreported indicator subset, the to-be-reported indicator is determined.
[0017] In an exemplary embodiment, the method further comprises:
[0018] When the indicator reporting confirmation information is received and there is no unreported indicator subset in the current data reporting round, the time when the indicator reporting confirmation information is received is determined as the next reporting start time;
[0019] or,
[0020] When indicator reporting confirmation information is received, and there is no unreported indicator subset in the current data reporting round, a preset reporting time after the time when the indicator reporting confirmation information is received and closest to the time when the indicator reporting confirmation information is received is determined as the next reporting start time;
[0021] The unreported indicator subset is at least one subset of multiple indicator subsets corresponding to the current reporting round.
[0022] In an exemplary embodiment, the method includes:
[0023] Monitor indicator change events, where the indicator change events include change type and change indicator;
[0024] When the change type is to delete an indicator, the change indicator is deleted from the current indicator set;
[0025] When the change type is to add an indicator, the changed indicator is added to the current indicator set.
[0026] In an exemplary embodiment, generating an indicator reporting data packet based on the indicator cumulative value of the indicator to be reported at the target data reporting time includes:
[0027] Performing numerical mapping on the indicator cumulative value of the indicator to be reported at the target data reporting time to obtain the indicator mapping value of the indicator to be reported; the number of bytes occupied by the indicator mapping value of the indicator to be reported is less than the indicator cumulative value of the indicator to be reported at the target data reporting time;
[0028] Data encapsulation is performed based on the indicator mapping value of the indicator to be reported to generate the indicator reporting data packet.
[0029] According to a second aspect of an embodiment of the present disclosure, there is provided a data monitoring method, including:
[0030] Receive an indicator reporting data packet; the indicator reporting data packet is generated based on the target data reporting time and the indicator cumulative value of the reported indicator at the target data reporting time, and the indicator cumulative value is used to represent the cumulative value of the numerical change of the reported indicator from the initial time to the reporting time;
[0031] Based on the indicator reporting data packet, obtain the indicator data of the reported indicator at the target data reporting time, and send indicator reporting confirmation information;
[0032] Based on the cumulative value of the reported indicator at the time of historical data reporting and the cumulative value of the reported indicator at the time of target data reporting, the cumulative value of the reported indicator at an intermediate time is estimated; the intermediate time is determined based on the historical data reporting time and the target data reporting time.
[0033] In an exemplary embodiment, obtaining the indicator data of the reported indicator at the target data reporting time based on the indicator reporting data packet includes:
[0034] Decapsulating the indicator reporting data packet to obtain an indicator mapping value of the reported indicator;
[0035] Perform numerical inverse mapping on the indicator mapping value to obtain the indicator cumulative value of the reported indicator at the target data reporting time; the number of bytes occupied by the indicator mapping value of the reported indicator is smaller than the indicator cumulative value of the reported indicator at the target data reporting time.
[0036] According to a third aspect of an embodiment of the present disclosure, a data reporting device is provided, including:
[0037] The to-be-reported indicator determination unit is configured to determine the to-be-reported indicator of the target data reporting time when the indicator reporting confirmation information is received; the target data reporting time is determined based on the time when the indicator reporting confirmation information is received and the preset reporting time;
[0038] The indicator cumulative value acquisition unit is configured to execute to obtain the indicator cumulative value of the indicator to be reported at the target data reporting time; the indicator cumulative value is used to represent the accumulated value of the value change of the indicator to be reported from the initial time to the target data reporting time;
[0039] A data packet generating unit is configured to generate an indicator reporting data packet based on the indicator accumulation value of the indicator to be reported at the target data reporting time;
[0040] The reporting unit is configured to execute reporting of the indicator reporting data packet; the indicator reporting data packet is used to instruct the data monitoring terminal to estimate the indicator cumulative value of the indicator to be reported at an intermediate time based on the indicator cumulative value of the indicator to be reported at the historical data reporting time and the indicator cumulative value of the indicator to be reported at the target data reporting time; the intermediate time is determined based on the historical data reporting time and the target data reporting time.
[0041] In an exemplary embodiment, the apparatus further comprises:
[0042] An indicator set acquisition unit, configured to execute acquisition of an indicator set at each reporting start time;
[0043] The indicator subset generating unit is configured to generate, during each round of data reporting, a plurality of indicator subsets corresponding to each round of data reporting based on the indicator set at each reporting start time;
[0044] The starting time of each report is the time when each round of data reporting starts.
[0045] In an exemplary embodiment, the apparatus further comprises:
[0046] A first determining unit is configured to determine the time when the indicator reporting confirmation information is received as the next reporting start time when there is no unreported indicator subset in the current data reporting round;
[0047] or,
[0048] The second determining unit is configured to determine, when indicator reporting confirmation information is received and there is no unreported indicator subset in the current data reporting round, a preset reporting time after the time when the indicator reporting confirmation information is received and closest to the time when the indicator reporting confirmation information is received as the next reporting start time;
[0049] The unreported indicator subset is at least one subset of multiple indicator subsets corresponding to the current reporting round.
[0050] In an exemplary embodiment, the apparatus comprises:
[0051] An event monitoring unit is configured to monitor an indicator change event, wherein the indicator change event includes a change type and a change indicator;
[0052] an indicator deletion unit, configured to delete the changed indicator from the current indicator set when the change type is to delete the indicator;
[0053] The indicator adding unit is configured to add the changed indicator to the current indicator set when the change type is to add an indicator.
[0054] In an exemplary embodiment, the data packet generating unit includes:
[0055] A numerical mapping unit is configured to perform numerical mapping on the cumulative indicator value of the indicator to be reported at the target data reporting time to obtain an indicator mapping value of the indicator to be reported; the number of bytes occupied by the indicator mapping value of the indicator to be reported is less than the cumulative indicator value of the indicator to be reported at the target data reporting time;
[0056] The data encapsulation unit is configured to perform data encapsulation based on the indicator mapping value of the indicator to be reported, and generate the indicator reporting data packet.
[0057] According to a fourth aspect of an embodiment of the present disclosure, there is provided a data monitoring device, including:
[0058] A data packet receiving unit, configured to receive an indicator reporting data packet; the indicator reporting data packet is generated based on a target data reporting time and an indicator cumulative value of the reporting indicator at the target data reporting time, the indicator cumulative value being used to represent a cumulative value of a numerical change of the reporting indicator from an initial time to the reporting time;
[0059] A data packet processing unit is configured to execute the indicator reporting data packet based on the indicator, obtain the indicator data of the reported indicator at the target data reporting time, and send indicator reporting confirmation information;
[0060] The numerical estimation unit is configured to estimate the indicator cumulative value of the reported indicator at an intermediate moment based on the indicator cumulative value of the reported indicator at the historical data reporting moment and the indicator cumulative value of the reported indicator at the target data reporting moment; the intermediate moment is determined based on the historical data reporting moment and the target data reporting moment.
[0061] In an exemplary embodiment, the data packet processing unit includes:
[0062] A data packet decapsulation unit, configured to decapsulate the indicator reporting data packet to obtain the reporting time and the indicator mapping value of the reported indicator;
[0063] The numerical inverse mapping unit is configured to perform numerical inverse mapping on the indicator mapping value to obtain the indicator cumulative value of the target data reporting indicator at the reporting time; the number of bytes occupied by the indicator mapping value of the reporting indicator is smaller than the indicator cumulative value of the reporting indicator at the target data reporting time.
[0064] According to a fifth aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the data reporting method or the data monitoring method as described above.
[0065] According to a sixth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of a server, the server is enabled to execute the data reporting method or data monitoring method as described above.
[0066] According to the seventh aspect of an embodiment of the present disclosure, a computer program product is provided, which includes a computer program, and the computer program is stored in a readable storage medium. At least one processor of a computer device reads and executes the computer program from the readable storage medium, so that the device executes the above-mentioned data reporting method or data monitoring method.
[0067] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0068] When the indicator reporting confirmation information is received, the present disclosure determines the indicator to be reported at the target data reporting time, collects the indicator cumulative value of the indicator to be reported at the target data reporting time; then generates an indicator reporting data packet based on the indicator cumulative value of the indicator to be reported at the target data reporting time; and then reports the indicator reporting data packet. Here, when the indicator reporting confirmation information sent by the indicator data receiver is received, the indicator to be reported is determined and the corresponding indicator cumulative value is collected, so that the indicator data reporting can be adapted to the operating state of the indicator data receiver; in addition, by reporting the indicator cumulative value, the indicator data receiver can determine the indicator change difference between the two reporting moments and the indicator cumulative value at the middle moment through the indicator cumulative value at the two reporting moments; when the throughput of the indicator data receiver is reduced, it can be achieved on the basis of reducing the number of indicator data reports without losing the indicator change information between the two reporting moments, thereby realizing accurate monitoring of the indicator data.
[0069] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0071] Figure 1 It is a schematic diagram of an implementation environment according to an exemplary embodiment.
[0072] Figure 2 The present invention is a flow chart of a data reporting method according to an exemplary embodiment.
[0073] Figure 3 The figure is a flow chart of a method for generating an indicator set according to an exemplary embodiment.
[0074] Figure 4 The present invention is a flow chart of a method for determining an indicator to be reported according to an exemplary embodiment.
[0075] Figure 5 The present invention is a flow chart of a method for determining a next reporting start time according to an exemplary embodiment.
[0076] Figure 6 The present invention is a flow chart of a method for changing an indicator set according to an exemplary embodiment.
[0077] Figure 7 The present invention is a flow chart of a method for generating a reporting data packet according to an exemplary embodiment.
[0078] Figure 8The present invention is a flow chart of a data monitoring method according to an exemplary embodiment.
[0079] Fig. 9 The figure is a flow chart of a method for processing a data packet according to an exemplary embodiment.
[0080] Fig.10 The present invention is a block diagram of a data reporting device according to an exemplary embodiment.
[0081] Fig.11 The figure is a block diagram of a data monitoring device according to an exemplary embodiment.
[0082] Fig.12 It is a schematic diagram of a device structure according to an exemplary embodiment. DETAILED DESCRIPTION
[0083] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0084] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0085] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0086] See also Figure 1 , which shows a schematic diagram of an implementation environment provided by an embodiment of the present disclosure, the implementation environment may include: at least one first terminal 110 and a second terminal 120, the first terminal 110 and the second terminal 120 can communicate data via a network. The first terminal may be a monitored microservice end, and the second terminal may be a server end for implementing indicator monitoring.
[0087] Specifically, the first terminal 110 can collect indicator data at the target data reporting time, and report the collected indicator data at the target data reporting time to the second terminal 120 through the network connection established between the first terminal 110 and the second terminal 120, and wait for the indicator reporting confirmation information sent by the second terminal 120; after the second terminal 120 confirms receipt of the reported data, it can send indicator reporting confirmation information to the first terminal 110, and the second terminal can display, store, or reprocess the received indicator data.
[0088] The first terminal 110 can communicate with the second terminal 120 based on the browser / server mode (B / S) or the client / server mode (C / S). The first terminal 110 may include: physical devices such as smart phones, tablet computers, laptops, digital assistants, smart wearable devices, vehicle terminals, servers, etc., and may also include software running in physical devices, such as applications, etc. The operating system running on the first terminal 110 in the embodiment of the present disclosure may include but is not limited to Android system, IOS system, Linux, Windows, etc.
[0089] The second terminal 120 can establish a communication connection with the first terminal 110 via wired or wireless communication. The second terminal 120 can include an independently operated server, or a distributed server, or a server cluster composed of multiple servers, wherein the server can be a cloud server.
[0090] In order to solve the problem in the related art that the reported indicator data is distorted due to the reduction of sampling accuracy, and the reported indicator cannot be accurately monitored, the embodiment of the present disclosure provides a data reporting method, and the execution subject of the method can be Figure 1 The first terminal in the monitoring is the microservice terminal to be monitored. Figure 2 , the method may specifically include:
[0091] S210. When the indicator reporting confirmation information is received, determine the indicator to be reported at the target data reporting time; the target data reporting time is determined based on the time when the indicator reporting confirmation information is received and the preset reporting time.
[0092] The indicator reporting confirmation information here is information sent by the indicator data recipient to the monitored microservice after confirming receipt of the reported indicator data. Generally speaking, the indicator reporting confirmation information currently received by the monitored microservice is feedback information on the indicator data most recently reported by the monitored microservice, that is, one data report corresponds to one report confirmation information; in other optional embodiments, multiple different batches of data reports may also correspond to one report confirmation information, which is not specifically limited in this embodiment.
[0093] The preset reporting time in the disclosed embodiment can be a series of preset reporting time points set in advance on the timeline, such as taking the current time as the time starting point, setting a reporting time point every preset time length, for example, setting a reporting time point every 10s, thereby forming a preset reporting time. When receiving the indicator reporting confirmation information, first determine whether the moment of receiving the indicator reporting confirmation information is a preset reporting time point, if so, the target data reporting time is the moment of receiving the indicator reporting confirmation information; if not, the preset reporting time point after the moment of receiving the indicator reporting confirmation information and the closest to the moment of receiving the indicator reporting confirmation information is used as the target data reporting time; for example, the moment of receiving the indicator reporting confirmation information is the 15th second, and the preset reporting time points are the 0th second, 10th second, 20th second, 30th second, etc., then the preset reporting time point of the 20th second can be determined as the target data reporting time.
[0094] See also Figure 3 , which shows a method for generating an indicator set, which may include:
[0095] S310. Obtain the indicator set for each reporting start time.
[0096] S320. During each round of data reporting, based on the indicator set at each reporting start time, generate multiple indicator subsets corresponding to each round of data reporting.
[0097] The starting time of each report is the time when each round of data reporting starts.
[0098] Since the monitored microservice end generally has a large number of indicators, when reporting indicator data, the indicator data of the microservice end can be reported in batches. When all batches of indicator data in the microservice end are reported, it is called a round of indicator reporting. The reporting start time here can be the time when a round of data reporting starts. According to the above content, it can be known that the reporting start time here can also be a preset reporting time point. Obtain the indicator set corresponding to each reporting start time, divide the indicator set, and obtain multiple indicator subsets. The indicators in each subset are not repeated, that is, each indicator can only exist in one indicator subset, and the number of indicators in each indicator subset can be the same or different. The specific method for dividing the indicator set can be random division, or it can be set division based on division conditions, such as dividing indicators of the same category into the same indicator subset, or dividing indicators corresponding to the same object into the same subset, etc., which is not specifically limited in this embodiment.
[0099] In addition, the number of indicators in each indicator subset can be determined based on the time required to complete the previous round of data reporting; for example, if the time required to complete the previous round of data reporting is longer than the preset average reporting time, then when the data set is divided in the current round, the number of indicators in each indicator subset can be reduced, so that when the current round of data reporting is carried out, the processing pressure of the indicator data receiver for each reported indicator data can be reduced, thereby improving the processing efficiency; if the time required to complete the previous round of data reporting is less than the preset average reporting time, then when the data set is divided in the current round, the number of indicators in each indicator subset can be increased, so that the resources of the indicator data receiver can be fully utilized for indicator data processing, thereby avoiding resource waste.
[0100] Compared with completing the reporting of all indicators at one time, sending the reported indicators in batches can reduce the amount of data reported each time, reduce the requirements for transmission bandwidth, and improve data reporting efficiency.
[0101] Since the indicator data to be reported is reported in batches in each round of data reporting, it is necessary to determine whether the data reporting of the current round is completed when the indicator reporting confirmation information is received. If the data reporting of the current round is not completed, please refer to Figure 4 , which shows a method for determining indicators to be reported, which may include:
[0102] S410. When indicator reporting confirmation information is received, determine a subset of unreported indicators in the current data reporting round; the unreported indicator subset is at least one subset of multiple indicator subsets corresponding to the current data reporting round.
[0103] S420. Determine the indicators to be reported based on the unreported indicator subset.
[0104] Each time a subset of indicators to be reported is selected from multiple indicator subsets, it can be selected randomly or based on preset conditions. When the indicator reporting confirmation information is received, it is judged whether there is an unreported indicator subset in the current data reporting round. If there is an unreported indicator subset, the indicators to be reported are selected from the unreported indicator subset to avoid omissions in reporting indicator subsets in the current data reporting round and to achieve comprehensive reporting of indicator subsets.
[0105] In addition, when the indicator reporting confirmation information is received and there is no unreported indicator subset in the current data reporting round, it means that the current round of data reporting has been completed and the next round of data reporting needs to be started. For the next round of data reporting, it involves the determination of the next reporting start time; please refer to Figure 5 , which shows a method for determining the next reporting start time, which may include:
[0106] S510. When indicator reporting confirmation information is received and there is no unreported indicator subset in the current data reporting round, determine whether the moment when the indicator reporting confirmation information is received is the preset reporting moment; if so, execute step S520; if not, execute step S530.
[0107] S520. Determine the time when the indicator reporting confirmation information is received as the next reporting start time.
[0108] S530. Determine a preset reporting time after the time of receiving the indicator reporting confirmation information and adjacent to the time of receiving the indicator reporting confirmation information as the next reporting start time.
[0109] The unreported indicator subset is at least one subset of multiple indicator subsets corresponding to the current reporting round.
[0110] The determination of the next reporting start time here is similar to the method for determining the target data reporting time in the present embodiment, and will not be repeated here. When there is no indicator subset in the current data reporting round, the reporting start time of the next round of data reporting is re-determined, so that the indicators can be reported continuously to avoid interruption of indicator data reporting.
[0111] The reason why the corresponding indicator set is obtained at each reporting start time is that the indicator set changes dynamically. The indicator set corresponding to different reporting start times may be different. Please refer to Figure 6 , which shows a method for changing an indicator set, including:
[0112] S610. Monitor an indicator change event, where the indicator change event includes a change type and a change indicator.
[0113] S620. When the change type is to delete an indicator, delete the changed indicator from the current indicator set.
[0114] S630. When the change type is to add an indicator, add the changed indicator to the current indicator set.
[0115] The indicator set is changed by event monitoring. Once the corresponding event is monitored, the corresponding operation will be triggered. It should be noted that the indicator set can be obtained at each reporting start time. For indicators that have changed during the current round of indicator reporting, they can be reflected in the next round of indicator reporting, but not in the current round of indicator reporting. For example, the indicator set obtained at the reporting start time 1 is {a, b, c}. In the first round of data reporting, the indicator data of indicators a, b, and c will be reported; in the first round of data reporting, indicator c is deleted, then the indicator set obtained at the reporting start time 2 is {a, b}, and the data of indicator c will not be reported in the second round of data reporting; the implementation details of adding indicators are similar to those of deleting indicators. Since indicators may change, the indicator change event is monitored to update the current indicator set, so that the updated indicator set can be obtained at each reporting start time, so as to realize indicator data reporting based on the updated indicator set, realize dynamic indicator reporting, and improve the flexibility and adaptability of indicator reporting.
[0116] S220. Obtain the cumulative value of the indicator to be reported at the target data reporting time; the cumulative value of the indicator is used to represent the accumulated value of the numerical change of the indicator to be reported from the initial time to the target data reporting time.
[0117] For the cumulative value of the indicator, the recording of the indicator data can be achieved through the cumulative frequency. The initial time can be the time when the indicator to be reported begins to appear. For example, counting starts from the first event corresponding to the indicator to be reported, and the current accumulated frequency can be used as the indicator data of the event.
[0118] The reported data in the present disclosure is the cumulative value of the indicator at a specific moment. The indicator data receiver can determine the difference in indicator change between the two reporting moments through the cumulative value of the indicator at the two reporting moments. When the throughput of the indicator data receiver decreases, it is possible to reduce the number of indicator data reports without losing the indicator change information between the two reporting moments, thereby achieving accurate monitoring of the indicator data.
[0119] S230. Generate an indicator reporting data packet based on the indicator cumulative value of the indicator to be reported at the target data reporting time.
[0120] See also Figure 7 , which shows a method for generating a reporting data packet, which may include:
[0121] S710. Numerically map the cumulative value of the to-be-reported metric at the target data reporting time to obtain the mapped value of the to-be-reported metric; the number of bytes occupied by the mapped value of the to-be-reported metric is less than the cumulative value of the to-be-reported metric at the target data reporting time.
[0122] S720. Based on the mapped value of the to-be-reported metric, perform data encapsulation to generate the metric reporting data packet.
[0123] The cumulative value of the metric may be a value that occupies a large amount of memory. Here, before sending the metric data, numerically map the cumulative value of the to-be-reported metric to generate a mapped value of the to-be-reported metric that occupies fewer bytes than the cumulative value of the metric; and generate a metric reporting data packet based on the mapped value, so as to be able to reduce the size of the metric reporting data packet, thereby saving transmission resources, reducing the requirement for transmission bandwidth, and improving the data reporting efficiency.
[0124] Further, when performing data encapsulation based on the mapped value of the metric, the target data reporting time may also be combined, that is, generate and send a metric reporting data packet based on the target data reporting time and the mapped value of the to-be-reported metric at the target data reporting time. The target data reporting time can identify the time information of the metric data, which is convenient for the metric data receiver to process the corresponding metric data based on the reporting time; for example, analyze the metric data of the same metric at different reporting time points.
[0125] S240. Report the metric reporting data packet; the metric reporting data packet is used to instruct the data monitoring end to estimate the cumulative value of the to-be-reported metric at the intermediate time based on the cumulative value of the to-be-reported metric at the historical data reporting time and the cumulative value of the to-be-reported metric at the target data reporting time; the intermediate time is determined based on the historical data reporting time and the target data reporting time.
[0126] In an alternative embodiment, since the metric reporting data packet includes the target data reporting time and the cumulative value of the reported metric at the target data reporting time, the data monitoring end stores each data reporting time and the cumulative value of each reported metric at the corresponding data reporting time, so that the data monitoring end can calculate the metric change value of each reported metric between any two data reporting times; for example, for the reported metric A, the cumulative value corresponding to the reporting time t1 is a1, and the cumulative value corresponding to the reporting time t2 is a2, t1 < t2, so the metric change value of the reported metric A between the reporting time t1 and the reporting time t2 is a2 - a1.
[0127] In a specific embodiment, since the index reporting data packet includes the target data reporting time and the cumulative value of the reported index at the target data reporting time, the cumulative value of the index at the intermediate time can also be estimated according to the respective data reporting times stored in the data monitoring end and the index cumulative values of the respective reported indexes at the corresponding data reporting times; for example, for the reported index A, the cumulative value of the index corresponding to the reporting time t1 is a1, and the cumulative value of the index corresponding to the reporting time t2 is a2, t1 < t2, so the intermediate time is (t1 + t2) / 2, and the cumulative value of the corresponding reported index A at the intermediate time (t1 + t2) / 2 can be estimated as (a1 + a2) / 2. By estimating the cumulative value of the index at the intermediate time, the accuracy of index monitoring can be improved.
[0128] Through the network connection established between the index data sender and the index data receiver, the index reporting data packet is reported from the index data sender to the index data receiver.
[0129] Further, the present disclosure also provides a data monitoring method, and the execution subject of this method can be Figure 1 the second terminal in Figure 8 , specifically, it can be the server side for realizing index monitoring. Please refer to
[0130] S810. Receive the index reporting data packet; the index reporting data packet is generated based on the target data reporting time and the cumulative value of the reported index at the target data reporting time, and the cumulative value is used to represent the cumulative value of the numerical change of the reported index from the initial time to the reporting time.
[0131] S820. Based on the index reporting data packet, obtain the index data of the reported index at the target data reporting time, and send an index reporting confirmation message.
[0132] S830. Based on the cumulative value of the reported index at the historical data reporting time and the cumulative value of the reported index at the target data reporting time, estimate the cumulative value of the reported index at the intermediate time; the intermediate time is determined based on the historical data reporting time and the target data reporting time.
[0133] When the index data receiver successfully stores the received index data, it will send an index reporting confirmation message to the index data sender to inform the index data sender that the index data has been sent successfully, and the next batch of index data reporting can be performed. Please refer to Fig. 9 , which shows a data packet processing method. This method can include:
[0134] S910. Unseal the index reporting data packet to obtain the index mapping value of the reported index.
[0135] S920. Perform numerical inverse mapping on the indicator mapping value to obtain the indicator cumulative value of the reported indicator at the target data reporting time; the number of bytes occupied by the indicator mapping value of the reported indicator is smaller than the indicator cumulative value of the reported indicator at the target data reporting time.
[0136] In addition, the information obtained after unsealing the indicator reporting data packet may also include the reporting time, so that when storing the indicator cumulative value, the reporting time and the indicator cumulative value of the reported indicator at the reporting time can be stored correspondingly, so that the indicator data recipient can process the corresponding indicator data based on the reporting time; for example, analyzing the indicator data of the same indicator at different reporting time points, etc.
[0137] for Figure 8 and Fig. 9 The relevant implementation details of the method shown can be found in the above content of this embodiment, and have corresponding technical effects, which will not be repeated here.
[0138] When the indicator reporting confirmation information is received, the present disclosure determines the indicator to be reported at the target data reporting time, collects the indicator cumulative value of the indicator to be reported at the target data reporting time; then generates an indicator reporting data packet based on the indicator cumulative value of the indicator to be reported at the target data reporting time; and then reports the indicator reporting data packet. Here, when the indicator reporting confirmation information sent by the indicator data receiver is received, the indicator to be reported is determined and the corresponding indicator cumulative value is collected, so that the indicator data reporting can be adapted to the operating state of the indicator data receiver; in addition, by reporting the indicator cumulative value, the indicator data receiver can determine the indicator change difference between the two reporting moments through the indicator cumulative value at the two reporting moments; when the throughput of the indicator data receiver is reduced, it can be achieved on the basis of reducing the number of indicator data reports without losing the indicator change information between the two reporting moments, thereby realizing accurate monitoring of the indicator data.
[0139] In the specific implementation, the monitored microservice acts as the client, and the monitoring center agent program of the monitoring indicator acts as the server, and a network communication connection is established from the client to the server. The monitored microservice collects the current indicator sample data at the current moment in a certain batch size through the established network communication connection to the monitoring center agent program, sends the monitoring indicator sample data to the monitoring center agent program, and waits for the monitoring center agent program to confirm that the data has been received. The sending of all the indicator sample data this time is called completing a round of data sending. After receiving the monitoring indicator sample data, the monitoring center agent program writes these data into the indicator storage. After the writing is completed, it confirms the delivery of the batch to the monitored microservice through the network communication connection that receives the data. When the monitored microservice reaches the previously agreed time interval, the next round of indicator sending will be carried out only when there is no indicator in transit to be sent. The indicator data reported by the monitored microservice needs to be a snapshot of the cumulative value at a specific moment, rather than the difference between two sampling moments. Since the data indicators sent in each batch include the specific reporting time and the snapshot of the cumulative value at this time, when the throughput of the monitoring center agent program decreases, the resolution of the data sample points on the timeline is reduced, which not only reduces the number of collected indicators but also does not affect the accuracy of the monitoring values between two collections.
[0140] Fig.10 is a block diagram of a data reporting device according to an exemplary embodiment. Fig.10 , the device comprises:
[0141] The to-be-reported indicator determination unit 1010 is configured to determine the to-be-reported indicator of the target data reporting time when the indicator reporting confirmation information is received; the target data reporting time is determined based on the time when the indicator reporting confirmation information is received and the preset reporting time;
[0142] The indicator cumulative value acquisition unit 1020 is configured to execute to obtain the indicator cumulative value of the indicator to be reported at the target data reporting time; the indicator cumulative value is used to represent the cumulative value of the value change of the indicator to be reported from the initial time to the target data reporting time;
[0143] The data packet generating unit 1030 is configured to generate an indicator reporting data packet based on the indicator accumulation value of the indicator to be reported at the target data reporting time;
[0144] The reporting unit 1040 is configured to execute reporting of the indicator reporting data packet; the indicator reporting data packet is used to instruct the data monitoring terminal to estimate the indicator cumulative value of the indicator to be reported at an intermediate time based on the indicator cumulative value of the indicator to be reported at the historical data reporting time and the indicator cumulative value of the indicator to be reported at the target data reporting time; the intermediate time is determined based on the historical data reporting time and the target data reporting time.
[0145] In an exemplary embodiment, the apparatus further comprises:
[0146] An indicator set acquisition unit, configured to execute acquisition of an indicator set at each reporting start time;
[0147] The indicator subset generating unit is configured to generate, during each round of data reporting, a plurality of indicator subsets corresponding to each round of data reporting based on the indicator set at each reporting start time;
[0148] The starting time of each report is the time when each round of data reporting starts.
[0149] In an exemplary embodiment, the apparatus further comprises:
[0150] A first determining unit is configured to determine the time when the indicator reporting confirmation information is received as the next reporting start time when there is no unreported indicator subset in the current data reporting round;
[0151] or,
[0152] The second determining unit is configured to determine, when indicator reporting confirmation information is received and there is no unreported indicator subset in the current data reporting round, a preset reporting time after the time when the indicator reporting confirmation information is received and closest to the time when the indicator reporting confirmation information is received as the next reporting start time;
[0153] The unreported indicator subset is at least one subset of multiple indicator subsets corresponding to the current reporting round.
[0154] In an exemplary embodiment, the apparatus comprises:
[0155] An event monitoring unit is configured to monitor an indicator change event, wherein the indicator change event includes a change type and a change indicator;
[0156] an indicator deletion unit, configured to delete the changed indicator from the current indicator set when the change type is to delete the indicator;
[0157] The indicator adding unit is configured to add the changed indicator to the current indicator set when the change type is to add an indicator.
[0158] In an exemplary embodiment, the data packet generation unit 1030 includes:
[0159] A numerical mapping unit is configured to perform numerical mapping on the cumulative indicator value of the indicator to be reported at the target data reporting time to obtain an indicator mapping value of the indicator to be reported; the number of bytes occupied by the indicator mapping value of the indicator to be reported is less than the cumulative indicator value of the indicator to be reported at the target data reporting time;
[0160] The data encapsulation unit is configured to perform data encapsulation based on the indicator mapping value of the indicator to be reported, and generate the indicator reporting data packet.
[0161] See also Fig.11 , which shows an indicator monitoring device, including:
[0162] The data packet receiving unit 1110 is configured to receive an indicator reporting data packet; the indicator reporting data packet is generated based on the target data reporting time and the indicator cumulative value of the reported indicator at the target data reporting time, and the indicator cumulative value is used to represent the cumulative value of the numerical change of the reported indicator from the initial time to the reporting time;
[0163] The data packet processing unit 1120 is configured to execute the indicator reporting data packet based on the indicator, obtain the indicator data of the reported indicator at the target data reporting time, and send indicator reporting confirmation information;
[0164] The numerical estimation unit 1130 is configured to estimate the indicator cumulative value of the reported indicator at an intermediate moment based on the indicator cumulative value of the reported indicator at the historical data reporting moment and the indicator cumulative value of the reported indicator at the target data reporting moment; the intermediate moment is determined based on the historical data reporting moment and the target data reporting moment.
[0165] In an exemplary embodiment, the data packet processing unit 1120 includes:
[0166] A data packet decapsulation unit, configured to decapsulate the indicator reporting data packet to obtain the reporting time and the indicator mapping value of the reported indicator;
[0167] The numerical inverse mapping unit is configured to perform numerical inverse mapping on the indicator mapping value to obtain the indicator cumulative value of the target data reporting indicator at the reporting time; the number of bytes occupied by the indicator mapping value of the reporting indicator is smaller than the indicator cumulative value of the reporting indicator at the target data reporting time.
[0168] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0169] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided. Optionally, the computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a tape, a floppy disk, an optical data storage device, etc.; when the instructions in the computer-readable storage medium are executed by a processor of a server, the server is enabled to execute any of the methods described above.
[0170] In an exemplary embodiment, a computer program product is also provided, which includes a computer program stored in a readable storage medium, and at least one processor of a computer device reads and executes the computer program from the readable storage medium, so that the device performs any of the above methods.
[0171] This embodiment also provides a device, whose structure diagram can be seen in Fig.12 The device 1200 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1222 (for example, one or more processors) and memory 1232, one or more storage media 1230 (for example, one or more mass storage devices) storing application programs 1242 or data 1244. Among them, the memory 1232 and the storage medium 1230 may be short-term storage or persistent storage. The program stored in the storage medium 1230 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the device. Furthermore, the central processing unit 1222 can be configured to communicate with the storage medium 1230 and execute a series of instruction operations in the storage medium 1230 on the device 1200. The device 1200 may also include one or more power supplies 1226, one or more wired or wireless network interfaces 1250, one or more input and output interfaces 1258, and / or, one or more operating systems 1241, such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM Etc. Any of the above methods in this embodiment can be based on Fig.12 The device shown is implemented.
[0172] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0173] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A data reporting method, characterized in that: include: When the indicator reporting confirmation information is received, the indicator to be reported at the target data reporting time is determined; the target data reporting time is determined based on the time when the indicator reporting confirmation information is received and the preset reporting time; when the indicator reporting confirmation information is received, first determine whether the time when the indicator reporting confirmation information is received is a preset reporting time point, if so, the target data reporting time is the time when the indicator reporting confirmation information is received; if not, the preset reporting time point after the time when the indicator reporting confirmation information is received and closest to the time when the indicator reporting confirmation information is received is used as the target data reporting time; Obtaining the cumulative value of the indicator to be reported at the time of reporting the target data; The indicator cumulative value is used to represent the cumulative value of the value change of the indicator to be reported from the initial time to the target data reporting time; Generate an indicator reporting data packet based on the indicator cumulative value of the indicator to be reported at the target data reporting time; Report the indicator reporting data packet; the indicator reporting data packet is used to instruct the data monitoring end to estimate the indicator cumulative value of the indicator to be reported at the intermediate time based on the indicator cumulative value of the indicator to be reported at the historical data reporting time and the indicator cumulative value of the indicator to be reported at the target data reporting time; the intermediate time between any historical data reporting time and the target data reporting time is determined based on the average value of any historical data reporting time and the target data reporting time.
2. A data reporting method according to claim 1, characterized in that: The method further comprises: Get the indicator set at each reporting start time; During each round of data reporting, based on the indicator set at each reporting start time, multiple indicator subsets corresponding to each round of data reporting are generated; The starting time of each report is the time when each round of data reporting starts.
3. A data reporting method according to claim 2, characterized in that: The method further comprises: When the indicator reporting confirmation information is received and there is no unreported indicator subset in the current data reporting round, the time when the indicator reporting confirmation information is received is determined as the next reporting start time; or, When indicator reporting confirmation information is received, and there is no unreported indicator subset in the current data reporting round, a preset reporting time after the time when the indicator reporting confirmation information is received and adjacent to the time when the indicator reporting confirmation information is received is determined as the next reporting start time; The unreported indicator subset is at least one subset of multiple indicator subsets corresponding to the current reporting round.
4. A data reporting method according to claim 1, characterized in that: The method comprises: Monitor indicator change events, where the indicator change events include change type and change indicator; When the change type is to delete an indicator, the change indicator is deleted from the current indicator set; When the change type is to add an indicator, the changed indicator is added to the current indicator set.
5. A data reporting method according to claim 1, characterized in that: The generating the indicator reporting data packet based on the indicator cumulative value of the indicator to be reported at the target data reporting time includes: Performing numerical mapping on the indicator cumulative value of the indicator to be reported at the target data reporting time to obtain the indicator mapping value of the indicator to be reported; the number of bytes occupied by the indicator mapping value of the indicator to be reported is less than the indicator cumulative value of the indicator to be reported at the target data reporting time; Data encapsulation is performed based on the indicator mapping value of the indicator to be reported to generate the indicator reporting data packet.
6. A data monitoring method, characterized in that: include: Receive an indicator reporting data packet; the indicator reporting data packet is generated based on the target data reporting time and the indicator cumulative value of the reported indicator at the target data reporting time, and the indicator cumulative value is used to represent the cumulative value of the numerical change of the reported indicator from the initial time to the reporting time; when the indicator reporting confirmation information is received, first determine whether the time when the indicator reporting confirmation information is received is a preset reporting time point, if so, the target data reporting time is the time when the indicator reporting confirmation information is received; if not, the preset reporting time point after the time when the indicator reporting confirmation information is received and closest to the time when the indicator reporting confirmation information is received is used as the target data reporting time; Based on the indicator reporting data packet, obtain the indicator data of the reported indicator at the target data reporting time, and send indicator reporting confirmation information; Based on the cumulative value of the reported indicator at the time of historical data reporting and the cumulative value of the reported indicator at the time of target data reporting, estimate the cumulative value of the reported indicator at the intermediate time; the intermediate time between any historical data reporting time and the target data reporting time is determined based on the average value of any historical data reporting time and the target data reporting time.
7. A data monitoring method according to claim 6, characterized in that: The obtaining, based on the indicator reporting data packet, indicator data of the reported indicator at the target data reporting time comprises: Decapsulating the indicator reporting data packet to obtain an indicator mapping value of the reported indicator; Perform numerical inverse mapping on the indicator mapping value to obtain the indicator cumulative value of the reported indicator at the target data reporting time; the number of bytes occupied by the indicator mapping value of the reported indicator is smaller than the indicator cumulative value of the reported indicator at the target data reporting time.
8. A data reporting device, characterized in that: include: The unit for determining the indicator to be reported is configured to determine the indicator to be reported at the target data reporting time when the indicator reporting confirmation information is received; the target data reporting time is determined based on the time when the indicator reporting confirmation information is received and the preset reporting time; when the indicator reporting confirmation information is received, first determine whether the time when the indicator reporting confirmation information is received is a preset reporting time point, if so, the target data reporting time is the time when the indicator reporting confirmation information is received; if not, the preset reporting time point after the time when the indicator reporting confirmation information is received and closest to the time when the indicator reporting confirmation information is received is used as the target data reporting time; An indicator cumulative value acquisition unit is configured to execute to obtain the indicator cumulative value of the indicator to be reported at the target data reporting time; The indicator cumulative value is used to represent the cumulative value of the value change of the indicator to be reported from the initial time to the target data reporting time; A data packet generating unit is configured to generate an indicator reporting data packet based on the indicator accumulation value of the indicator to be reported at the target data reporting time; A reporting unit is configured to execute reporting of the indicator reporting data packet; the indicator reporting data packet is used to instruct the data monitoring terminal to estimate the indicator cumulative value of the indicator to be reported at an intermediate time based on the indicator cumulative value of the indicator to be reported at the historical data reporting time and the indicator cumulative value of the indicator to be reported at the target data reporting time; the intermediate time between any historical data reporting time and the target data reporting time is determined based on the average value of any historical data reporting time and the target data reporting time.
9. A data reporting device according to claim 8, characterized in that: The device also includes: An indicator set acquisition unit, configured to execute acquisition of an indicator set at each reporting start time; The indicator subset generating unit is configured to generate, during each round of data reporting, a plurality of indicator subsets corresponding to each round of data reporting based on the indicator set at each reporting start time; The starting time of each report is the time when each round of data reporting starts.
10. A data reporting device according to claim 9, characterized in that: The device also includes: A first determining unit is configured to determine the time when the indicator reporting confirmation information is received as the next reporting start time when there is no unreported indicator subset in the current data reporting round; or, The second determining unit is configured to determine, when indicator reporting confirmation information is received and there is no unreported indicator subset in the current data reporting round, a preset reporting time after the time when the indicator reporting confirmation information is received and closest to the time when the indicator reporting confirmation information is received as the next reporting start time; The unreported indicator subset is at least one subset of multiple indicator subsets corresponding to the current reporting round.
11. A data reporting device according to claim 8, characterized in that: The device comprises: An event monitoring unit is configured to monitor an indicator change event, wherein the indicator change event includes a change type and a change indicator; an indicator deletion unit, configured to delete the changed indicator from the current indicator set when the change type is to delete the indicator; The indicator adding unit is configured to add the changed indicator to the current indicator set when the change type is to add an indicator.
12. The data reporting device according to claim 8, characterized in that: The data packet generating unit comprises: A numerical mapping unit is configured to perform numerical mapping on the cumulative indicator value of the indicator to be reported at the target data reporting time to obtain an indicator mapping value of the indicator to be reported; the number of bytes occupied by the indicator mapping value of the indicator to be reported is less than the cumulative indicator value of the indicator to be reported at the target data reporting time; The data encapsulation unit is configured to perform data encapsulation based on the indicator mapping value of the indicator to be reported, and generate the indicator reporting data packet.
13. A data monitoring device, characterized in that: include: A data packet receiving unit is configured to execute receiving an indicator reporting data packet; the indicator reporting data packet is generated based on a target data reporting time and an indicator cumulative value of a reporting indicator at the target data reporting time, the indicator cumulative value being used to characterize an accumulated value of a numerical change of the reporting indicator from an initial time to the reporting time; when indicator reporting confirmation information is received, first determine whether the time at which the indicator reporting confirmation information is received is a preset reporting time point, if so, the target data reporting time point is the time at which the indicator reporting confirmation information is received; if not, a preset reporting time point after the time at which the indicator reporting confirmation information is received and closest to the time at which the indicator reporting confirmation information is received is used as the target data reporting time point; A data packet processing unit is configured to execute the indicator reporting data packet based on the indicator, obtain the indicator data of the reported indicator at the target data reporting time, and send indicator reporting confirmation information; The numerical estimation unit is configured to estimate the indicator cumulative value of the reported indicator at the intermediate moment based on the indicator cumulative value of the reported indicator at the historical data reporting moment and the indicator cumulative value of the reported indicator at the target data reporting moment; the intermediate moment between any historical data reporting moment and the target data reporting moment is determined based on the average value of any historical data reporting moment and the target data reporting moment.
14. A data monitoring device according to claim 13, characterized in that: The data packet processing unit comprises: A data packet decapsulation unit, configured to decapsulate the indicator reporting data packet to obtain an indicator mapping value of the reported indicator; The numerical inverse mapping unit is configured to perform numerical inverse mapping on the indicator mapping value to obtain the indicator cumulative value of the target data reporting indicator at the reporting time; the number of bytes occupied by the indicator mapping value of the reporting indicator is smaller than the indicator cumulative value of the reporting indicator at the target data reporting time.
15. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the data reporting method according to any one of claims 1 to 5, or the data monitoring method according to any one of claims 6 to 7.
16. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the data reporting method as described in any one of claims 1 to 5, or the data monitoring method as described in any one of claims 6-7.
17. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the data reporting method described in any one of claims 1 to 5, or the data monitoring method described in any one of claims 6-7 is implemented.
