Log reporting method and device, electronic equipment and storage medium
By using multi-dimensional environmental data scoring and predicted data point density, the log reporting process is dynamically adjusted, solving the resource waste problem caused by fixed reporting strategies and achieving intelligent and stable log reporting.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHENGZHOU APUS DIGITAL CLOUD INFORMATION TECH CO LTD
- Filing Date
- 2026-01-29
- Publication Date
- 2026-05-29
AI Technical Summary
In existing technologies, fixed log reporting strategies lead to resource waste, especially when network status, device resources, or data value change, log reporting cannot be effectively controlled, resulting in invalid traffic consumption and power consumption.
By acquiring multi-dimensional environmental data, including network quality, sufficient power, storage space, time constraints, and data value coefficient, a weighted score is applied to dynamically adjust the log reporting process. Furthermore, based on the predicted value of the data point density, the buffer pool capacity and terminal collaborative scheduling are adjusted to achieve intelligent log reporting.
The log reporting process is dynamically adjusted based on changes in network status, device resources, and data value to avoid resource waste, improve resource utilization, and ensure the stability and efficiency of the log reporting process.
Smart Images

Figure CN122120123A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Web front-end data acquisition and engineering technology, and in particular to a log reporting method, device, electronic device and storage medium. Background Technology
[0002] Currently, existing front-end event tracking technologies generally employ a fixed reporting strategy to report logs generated by event tracking. This means that regardless of changes in network status, device resources, or data value, reporting is mechanically executed according to preset rules. For example, reporting at a fixed frequency in non-WiFi environments results in invalid traffic consumption, low-power devices continuously reporting at fixed intervals exacerbates power consumption, and attempting to report even when storage space is nearing its limit occupies redundant resources.
[0003] Therefore, there is an urgent need for a new log reporting method to solve the problem of resource waste caused by the existing technology of using a fixed reporting strategy to report logs generated by embedded points. Summary of the Invention
[0004] The purpose of this invention is to provide a log reporting method, apparatus, electronic device, and storage medium to solve the resource waste problem existing in the prior art of reporting logs generated by embedded points using a fixed reporting strategy.
[0005] To solve the above-mentioned technical problems, the embodiments of the present invention are implemented as follows: In a first aspect, an embodiment of the present invention provides a log reporting method, which includes: acquiring log data to be reported and multidimensional environmental data corresponding to the log data to be reported; the multidimensional environmental data characterizes the quantitative state of multiple environmental factors affecting log reporting decisions; Based on multidimensional environmental data, the log data to be reported is scored to obtain multidimensional environmental factor scores. When the multi-dimensional environmental factor scores meet the log reporting conditions, the reporting process for the log data to be reported is triggered.
[0006] In one implementation, the multidimensional environmental data includes network quality coefficient, power adequacy coefficient, storage space coefficient, time urgency coefficient, and data value coefficient. Based on the multidimensional environmental data, the log data to be reported is scored to obtain a multidimensional environmental factor score, including: The network quality coefficient, power adequacy coefficient, storage space coefficient, time urgency coefficient, and data value coefficient are weighted to obtain a multi-dimensional environmental factor score.
[0007] In one implementation, the log data to be reported and the corresponding multidimensional environmental data are obtained, including: The network quality coefficient is determined by the effective connection type and downlink bandwidth of the reporting network for the log data to be reported; Based on the battery percentage index obtained from the data reporting terminal of the log data to be reported, the battery adequacy coefficient is determined by non-linear S-curve mapping. Based on the storage space utilization rate obtained from the data reporting terminal of the log data to be reported, a piecewise function is used to determine the power adequacy coefficient; Based on the interval between the log data to be reported and the last reporting time, an exponential function is used to determine the time urgency coefficient. The data value coefficient is determined by a weighted method based on the priority and volume of the log data to be reported.
[0008] In one implementation, the log reporting method also includes: Acquire user event tracking data, including trigger frequency, time distribution, and event type distribution. User event tracking is used to capture user behavior events, which are then used to generate log data to be reported. The trigger frequency data, time distribution data, and event type distribution data are input into the target prediction model to obtain the predicted value of the embedding density; the target prediction model is a lightweight time series analysis model. Based on the predicted value of the data point density, determine the reporting type of the log data to be reported; Adjust the buffer pool capacity corresponding to the log data to be reported based on the reporting type of the log data to be reported.
[0009] In one implementation, the reporting type of the log data to be reported is determined based on the predicted value of the data collection point density, including: When the predicted density of data points exceeds the first density threshold, the reporting type of the log data to be reported is determined to be peak period. When the predicted density value of the data points is less than the second density threshold, the reporting type of the log data to be reported is determined to be a low period; the second density threshold is less than or equal to the first density threshold. When it is detected that the user's dwell time on the page corresponding to the log data to be reported exceeds the dwell time threshold and there is no triggered operation on the user's tracking points, the reporting type of the log data to be reported is determined to be the emergency reporting type.
[0010] In one implementation, the log reporting method also includes: When multiple reporting terminals are detected to be reporting log data, a comprehensive capability score is calculated for each reporting terminal. When the CPU utilization of the primary reporting node exceeds the utilization threshold or network congestion occurs, the first priority data of the primary reporting node will be transferred to the secondary reporting node. In this system, the reporting terminal with the highest comprehensive capability score is designated as the primary reporting node, and at least one remaining reporting terminal among multiple reporting terminals is designated as a secondary reporting node. The primary reporting node is used to report the first priority data in the log data to be reported. The secondary reporting node is used to report the second priority data in the log data to be reported. The priority of the first priority data is higher than that of the second priority data. The reporting time of the secondary reporting node for the second priority data is longer than that of the primary reporting node for the first priority data.
[0011] In one implementation, the log reporting method further includes: obtaining event semantic tags and event chain identifiers from the log data to be reported; the log data to be reported is generated from user behavior events based on pre-built log objects, and the pre-built log objects include event semantic tags and event chain identifiers; Based on the event semantic tags and event chain identifiers, determine whether there are related events in the buffer pool; When a related event is identified, the log data to be reported is merged with the log data of the related event in the buffer pool to generate new log data to be reported.
[0012] Secondly, embodiments of the present invention provide a log reporting device, the log reporting device comprising: The first acquisition module is used to acquire the log data to be reported, as well as the multidimensional environmental data corresponding to the log data to be reported; the multidimensional environmental data represents the quantitative status of multiple environmental factors that affect the log reporting decision. The first processing module is used to score the log data to be reported based on multi-dimensional environmental data to obtain multi-dimensional environmental factor scores. The trigger module is used to trigger the reporting process of log data to be reported when the multi-dimensional environmental factor scores meet the log reporting conditions.
[0013] In one implementation, the multidimensional environmental data includes network quality coefficient, power adequacy coefficient, storage space coefficient, time urgency coefficient, and data value coefficient; the first processing module is also used for: The network quality coefficient, power adequacy coefficient, storage space coefficient, time urgency coefficient, and data value coefficient are weighted to obtain the multi-dimensional environmental factor score.
[0014] In one implementation, the first acquisition module is further used for: The network quality coefficient is determined by the effective connection type and downlink bandwidth of the reporting network for the log data to be reported; Based on the battery percentage index obtained from the data reporting terminal of the log data to be reported, the battery adequacy coefficient is determined by non-linear S-curve mapping. Based on the storage space utilization rate obtained from the data reporting terminal of the log data to be reported, a piecewise function is used to determine the power adequacy coefficient; Based on the interval between the log data to be reported and the last reporting time, an exponential function is used to determine the time urgency coefficient. The data value coefficient is determined by a weighted method based on the priority and volume of the log data to be reported.
[0015] In one implementation, the log reporting device further includes: The second acquisition module is used to acquire user tracking point trigger frequency data, time distribution data, and event type distribution data; user tracking points are used to capture user behavior events, and user behavior events are used to generate log data to be reported. The second processing module is used to input trigger frequency data, time distribution data, and event type distribution data into the target prediction model to obtain the predicted value of the embedding density; the target prediction model is a lightweight time series analysis model. The third processing module is used to determine the reporting type of the log data to be reported based on the predicted value of the data collection point density. The adjustment module is used to adjust the buffer pool capacity corresponding to the log data to be reported based on the reporting type of the log data to be reported.
[0016] In one implementation, the third processing module is also used for: When the predicted density of data points exceeds the first density threshold, the reporting type of the log data to be reported is determined to be peak period. When the predicted density value of the data points is less than the second density threshold, the reporting type of the log data to be reported is determined to be a low period; the second density threshold is less than or equal to the first density threshold. When it is detected that the user's dwell time on the page corresponding to the log data to be reported exceeds the dwell time threshold and there is no triggered operation on the user's tracking points, the reporting type of the log data to be reported is determined to be the emergency reporting type.
[0017] In one implementation, the log reporting device further includes a fourth processing module, used for: When multiple reporting terminals are detected to be reporting log data, calculate the comprehensive capability score for each reporting terminal; When the CPU utilization of the primary reporting node exceeds the utilization threshold or network congestion occurs, the first priority data of the primary reporting node will be transferred to the secondary reporting node. The terminal with the highest comprehensive capability score is designated as the primary reporting node, and at least one of the remaining reporting terminals is designated as a secondary reporting node. The primary reporting node is used to report the first priority data in the log data to be reported, while the secondary reporting node is used to report the second priority data in the log data to be reported. The priority of the first priority data is higher than that of the second priority data. The reporting time of the secondary reporting node for the second priority data is longer than that of the primary reporting node for the first priority data.
[0018] In one implementation, the log reporting device further includes: The third acquisition module is used to obtain event semantic tags and event chain identifiers from the log data to be reported; the log data to be reported is generated based on pre-built log objects of user behavior events, and the pre-built log objects include event semantic tags and event chain identifiers; The fifth processing module is used to determine whether there are related events in the buffer pool based on the event semantic tags and event chain identifiers; The merging module is used to merge the log data to be reported with the log data of the related event in the buffer pool when it is determined that there is a related event, and generate new log data to be reported.
[0019] Thirdly, embodiments of the present invention provide a log reporting electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps of the log reporting method provided in the above embodiments.
[0020] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the log reporting method provided in the above embodiments.
[0021] The above-described at least one technical solution adopted in the embodiments of the present invention can achieve the following beneficial effects: The log reporting method provided in this invention includes acquiring log data to be reported and corresponding multidimensional environmental data; the multidimensional environmental data characterizes the quantitative state of multiple environmental factors affecting log reporting decisions; based on the multidimensional environmental data, the log data to be reported is scored to obtain a multidimensional environmental factor score; when the multidimensional environmental factor score meets the log reporting conditions, the reporting process for the log data to be reported is triggered. This method achieves intelligent determination of reporting timing by synchronously acquiring the log data to be reported and its associated multidimensional environmental data, and scoring the log data based on the quantitative state of environmental factors. When the multidimensional environmental factor score meets the log reporting conditions, the reporting process for the log data to be reported is automatically triggered, thereby realizing intelligent control of the log reporting process based on multidimensional environmental data. It can adaptively and dynamically adjust the log data reporting process according to changes in network status, device resources, and data value, avoiding ineffective consumption of network resources and device resources, improving resource utilization, and ensuring the stability of the log reporting process. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 A flowchart illustrating a log reporting method provided in an embodiment of the present invention. Figure 1 ; Figure 2 A flowchart illustrating a log reporting method provided in an embodiment of the present invention. Figure 2 ; Figure 3 A flowchart illustrating a log reporting method provided in an embodiment of the present invention. Figure 3 ; Figure 4 This invention provides a system architecture diagram of a log reporting monitoring system for executing a log reporting method, as shown in an embodiment of the invention. Figure 5 A flowchart illustrating a log reporting method provided in an embodiment of the present invention. Figure 4 ; Figure 6 A flowchart illustrating a log reporting method provided in an embodiment of the present invention. Figure 5 ; Figure 7 A flowchart illustrating a log reporting method provided in an embodiment of the present invention. Figure 6 ; Figure 8 This is a schematic diagram of the structure of a log reporting device provided in an embodiment of the present invention; Figure 9 This is a schematic diagram of the structure of a log reporting electronic device provided in an embodiment of the present invention. Detailed Implementation
[0024] To enable those skilled in the art to better understand the technical solutions of this invention, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this invention.
[0025] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0026] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of the invention described herein can be implemented in an order other than that illustrated or described herein.
[0027] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to limit this disclosure.
[0028] The technical solutions provided by the various embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0029] Example 1 To address the problem of resource waste in existing technologies, this invention provides a log reporting method.
[0030] Specifically, the implementation process of the log reporting method provided in this embodiment of the invention is as follows: Figure 1 As shown, it includes the following steps: Step S101: Obtain the log data to be reported, and the multidimensional environmental data corresponding to the log data to be reported; the multidimensional environmental data represents the quantitative status of multiple environmental factors that affect the log reporting decision.
[0031] Specifically, the web frontend intercepts user behavior events through the trackEvent function and uses a standardized log object to generate log data to be reported.
[0032] In one implementation, the multidimensional environmental data encompasses five environmental factors: network quality, device battery power, storage space, time urgency, and data value. Specifically, these include network quality coefficient, battery power adequacy coefficient, storage space coefficient, time urgency coefficient, and data value coefficient. The network quality coefficient N can be obtained by calling `getNetworkInfo`; the battery power adequacy coefficient B can be obtained by calling `getBatteryInfo`; the storage space coefficient M can be obtained by calling `getStorageInfo`; the time urgency coefficient is obtained based on the time elapsed between the log data to be reported and the previous log report; and the data value coefficient is obtained based on the event data included in the log data to be reported.
[0033] Step S102: Based on the multidimensional environmental data, score the log data to be reported to obtain multidimensional environmental factor scores.
[0034] Specifically, in this embodiment of the invention, the environmental factor weighted scoring formula (Formula 1) is used to score the log data to be reported.
[0035] (Formula 1) in, For multi-dimensional environmental factor scoring, For network quality coefficients, For network quality weights, This is the power adequacy factor. Weighting based on sufficient battery power. For storage space coefficient, For storage space weight, As for the time urgency factor, Due to time constraints, For data value coefficient, Weighting based on data value.
[0036] In one implementation, the log data to be reported and the corresponding multidimensional environmental data are obtained, including: The network quality coefficient is determined by the effective connection type and downlink bandwidth of the reporting network for the log data to be reported; Based on the battery percentage index obtained from the data reporting terminal of the log data to be reported, the battery adequacy coefficient is determined by non-linear S-curve mapping. Based on the storage space utilization rate obtained from the data reporting terminal of the log data to be reported, a piecewise function is used to determine the power adequacy coefficient; Based on the interval between the log data to be reported and the last reporting time, an exponential function is used to determine the time urgency coefficient. The data value coefficient is determined by a weighted method based on the priority and volume of the log data to be reported.
[0037] Specifically, the calculation methods for network quality coefficient, power adequacy coefficient, storage space coefficient, time urgency coefficient, and data value coefficient are as follows: (1) Network quality coefficient N: The effective connection type and downlink bandwidth are obtained through the Network Information API, and the network quality coefficient is calculated using the following formula 2.
[0038] (Formula 2) in, This is the network quality coefficient, with a value between 0 and 1. For downlink bandwidth, As type weights, WiFi has a weight of 1.0, 4G has a weight of 0.7, and 3G has a weight of 0.4.
[0039] (2) Power adequacy coefficient B: The power adequacy coefficient is calculated by nonlinear S-curve mapping of the following formula 3 to ensure rapid decay below 50% and gradual growth above 50%.
[0040] (Formula 3) Where B is the battery adequacy coefficient, with a value of 0-1, and battery% is... Battery Percentage metrics.
[0041] (3) Storage space coefficient M: determined by a piecewise function.
[0042] When the storage space utilization rate is less than 80%, ; When the storage space utilization rate is greater than or equal to 80% and less than 90%, ; When the storage space utilization rate is greater than or equal to 90% ; in, This is a metric for storage space utilization.
[0043] (4) Time urgency coefficient T: Calculated using the exponential function of the interval index from the last reporting time as shown in Formula 4 below.
[0044] (Formula 4) in, This is the time urgency factor, with a value between 0 and 1. The interval indicator is the time since the last report, and the threshold is a time threshold used to adjust the sensitivity of urgency.
[0045] (5) Data value coefficient V: The data value coefficient is determined by weighting the log data to be reported according to the priority and data volume, using the following formula 5.
[0046] (Formula 5) Where V is the data value coefficient, with a value ranging from 0 to 1. This represents the number of high-priority (P0) logs in the log data to be reported. The amount of data in the medium-priority (P1) logs to be reported. The amount of low-priority (P2) log data to be reported. This represents the total amount of log data to be reported.
[0047] In this embodiment of the invention, a feedback learning mechanism is established to record the success rate, time consumption, and number of retries for each report. A simplified reinforcement learning algorithm (a variant of Q-Learning) is used to progressively optimize the weight coefficients. .
[0048] Among them, network quality weight The weight optimization algorithm of Formula 6 is used for updating: (Formula 6) in, For the updated network quality weights, The network quality weights before the update. For learning rate, As a reward value, This is the average reward value reported historically.
[0049] Step S103: When it is determined that the multi-dimensional environmental factor scores meet the log reporting conditions, the reporting process of the log data to be reported is triggered.
[0050] Specifically, when the weighted score S of environmental factors exceeds the dynamic threshold The reporting process is triggered at any time. The initial value is 0.6, which can be adaptively adjusted based on the historical log reporting success rate. When the environmental factor weighted score S is less than the dynamic threshold... If the conditions for log reporting are met, the reporting process will be triggered.
[0051] The method provided in this invention synchronously acquires the log data to be reported and its associated multidimensional environmental data, and scores the log data based on the quantitative status of environmental factors to achieve intelligent determination of the reporting timing. When it is determined that the multidimensional environmental factor score meets the log reporting conditions, the reporting process for the log data to be reported is automatically triggered, thereby realizing intelligent control of the log reporting process based on multidimensional environmental data. It can adaptively and dynamically adjust the log data reporting process according to changes in network status, device resources, and data value, avoiding ineffective consumption of network resources and device resources, improving resource utilization, and ensuring the stability of the log reporting process.
[0052] Example 2 In existing log reporting methods, a static buffer pool with a fixed capacity is usually used to store log data. However, since the frequency of user event triggering changes dynamically, when the frequency of user event triggering is high, the static buffer pool with a fixed capacity will be limited by its capacity, which will affect the normal reporting of logs. When the frequency of user event triggering is low, the static buffer pool with a fixed capacity will have capacity redundancy, resulting in a waste of resources.
[0053] To address the issues of low resource utilization and poor stability of log reporting processes in existing technologies, this invention provides a log reporting method, such as... Figure 2 As shown, the method includes: Step S201: Obtain the trigger frequency data, time distribution data, and event type distribution data of user tracking points; user tracking points are used to capture user behavior events, and user behavior events are used to generate the log data to be reported.
[0054] Specifically, the number of events recorded within a specified time period is collected in real time as trigger frequency data, the distribution of events occurring within a set time period is collected as event distribution data, and the proportion of different business event types (such as clicks, submissions, errors, etc.) is collected as event type distribution data.
[0055] Step S202: Input the trigger frequency data, time distribution data, and event type distribution data into the target prediction model to obtain the predicted value of the embedding density; the target prediction model is a lightweight time series analysis model.
[0056] Specifically, an exponentially weighted moving average (EWMA) algorithm based on a sliding window is used as a lightweight time series analysis model. Trigger frequency data, time distribution data, and event type distribution data are input into the lightweight time series analysis model, and the number of event tracking points expected to be generated per unit time within the next 5-15 minutes is output as the predicted value of the tracking point density.
[0057] Step S203: Determine the reporting type of the log data to be reported based on the predicted value of the embedded point density.
[0058] Specifically, the reporting types include peak period reporting types, off-peak period reporting types, and emergency reporting types.
[0059] In one implementation, the reporting type of the log data to be reported is determined based on the predicted value of the data collection point density, including: When the predicted density of data points exceeds the first density threshold, the reporting type of the log data to be reported is determined to be peak period. When the predicted density value of the data points is less than the second density threshold, the reporting type of the log data to be reported is determined to be a low period; the second density threshold is less than or equal to the first density threshold. When it is detected that the user's dwell time on the page corresponding to the log data to be reported exceeds the dwell time threshold and there is no triggered operation on the user's tracking points, the reporting type of the log data to be reported is determined to be the emergency reporting type.
[0060] When it is detected that the user's dwell time on the page corresponding to the log data to be reported exceeds the dwell time threshold and there is no triggered operation on the user's tracking points, it can be determined that the user is about to leave. Therefore, this situation is identified as an emergency reporting type, which means that the log reporting process needs to be triggered immediately.
[0061] Step S204: Adjust the buffer pool capacity corresponding to the log data to be reported according to the reporting type of the log data to be reported.
[0062] Specifically, when the forecast is for a peak reporting period: expand the buffer pool to 200 entries and extend the reporting interval; when the forecast is for a low-peak period: shrink the buffer pool to 50 entries and shorten the reporting interval; when the forecast is for an emergency reporting period: trigger the reporting immediately.
[0063] In one implementation, the following steps are included before triggering the log reporting process: Obtain event semantic tags and event chain identifiers from the log data to be reported; the log data to be reported is generated from user behavior events based on pre-built log objects, which include event semantic tags and event chain identifiers.
[0064] Specifically, when generating log data to be reported based on user behavior events, a standardized log object is constructed using the trackEvent function based on user behavior events (such as clicks, submissions, errors, etc.). Core fields are extracted and populated: event type, timestamp, user ID, session ID, page information, event priority (P0 / P1 / P2), event semantic tag (marking the business process, such as "registration process" or "payment process"), and event chain identifier (eventChainId) (uniquely identifying the event sequence of the same business chain) to generate log data to be reported.
[0065] Based on the event semantic tags and event chain identifiers, determine whether there are related events in the buffer pool.
[0066] Specifically, the event semantic tags and event chain identifiers (eventChainId) are extracted from the log data to be reported, and the following association determination is performed: Related event definition: An event in the buffer pool that meets one of the following conditions is considered a "related event": (1) Association of the same event chain: The event chain identifier (eventChainId) is the same as the log data to be reported, and the time interval is <10 seconds (calculated based on the timestamp difference). (2) Recurring operation association: The event type is "click" and the element identifier (such as DOM hash value) is the same, and it occurs multiple times within 5 seconds.
[0067] When a related event is identified, the log data to be reported is merged with the log data of the related event in the buffer pool to generate new log data to be reported.
[0068] Specifically, if related events exist in the buffer pool, they are merged according to the following rules: Chain merging of the same event: Log data to be reported is merged with related events into an aggregated event, retaining the earliest trigger timestamp, overlaying event attributes (such as supplementing missing page information), and recording the total number of events and time series span; the data structure of the aggregated event is as follows: { "aggregated_event_id": "xxx", "event_chain": ["page_view", "button_click", "form_submit"], "event_count": 3, "time_span": 5200, "compressed_data": {...} } Repeated operation merging: Multiple repeated clicks are merged into a single event, recording the number of repetitions and the time interval between the first and last clicks. For multiple events at the same geographical location (similar GPS coordinates, error <50 meters), the geographic information fields are merged and reported.
[0069] The merged data replaces the original log data to be reported and the associated events in the buffer pool, and is used as the new log data to be reported.
[0070] The method provided in this invention, before triggering the log reporting process for the log data to be reported, inputs the acquired user tracking point trigger frequency data, time distribution data, and event type distribution data into the target prediction model to obtain the tracking point density prediction value and determine the reporting type of the log data to be reported. This allows for dynamic adjustment of the buffer pool capacity for different reporting types, improving resource utilization and ensuring the stability of the log reporting process. Simultaneously, by merging related events, redundant data transmission can be reduced, minimizing resource waste.
[0071] Example 3 Existing log reporting methods involve multiple reporting terminals for the log data to be reported. However, they lack a collaborative scheduling and load balancing mechanism for these multiple reporting terminals. For example, high-priority logs may be assigned to low-capacity reporting terminals, resulting in resource waste, impacting log reporting efficiency, and failing to guarantee the stability of the log reporting process.
[0072] To address the issues of low resource utilization and poor stability of log reporting processes in existing technologies, this invention provides a log reporting method, such as... Figure 3 As shown, the method includes: Step S301: When multiple reporting terminals are detected to be reporting log data, calculate the comprehensive capability score of each reporting terminal. Specifically, before triggering the reporting process for log data to be reported, it checks whether the log data to be reported includes multiple reporting terminals. When it is detected that the log data to be reported includes multiple reporting terminals, a comprehensive capability score is calculated for each reporting terminal.
[0073] In one implementation, the master-slave node election algorithm includes: The comprehensive capability score for each reporting terminal is calculated using the following formula 7; (Formula 7) in, To report the terminal's overall capability score, For network quality coefficients, This is the power adequacy factor. This represents the CPU idle rate.
[0074] Step S302: When the CPU utilization of the primary reporting node exceeds the utilization threshold or network congestion occurs, the first priority data of the primary reporting node is transferred to the secondary reporting node. Specifically, the reporting terminal with the highest comprehensive capability score is designated as the primary reporting node, and at least one remaining reporting terminal is designated as a secondary reporting node. The primary reporting node is used to report the first priority data in the log data to be reported. The secondary reporting node is used to report the second priority data in the log data to be reported. The priority of the first priority data is higher than that of the second priority data. The reporting time of the secondary reporting node for the second priority data is longer than that of the primary reporting node for the first priority data. Specifically, the primary reporting node is responsible for prioritizing the reporting of high-priority P0 data, monitoring its own load (when CPU utilization is >80% or network congestion occurs), and transferring some P1 data to the secondary reporting nodes. The secondary reporting nodes are responsible for reporting medium-priority P1 data and low-priority P2 data, and participate in the re-election process when the primary reporting node fails.
[0075] Specifically, the utilization threshold is 80%. The primary reporting node monitors its own load, and when its CPU utilization exceeds 80% or the network is congested, it transfers some priority data in P1 to the secondary reporting nodes. The secondary reporting nodes also delay reporting by 200-500ms when the primary reporting node reports, in order to avoid instantaneous pressure on the server.
[0076] The method provided in this embodiment of the invention checks whether multiple reporting terminals are included in the log reporting process before triggering the log reporting process for the log data to be reported. If multiple reporting terminals are included, the comprehensive capability score of each reporting terminal is calculated. The reporting terminal with the highest comprehensive capability score is designated as the primary reporting node, and at least one remaining reporting terminal is designated as a secondary reporting node. The primary reporting node is used to report the first priority data in the log data to be reported. The secondary reporting node is used to report the second priority data in the log data to be reported. The priority of the first priority data is higher than that of the second priority data. The reporting time of the secondary reporting node for the second priority data is longer than that of the primary reporting node for the first priority data. Furthermore, when the CPU utilization of the primary reporting node exceeds the utilization threshold or network congestion occurs, the first priority data of the primary reporting node is transferred to the secondary reporting node. Through the collaborative scheduling and load balancing mechanism of multiple reporting terminals, high-priority logs can be allocated to high-capacity reporting terminals, improving resource utilization and log reporting efficiency, and ensuring the stability of the log reporting process.
[0077] Example 4 The above describes the log reporting method provided by embodiments of the present invention. Based on the same idea, embodiments of the present invention also provide a log reporting monitoring system, such as... Figure 4 As shown.
[0078] The log reporting and monitoring system provided in this embodiment of the invention has a five-layer architecture, specifically including: (1) Data tracking SDK layer: serving as the entry point for data standardization This event tracking SDK layer mainly implements: intercepting user behavior events (clicks, submissions, errors, payments, etc.), uniformly extracting event type, timestamp, user ID, session ID, page information, and custom data; automatically marking event priorities based on business rules (P0 high priority, P1 medium priority, P2 low priority); and adding new event semantic tags: marking the business process to which the event belongs (such as "registration process", "payment process") and event correlation (such as "event chain ID").
[0079] (2) Data processing layer: to achieve efficient compression and intelligent buffering This data processing layer mainly implements: an adaptive compression strategy: no compression is performed when log data is <1KB, LZ-String algorithm is used for compression when log data is 1-10KB, and pako (zlib) algorithm is used for compression when log data is >10KB. Automatic rollback is possible when compression effect is poor; a dynamic buffering mechanism: instead of using a fixed-capacity buffer pool, the buffer pool capacity is dynamically adjusted based on user behavior patterns (range: 50-200 records); and intelligent event aggregation: event chains and semantic relationships are identified, and related events are merged and compressed.
[0080] (3) IndexedDB storage layer: a high-capacity persistent storage core The IndexedDB storage layer mainly implements the following: Database design: Creating the TrackingDB database, which contains four object repositories: logs (main log table), config (configuration table), statistics (statistics table), and decision_weights (decision weights table); Field and index optimization: The logs table contains core fields such as id, eventType (event type), timestamp (timestamp), priority (priority), uploadStatus (event semantic tag), and eventChainId (event chain identifier), and establishes single-field indexes for timestamp and composite indexes [uploadStatus, priority, timestamp]; A new decision_weights table is added: storing the weight coefficients and historical feedback data of the intelligent decision engine.
[0081] (4) Intelligent Decision Engine Layer: Multi-dimensional Adaptive Decision Making The strategies include: dynamic buffer pool capacity adjustment strategy based on behavior prediction, multi-dimensional environmental factor weighted scoring model, cross-device collaborative master-slave scheduling mechanism, intelligent aggregation algorithm based on event semantic association, intelligent identification and predictive processing strategy for abnormal scenarios, and adaptive retry and exponential backoff optimization strategy.
[0082] Specifically, the intelligent identification and predictive processing strategies for abnormal scenarios include: Intelligent classification of network anomalies: The anomaly type is determined by the number of consecutive failures, the failure interval, and the error type (timeout, network error, server error); it distinguishes between "brief fluctuations" (<3 failures, interval <30 seconds) and "long-term interruptions" (≥3 failures or interval >30 seconds). For brief fluctuations: the retry interval is extended (1 second → 2 seconds → 4 seconds), but storage is not downgraded; for long-term interruptions: it actively switches to offline mode, stops reporting attempts, and focuses on local storage.
[0083] Intelligent storage space prediction: Based on the current event generation rate (events / minute) and remaining storage space, Formula 8 is used to predict the future available storage time. Gradual cleanup is triggered in advance before the space is exhausted (e.g., if the prediction is that there are 2 hours of space remaining).
[0084] (Formula 8) Gradual cleanup strategy: Instead of trigger-based cleanup (one-time cleanup when usage rate > 95%), gradual cleanup is initiated in advance; cleanup priority: reported data → data from 7 days ago → P2 data → P1 data → P0 data; clean up 10-20% of the target data each time to avoid lag caused by one-time cleanup.
[0085] Adaptive retry and exponential backoff optimization strategies include: Intelligent retry decision: Select retry strategy based on the reason for failure: Network timeout: Retry once immediately, and then back off exponentially; Server error 5xx: Delay retry to avoid cascading failure; Client (reporting terminal) error 4xx: Do not retry, and mark it as an exception directly.
[0086] Optimized exponential backoff algorithm: base delay_base = 1 second; nth retry delay = delay_base × 2^n × (1 + random(-0.2, 0.2)); add ±20% random jitter to avoid multiple clients retrying at the same time; maximum retries 3 times, after failure, it is moved to the exception queue to wait for the next reporting cycle.
[0087] (5) Network transport layer: to achieve reliable batch transmission The network transport layer uses HTTP POST or navigator.sendBeacon API to implement a batch reporting mechanism, requiring only 10 batch requests for 1000 data points; when reporting fails, the above-mentioned optimized exponential backoff algorithm is used as a fault-tolerant retry strategy; data is packaged in JSON structure, including batch_id, timestamp, number of logs, compression status, and log array.
[0088] In the log reporting and monitoring system of this embodiment, communication between tabs is achieved through the BroadcastChannel API, combined with the localStorage distributed lock, which can avoid duplicate reporting; it can automatically detect the browser's IndexedDB support, and when it is not supported, it will downgrade to localStorage, and when the capacity is insufficient, it will further downgrade to the memory queue; and by listening to the beforeunload event, P0 data is reported immediately, and non-blocking reporting is achieved through navigator.sendBeacon.
[0089] Example 5 Based on the log reporting and monitoring system provided in the above embodiments, this invention also proposes a log reporting method, such as... Figure 5 , Figure 6 , Figure 7 As shown.
[0090] The log reporting method includes an initialization phase, a data collection and intelligent processing phase, an intelligent decision-making and reporting phase, and a storage management and predictive cleanup phase. The specific implementation process is as follows: (1) Initialization phase Step S511: Call the initDatabase function to create the IndexedDB database (DB_NAME=TrackingDB, DB_VERSION=2), create four object repositories: logs, config, statistics, and decision_weights, and establish preset indexes.
[0091] Step S512: Initialize the intelligent decision-making engine and load historical weight coefficients ( The system will collect feedback data and use the default weights (all 0.2) if it is the first time it is launched.
[0092] Step S513: Start the behavior prediction module and initialize the sliding window (window size = 15 minutes, sampling interval = 30 seconds).
[0093] Step S514: Start the intelligent scheduler (perform an environmental check and score calculation once per second).
[0094] (2) Data acquisition and intelligent processing stage Step S521: Intercept user behavior events using the trackEvent function, construct a standardized log object, and extract event semantic tags and eventChainId.
[0095] Step S522: Call the behavior prediction module, update the data point density statistics, determine whether it is in a peak / valley period, and dynamically adjust the buffer pool capacity.
[0096] Step S523: Call the event aggregation module to check whether the current event can be associated with and aggregated with events in the buffer pool: if they belong to the same event chain and the time interval is <10 seconds, they are merged into aggregated events; if they are repeated clicks (the same element within 5 seconds), they are deduplicated and merged.
[0097] Step S524: Call the compressData function to perform adaptive compression.
[0098] Step S525: Add the processed log data to the dynamic buffer pool. When the buffer pool capacity is met or a P0 event occurs, call the flushBuffer function to write the data asynchronously to IndexedDB in batches.
[0099] Step S526: Simultaneously update the total storage statistics in the config table and the data collection rate in the statistics table.
[0100] (3) Intelligent decision-making and reporting stage Step S531: The intelligent decision engine periodically (every second) performs environmental checks: calls getNetworkInfo to obtain the network quality coefficient N; calls getBatteryInfo to obtain the battery adequacy coefficient B; calls getStorageInfo to obtain the storage space coefficient M; calculates the time urgency coefficient T; and calculates the data value coefficient V based on the data to be reported.
[0101] Step S532: Calculate the overall reporting score .
[0102] Step S533: Determine whether the reported score S exceeds the dynamic threshold. (Initial value = 0.6): If Continue to wait; if This triggers the reporting process.
[0103] Step S534: Check if multiple clients (reporting terminals) are online: If there is only a single client, directly perform local reporting; if there are multiple clients, execute the master-slave scheduling algorithm and determine the range of log data to be reported based on the node role.
[0104] Step S535: Call the fetchPendingLogs function to query the log data to be reported using a composite index (filtered according to node role and priority, up to 500 records).
[0105] Step S536: Call the uploadLogs function to package and compress the data, and report it to the server via HTTP POST or sendBeacon.
[0106] Step S537: Record the reported results (success rate, time taken, number of retries) and update the feedback data in the decision_weights table.
[0107] Step S538: Call the weight optimization algorithm and adjust the weight coefficients based on the reported results. .
[0108] Step S539: If the report is successful, delete the corresponding log data and update the last report time; if it fails, execute the intelligent retry strategy according to the exception type.
[0109] (4) Storage Management and Predictive Cleanup Phase Step S541: Perform storage space prediction every minute, including: calculating the current event generation rate (average of the last 5 minutes); calculating the remaining storage space; predicting the future available duration = remaining space / (average event size × event generation rate).
[0110] Step S542: If the predicted available time is <4 hours, start a progressive cleanup: First round (available time <4 hours): clean up reported data; Second round (available time <2 hours): clean up data older than 7 days; Third round (available time <1 hour): clean up according to P2→P1→P0 priority.
[0111] Step S543: Clean up 10-20% of the target data each time to avoid lag caused by cleaning up all at once.
[0112] Step S544: Listen for the page unload event and trigger emergency reporting and data status protection.
[0113] The method provided in this invention, through a processing flow consisting of four stages—initialization, data acquisition and intelligent processing, intelligent decision-making and reporting, and storage management and predictive cleanup—achieves intelligent control of the log reporting process based on multi-dimensional environmental data. It can adaptively and dynamically adjust the log data reporting process according to changes in network status, device resources, and data value, avoiding ineffective consumption of network resources and device resources, improving resource utilization, and ensuring the stability of the log reporting process.
[0114] Example 6 The above describes the log reporting method provided by the embodiments of the present invention. Based on the same idea, the embodiments of the present invention also provide a log reporting device 600, such as... Figure 8 As shown.
[0115] The risk assessment apparatus includes: The first acquisition module 601 is used to acquire the log data to be reported, as well as the multidimensional environmental data corresponding to the log data to be reported; the multidimensional environmental data represents the quantitative status of multiple environmental factors that affect the log reporting decision. The first processing module 602 is used to score the log data to be reported based on multi-dimensional environmental data to obtain multi-dimensional environmental factor scores. Trigger module 603 is used to trigger the reporting process of log data to be reported when it is determined that the multi-dimensional environmental factor score meets the log reporting conditions.
[0116] In one implementation, the multidimensional environmental data includes network quality coefficient, power adequacy coefficient, storage space coefficient, time urgency coefficient, and data value coefficient; the first processing module 601 is further used for: The network quality coefficient, power adequacy coefficient, storage space coefficient, time urgency coefficient, and data value coefficient are weighted to obtain the multi-dimensional environmental factor score.
[0117] In one implementation, the first acquisition module 601 is further configured to: The network quality coefficient is determined by the effective connection type and downlink bandwidth of the reporting network for the log data to be reported; Based on the battery percentage index obtained from the data reporting terminal of the log data to be reported, the battery adequacy coefficient is determined by non-linear S-curve mapping. Based on the storage space utilization rate obtained from the data reporting terminal of the log data to be reported, a piecewise function is used to determine the power adequacy coefficient; Based on the interval between the log data to be reported and the last reporting time, an exponential function is used to determine the time urgency coefficient. The data value coefficient is determined by a weighted method based on the priority and volume of the log data to be reported.
[0118] In one implementation, the log reporting device 600 further includes: The second acquisition module 604 is used to acquire the trigger frequency data, time distribution data and event type distribution data of user tracking points; user tracking points are used to capture user behavior events, and user behavior events are used to generate log data to be reported. The second processing module 605 is used to input trigger frequency data, time distribution data and event type distribution data into the target prediction model to obtain the predicted value of the embedding density; the target prediction model is a lightweight time series analysis model. The third processing module 606 is used to determine the reporting type of the log data to be reported based on the predicted value of the embedding density. The adjustment module 607 is used to adjust the buffer pool capacity corresponding to the log data to be reported according to the reporting type of the log data to be reported.
[0119] In one implementation, the third processing module 606 is further configured to: When the predicted density of data points exceeds the first density threshold, the reporting type of the log data to be reported is determined to be peak period. When the predicted density value of the data points is less than the second density threshold, the reporting type of the log data to be reported is determined to be a low period; the second density threshold is less than or equal to the first density threshold. When it is detected that the user's dwell time on the page corresponding to the log data to be reported exceeds the dwell time threshold and there is no triggered operation on the user's tracking points, the reporting type of the log data to be reported is determined to be the emergency reporting type.
[0120] In one implementation, the log reporting device further includes a fourth processing module 608, used for: When multiple reporting terminals are detected to be reporting the log data to be reported, a comprehensive capability score is calculated for each reporting terminal. The reporting terminal with the highest comprehensive capability score is designated as the primary reporting node, and at least one of the remaining reporting terminals is designated as a secondary reporting node. The primary reporting node is used to report the first priority data in the log data to be reported. The secondary reporting node is used to report the second priority data in the log data to be reported. The priority of the first priority data is higher than that of the second priority data. The reporting time of the secondary reporting node for the second priority data is longer than that of the primary reporting node for the first priority data. When the CPU utilization of the primary reporting node exceeds the utilization threshold or when network congestion occurs, the first priority data of the primary reporting node will be transferred to the secondary reporting node.
[0121] In one implementation, the log reporting device 600 further includes: The third acquisition module 609 is used to acquire event semantic tags and event chain identifiers from the log data to be reported; the log data to be reported is generated based on a pre-built log object of user behavior events, and the pre-built log object includes event semantic tags and event chain identifiers; The fifth processing module 610 is used to determine whether there are related events in the buffer pool based on the event semantic tags and event chain identifiers; The merging module 612 is used to merge the log data to be reported with the log data of the related event in the buffer pool when it is determined that there is a related event, and generate new log data to be reported.
[0122] Example 7 Figure 9 The schematic diagram illustrates the hardware structure of an electronic device according to various embodiments of the present invention. The electronic device includes a processor 701 and a memory 702 storing computer program instructions. Specifically, the processor 701 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.
[0123] Memory 702 may include mass storage for data or instructions. For example, and not limitingly, memory 702 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 702 may include removable or non-removable (or fixed) media. Where appropriate, memory 702 may be internal or external to an electronic device. In a particular embodiment, memory 702 may be a non-volatile solid-state memory.
[0124] In one embodiment, memory 702 may be read-only memory (ROM). In one embodiment, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.
[0125] The processor 701 implements any of the log reporting methods in the above embodiments by reading and executing computer program instructions stored in the memory 702.
[0126] In one example, the electronic device may also include a communication interface 703 and a bus 710. For example, Figure 9 As shown, the processor 701, memory 702, and communication interface 703 are connected through bus 710 and complete communication with each other.
[0127] The communication interface 703 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of the present invention.
[0128] Bus 710 includes hardware, software, or both, that couples components of an electronic device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 710 may include one or more buses. While specific buses are described and illustrated in embodiments of the invention, the invention contemplates any suitable bus or interconnect.
[0129] Furthermore, in conjunction with the log reporting methods in the above embodiments, this invention can be implemented using a computer-readable storage medium. This computer-readable storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the log reporting methods in the above embodiments.
[0130] It should be clarified that the present invention is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of the present invention.
[0131] The above description is merely a specific implementation of the present invention. Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0132] Secondly, those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0133] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0134] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0135] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0136] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0137] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0138] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0139] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0140] The above description is merely an embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the present invention should be included within the scope of the claims of the present invention.
Claims
1. A log reporting method, characterized in that, The method includes: Obtain the log data to be reported, and the multidimensional environmental data corresponding to the log data to be reported; the multidimensional environmental data represents the quantitative status of multiple environmental factors that affect the log reporting decision; Based on the multidimensional environmental data, the log data to be reported is scored to obtain a multidimensional environmental factor score. When the multi-dimensional environmental factor score is determined to meet the log reporting conditions, the reporting process for the log data to be reported is triggered.
2. The method according to claim 1, characterized in that, The multidimensional environmental data includes network quality coefficient, power adequacy coefficient, storage space coefficient, time urgency coefficient, and data value coefficient; the process of scoring the log data to be reported based on the multidimensional environmental data yields a multidimensional environmental factor score, including: The network quality coefficient, the power adequacy coefficient, the storage space coefficient, the time urgency coefficient, and the data value coefficient are weighted to obtain the multi-dimensional environmental factor score.
3. The method according to claim 2, characterized in that, The acquisition of the log data to be reported, and the multi-dimensional environmental data corresponding to the log data to be reported, includes: The network quality coefficient is determined by the effective connection type and downlink bandwidth of the network reporting the log data to be reported; Based on the battery percentage index obtained from the data reporting terminal of the log data to be reported, the battery adequacy coefficient is determined by nonlinear S-curve mapping. Based on the storage space utilization rate index obtained from the data reporting terminal of the log data to be reported, the power adequacy coefficient is determined by a piecewise function; Based on the interval between the log data to be reported and the last reporting time, the time urgency coefficient is determined using an exponential function; The data value coefficient is determined by a weighted method based on the priority and volume of the log data to be reported.
4. The method according to claim 1, characterized in that, The method further includes: Acquire user tracking point trigger frequency data, time distribution data, and event type distribution data; the user tracking points are used to capture user behavior events, and the user behavior events are used to generate the log data to be reported. The trigger frequency data, the time distribution data, and the event type distribution data are input into the target prediction model to obtain the predicted value of the embedding density; the target prediction model is a lightweight time series analysis model. Based on the predicted data point density, determine the reporting type of the log data to be reported; Adjust the buffer pool capacity corresponding to the log data to be reported according to the reporting type of the log data to be reported.
5. The method according to claim 4, characterized in that, The step of determining the reporting type of the log data to be reported based on the predicted data density includes: When the predicted value of the data point density is greater than the first density threshold, the reporting type of the log data to be reported is determined to be peak period; When the predicted density value of the data points is less than the second density threshold, the reporting type of the log data to be reported is determined to be a low period; the second density threshold is less than or equal to the first density threshold. When it is detected that the user's dwell time on the page corresponding to the log data to be reported is greater than the dwell time threshold and there is no triggered operation on the user's tracking point, the reporting type of the log data to be reported is determined to be an emergency reporting type.
6. The method according to claim 1, characterized in that, The method further includes: When multiple reporting terminals are detected to be reporting the log data to be reported, a comprehensive capability score is calculated for each reporting terminal. When the CPU utilization of the primary reporting node exceeds the utilization threshold or when network congestion occurs, the first priority data of the primary reporting node is transferred to the secondary reporting node. In this configuration, the reporting terminal with the highest comprehensive capability score is designated as the primary reporting node, and at least one of the remaining reporting terminals among the plurality of reporting terminals is designated as a secondary reporting node. The primary reporting node is used to report first-priority data from the log data to be reported. The secondary reporting node is used to report second-priority data from the log data to be reported. The priority of the first-priority data is higher than the priority of the second-priority data. The reporting time of the secondary reporting node for the second-priority data is longer than the reporting time of the primary reporting node for the first-priority data.
7. The method according to claim 4, characterized in that, The method further includes: Obtain event semantic tags and event chain identifiers from the log data to be reported; the log data to be reported is generated based on a pre-built log object of the user behavior event, and the pre-built log object includes the event semantic tags and the event chain identifiers; Based on the event semantic tag and the event chain identifier, determine whether there are related events in the buffer pool; When a related event is identified, the log data to be reported is merged with the log data of the related event in the buffer pool to generate new log data to be reported.
8. A log reporting device, characterized in that, The device includes: The first acquisition module is used to acquire log data to be reported, and multidimensional environmental data corresponding to the log data to be reported; the multidimensional environmental data represents the quantitative status of multiple environmental factors that affect the log reporting decision. The first processing module is used to score the log data to be reported based on the multidimensional environmental data to obtain a multidimensional environmental factor score. The triggering module is used to trigger the reporting process of the log data to be reported when it is determined that the multi-dimensional environmental factor score meets the log reporting conditions.
9. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the log reporting method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the log reporting method as described in any one of claims 1 to 7.