CN114385478B - Data acquisition reporting method and device, electronic equipment and storage medium - Google Patents

Data acquisition reporting method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114385478B
CN114385478B CN202011138094.0A CN202011138094A CN114385478B CN 114385478 B CN114385478 B CN 114385478B CN 202011138094 A CN202011138094 A CN 202011138094A CN 114385478 B CN114385478 B CN 114385478B
Authority
CN
China
Prior art keywords
data
reporting
event
target
reported
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011138094.0A
Other languages
Chinese (zh)
Other versions
CN114385478A (en
Inventor
张洪晖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202011138094.0A priority Critical patent/CN114385478B/en
Publication of CN114385478A publication Critical patent/CN114385478A/en
Application granted granted Critical
Publication of CN114385478B publication Critical patent/CN114385478B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The embodiment of the application discloses a data acquisition and reporting method, a device, electronic equipment and a storage medium; registering a preset user interaction event of a subroutine based on an event reporting program in a preset event reporting program set when a subroutine of a host program is started, and collecting target event related data of the target user interaction event based on the subroutine when the target user interaction event in the preset user interaction event is triggered; acquiring acquisition parameters of the target event associated data, determining the target event associated data as data to be reported when the acquisition parameters are matched with reference acquisition parameters, and reporting the data to be reported based on the reference reporting parameters corresponding to the subprogram; by adopting the scheme of the embodiment of the application, the data acquisition can be carried out on the event of the subprogram without manually burying the point in the subprogram, thereby reducing the requirement of the data acquisition reporting work of the subprogram on human resources and being beneficial to improving the data reporting efficiency of the subprogram.

Description

Data acquisition reporting method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a data acquisition reporting method, a data acquisition reporting device, an electronic device, and a storage medium.
Background
At present, the big data industry rapidly develops, a large amount of business data can be generated in the use process of application programs, and a large amount of information can be collected by collecting and reporting the data, so that the method is the basis of scientific data analysis.
In the related art, in order to realize data collection of an application program such as an applet, an engineering injection scheme is generally adopted, in the compiling process of the applet, codes for collecting data are manually injected into the applet, and the injected codes are used for realizing data collection in the running process of the applet.
The scheme relies on manual modification of codes, so that more human resources are needed, and the original codes of the applet are invaded.
Disclosure of Invention
The embodiment of the application provides a data acquisition reporting method, a device, electronic equipment and a storage medium, which can realize data acquisition of a subprogram in a host program without manual point burying and can also reduce code invasion of the subprogram.
The embodiment of the application provides a data acquisition reporting method, which is suitable for a subprogram of a host program and comprises the following steps:
When the subprogram is started, registering a preset user interaction event of the subprogram based on an event reporting program in a preset event reporting program set, wherein the preset user interaction event comprises an event triggered by interaction between a user and the subprogram;
when a target user interaction event in the preset user interaction event is triggered, acquiring target event association data of the target user interaction event based on the subprogram, wherein the target event association data is associated with the target user interaction event;
Acquiring acquisition parameters of the target event associated data;
when the acquisition parameters are matched with the reference acquisition parameters, determining the target event associated data as data to be reported;
and reporting the data to be reported based on the reference reporting parameters corresponding to the subprogram.
Correspondingly, the embodiment of the application also provides a data acquisition and reporting device, which comprises:
The registration unit is used for registering the preset user interaction event of the subprogram based on the event reporting program in the preset event reporting program set when the subprogram is started;
the acquisition unit is used for acquiring target event related data of the target user interaction event based on the subprogram when the target user interaction event in the preset user interaction event is triggered;
the acquisition unit acquires acquisition parameters of the target event associated data;
the matching unit is used for determining the target event associated data as data to be reported when the acquisition parameters are matched with the reference acquisition parameters;
and the reporting unit is used for reporting the data to be reported based on the reference reporting parameters corresponding to the subprogram.
In an alternative example, the registration unit is configured to:
when the subprogram is started, determining an application program interface corresponding to each preset user interaction event in the subprogram;
Determining an event reporting program corresponding to the application program interface from the preset event reporting program set, and adding the corresponding event reporting program for the application program interface in the subprogram;
when any application page of the subprogram is started, determining a target component corresponding to each preset user interaction event in the application page;
And determining an event reporting program corresponding to the target component from the preset event reporting program set, and adding the corresponding event reporting program for the target component of the application page in the subprogram.
In an alternative example, the acquisition unit is configured to:
When the target user interaction event in the preset user interaction event is triggered, acquiring target event association data of the target user interaction event based on the subprogram, wherein the method comprises the following steps:
When a target user interaction event in the preset user interaction event is triggered, collecting application program interface interaction data of the subprogram from the subprogram;
And collecting associated application page data associated with the target user interaction event from the application page data of the subprogram;
And determining the associated application page data and the application program interface interaction data as target event associated data.
In an alternative example, the reference acquisition parameters include a first reference acquisition time interval and a reference acquisition sub-parameter; the acquisition parameters comprise a first acquisition time interval and acquisition sub-parameters; a matching unit for:
If the first acquisition time interval of the target event associated data is higher than the first reference acquisition time interval, matching the reference acquisition sub-parameters with the acquisition sub-parameters of the target event associated data;
And if the reference acquisition sub-parameter is matched with the acquisition sub-parameter of the target event associated data, determining the target event associated data as data to be reported.
In an alternative example, the reference acquisition sub-parameters include: the second reference acquisition time interval, the reference data amount, the reference no-acquisition time length and the reference subroutine state parameters;
The acquisition sub-parameters comprise a second acquisition time interval, a data volume, an acquisition-free time length and a subroutine state parameter, wherein the acquisition-free time length represents the accumulated time length when no new event related data is acquired for the target user interaction event from the acquisition time of the target event related data;
a matching unit for:
And if the second acquisition time interval of the target event associated data is larger than the second reference acquisition time interval, or if the data volume of the target event associated data is larger than the reference data volume, or if the non-acquisition time period of the target event associated data is longer than the reference non-acquisition time period, or if the subroutine state parameter of the target event associated data is the same as the reference subroutine state parameter, determining the target event associated data as data to be reported.
In an optional example, the reference reporting parameters include a cache data screening parameter and a data reporting control parameter;
Reporting unit, for:
Obtaining the report state information of the buffer data of the data buffer area of the subprogram, wherein the data buffer area is used for buffering the data to be reported;
determining target data to be reported cached in the data cache area based on the cached data reporting state information and the cached data screening parameter;
The data to be reported corresponding to the target user interaction event is used as target data to be reported and is cached in the data caching area;
And reporting the target data to be reported in the data buffer area based on the data reporting control parameters.
In an optional example, the buffer data reporting status information includes a reporting number, and the buffer data filtering parameter includes a reporting number threshold;
Reporting unit, for:
and if the reporting times of the data to be reported, which is cached in the data cache area, are lower than the reporting times threshold, determining that the data to be reported is target reporting data.
In an alternative example, the apparatus further comprises: the reporting judging unit is used for detecting whether unreported data to be reported are stored in the data cache area before the reporting unit acquires the reporting state information of the cache data of the data cache area of the subprogram;
If yes, the reporting unit is controlled to continuously execute the step of acquiring the reporting state information of the cache data of the data cache area of the subprogram;
if not, controlling the reporting unit to execute the step of caching the data to be reported corresponding to the target user interaction event into the data caching area as the target data to be reported.
In an alternative example, the reporting unit is configured to:
converting the data format of the target data to be reported in the data cache area into the same preset data format;
splicing the target data to be reported based on the preset data format to obtain spliced reporting data;
and reporting the spliced reporting data based on the data reporting control parameters.
In an alternative example, the apparatus further comprises: the page data acquisition unit and the page data caching unit;
The page data acquisition unit is used for acquiring application page display data of an application page displayed by the subroutine when the target user interaction event is triggered in the preset user interaction event;
And the page data caching unit is used for caching the application page display data serving as target data to be reported in the data caching area before the reporting unit reports the target data to be reported in the data caching area based on the data reporting control parameter.
In an alternative example, the apparatus further comprises a feedback adjustment unit for:
determining the data reporting quality information of the subprogram based on the reporting condition of the data to be reported in the historical data statistics period;
and adjusting the reference acquisition parameters and the reference reporting parameters based on the preset data reporting quality index of the subprogram and the data reporting quality information.
In an optional example, the data reporting quality information includes: at least one of reporting data comprehensive indication information, reporting data buffer occupation indication information, reporting data frequency indication information and reporting data memory occupation indication information;
A feedback adjustment unit for:
acquiring the reporting data quantity of the data to be reported in the historical data statistics period, and determining the reporting data comprehensive indication information based on the reporting data quantity and the reference reporting data quantity;
Acquiring the buffer occupancy condition in the data buffer area between two adjacent reporting moments of the data to be reported in the historical data statistics period, and determining the reporting data buffer occupancy indication information based on the buffer occupancy condition;
Acquiring reporting frequency of data to be reported in the historical data statistics period, and determining reporting data frequency indication information based on the reporting frequency and a reference reporting frequency;
And acquiring the memory occupation condition of successfully reported data in the data to be reported in the historical data statistics period in the reporting data processing device corresponding to the data to be reported, and determining the memory occupation indication information of the reporting data based on the memory occupation condition.
Correspondingly, the embodiment of the application also provides electronic equipment, which comprises a memory and a processor; the memory stores an application program, and the processor is configured to run the application program in the memory, so as to execute any operation in the data acquisition reporting method provided by the embodiment of the application.
In addition, the embodiment of the application also provides a storage medium, wherein the storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in any data acquisition reporting method provided by the embodiment of the application.
By adopting the scheme of the embodiment of the application, when the subprogram of the host program is started, the preset user interaction event of the subprogram can be registered based on the event reporting program in the preset event reporting program set, the preset user interaction event comprises an event triggered by the interaction of a user with the subprogram, when the target user interaction event in the preset user interaction event is triggered, the target event associated data of the target user interaction event is acquired based on the subprogram, the target event associated data is associated with the target user interaction event, the acquisition parameters of the target event associated data are acquired, and when the acquisition parameters are matched with the reference acquisition parameters, the target event associated data are determined as data to be reported, and the data to be reported is reported based on the reference reporting parameters corresponding to the subprogram; because the embodiment of the application automatically registers the preset user interaction event based on the preset event reporting program set after the subprogram is started, corresponding event related data can be automatically acquired every time the preset user interaction event is triggered, thereby realizing the purpose of data acquisition aiming at the event of the subprogram without manually burying points in the subprogram, reducing the requirement of the data acquisition reporting work of the subprogram on human resources, and being beneficial to reducing the invasion of the original code of the subprogram compared with the scheme of manually modifying the original code of the subprogram in the related art.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic view of a scenario of a data acquisition reporting method provided by an embodiment of the present application;
FIG. 2 is a flowchart of a data acquisition reporting method provided by an embodiment of the present application;
fig. 3 is a schematic diagram of a feedback mechanism in a data acquisition reporting method according to an embodiment of the present application;
FIG. 4 is another flowchart of a data acquisition reporting method provided by an embodiment of the present application;
FIG. 5 is a schematic diagram of an application page in a data acquisition and reporting method provided by an embodiment of the present application;
fig. 6 is a schematic structural diagram of a data acquisition reporting device according to an embodiment of the present application;
Fig. 7 is another schematic structural diagram of a data acquisition and reporting device according to an embodiment of the present application;
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to fall within the scope of the application.
The embodiment of the application provides a data acquisition reporting method, a data acquisition reporting device, electronic equipment and a storage medium. The data acquisition and reporting device can be integrated in electronic equipment, and the electronic equipment can be equipment such as a terminal.
For example, as shown in fig. 1, when a subroutine of a host program is started, an electronic device registers a preset user interaction event of the subroutine based on an event reporting program in a preset event reporting program set, when a target user interaction event in the preset user interaction event is triggered, acquires acquisition parameters of the target event associated data based on target event associated data of the target user interaction event acquired by the subroutine, and when the acquisition parameters are matched with reference acquisition parameters, determines the target event associated data as data to be reported, and reports the data to be reported based on the reference reporting parameters corresponding to the subroutine.
The following will describe in detail. The following description of the embodiments is not intended to limit the preferred embodiments.
The embodiment will be described from the perspective of a data acquisition and reporting device, which may be integrated in an electronic device, and the electronic device may be a device such as a terminal; the terminal may include a mobile phone, a wearable intelligent device, a tablet computer, a notebook computer, a personal computer (PC, personal Computer), and the like.
The data acquisition and reporting method of the present embodiment may be applied to a subroutine of a host program, as shown in fig. 2, and a specific flow of the data acquisition and reporting method may be as follows:
101. when a subroutine is started, registering a preset user interaction event of the subroutine based on an event reporting program in a preset event reporting program set.
In this embodiment, the preset user interaction event includes an event triggered by a user interaction with the subroutine, and the number and types of the preset user interaction events are not limited, in one example, the preset user interaction event may include all events triggered by a user interaction with the subroutine, or the preset user interaction event may include an event triggered by a user interaction with a specific interaction of the subroutine, where the specific interaction may be set according to a data acquisition requirement of the subroutine.
In one example, the specific interaction may be set according to the page setting to which the interaction belongs, for example, some (one or at least two) application pages of the subroutine are set as specific application pages, and the interaction of the user on the specific application pages is set as specific interaction, that is, the preset user interaction event is an event triggered by the interaction of the user on the specific application pages.
In this embodiment, the interaction between the user and the subroutine may be implemented based on the touch operation, gesture operation, or voice operation of the user on the terminal screen, which is not limited in this embodiment.
In this embodiment, the types of the host program and the subroutine are not limited, and for example, the host program may be an instant messaging client program.
In this embodiment, the step of "when the subroutine is started, registering the preset user interaction event of the subroutine based on the event reporting program in the preset event reporting program set" may include:
when the subprogram is started, determining an application program interface corresponding to each preset user interaction event in the subprogram;
Determining an event reporting program corresponding to an application program interface from a preset event reporting program set, and adding the corresponding event reporting program for the application program interface in a subprogram;
When any application page of the subprogram is started, determining a target component corresponding to each preset user interaction event in the application page;
and determining an event reporting program corresponding to the target component from a preset event reporting program set, and adding the corresponding event reporting program for the target component of the application page in the subprogram.
The event reporting program is used for reporting the preset user interaction event message when the preset user interaction event is triggered. A target component refers to a function or collection of functions that implement an interaction when a user interacts with the subroutine.
In this embodiment, the event reporting program added to the application program interface and the target component of the application page may be the same section of program, or in another example, the event reporting program added to the target component of the application program interface and the target component of the application page may be different, and the event reporting program may be set according to the corresponding application program interface and the target component.
In one example, adding a corresponding event report program to the application program interface may specifically include: and adding an event reporting program for the function corresponding to the application program interface. Adding a corresponding event reporting program for a target component of an application page can specifically include: and adding a corresponding event reporting program for the function of the target component of the application page.
In one example, there may be multiple functions in a target component, and when a corresponding event report program is added to the target component, the event report program may be added to the first called function in the component only when the target component is called. For example, the target component consists of functions A, B, C, when the target component is called, function a is called first, then the event reporting program is added for function a only.
The preset user interaction event in this embodiment may include at least two types: application program interface interaction events and application page interaction events. Application program interface interaction events refer to events triggered by user interaction with the subroutine and transmitted through the application program interface, such as events when the user starts the subroutine, when the user closes the subroutine, or when the user clicks a control in an application page, and the like, the events are transmitted through the API interface. Application page interaction events refer to events triggered by user interaction with an application page of the subroutine, such as user clicks, drop-down refreshes, scrolling, closing, jumping, voice input, text input events, and so forth.
The application program interface is added with a corresponding event reporting program in the subprogram, and the event reporting program can be regarded as the registration of the interaction event of the application program interface in the subprogram; adding a corresponding event reporting program for the target component of the application page can be regarded as registering the application page interaction event in the subroutine.
It should be noted that, in this embodiment, when an event report program is added to an API, the event report program may be added to all APIs associated with each preset user interaction event at one time when the subroutine is started. When the event reporting program is added for the target component, the event reporting program is added for the target component associated with each preset user interaction event in the started application page when the application page is started. It can be understood that the above-mentioned "determining the target component corresponding to each preset user interaction event in the application page" is performed each time a new application page is started; determining an event report program corresponding to the target component from a preset event report program set, and adding a corresponding event report program for the target component of the application page in the subprogram.
102. And when the target user interaction event in the preset user interaction event is triggered, acquiring target event related data of the target user interaction event based on the subprogram.
It can be understood that, when the user interacts through the application page of the subroutine, not only the components of the application page will perform data processing, but also the API of the subroutine may perform data interaction, so the target event related data in this embodiment may include: application program interface interaction data corresponding to the application program interface interaction event, and associated page data corresponding to the application page interaction event.
The step 102 of collecting the target event related data may specifically include steps (1) - (3):
(1) And when the target user interaction event in the preset user interaction event is triggered, collecting application program interface interaction data of the subprogram from the subprogram.
The application program interface interaction data of the embodiment may include data interacted through an application program interface.
For example, specifically, when a user performs an interactive operation with the subroutine, it is detected that a target user interaction event is triggered, and application program interface interaction data of the subroutine is collected from the subroutine.
For example, when the user performs a clicking operation on the subroutine and detects that a target user interaction event, i.e. a clicking event, in the preset user interaction events is triggered, application program interface interaction data, such as login request information, parameter transfer information, and the like, of the subroutine are collected from the subroutine.
(2) And acquiring associated application page data associated with the target user interaction event from application page data of the subprogram.
The embodiment has no limitation on the sequence of collecting the interactive data of the application program interface and the related application page data.
The application page data is application page data of an application page of the subroutine, which is interacted with by a user.
For example, specifically, when a user performs an interactive operation with the subroutine, it is detected that a target user interaction event is triggered, and associated page data of the subroutine is collected from the subroutine.
For example, when the user performs text input operation on the current page of the subroutine and detects that a target user interaction event, i.e. a text input event, in the preset user interaction events is triggered, relevant page data of the subroutine, such as attribute values of the target user interaction event, page data modification information, and the like, are collected from application page data of the subroutine. The attribute value may include what operation the user triggers interaction with the subroutine in the target user interaction event, such as by a click operation, a double click operation, an information input operation, and so on.
(3) The associated application page data and the application program interface interaction data are determined to be target event associated data.
103. Acquiring acquisition parameters of the target event associated data.
The parameters in this embodiment refer to indicators describing a generalized measure of the overall characteristics, i.e., some characteristic value of the overall, and may be represented as numerical values, such as a duration value, a length value, and the like, and may also be represented as states, such as an off state, and the like. The acquisition parameters refer to indexes for carrying out overall feature description on the acquisition result of the target event associated data. The acquisition parameters may include a first acquisition time interval and an acquisition sub-parameter. The first acquisition time interval is as follows: the time interval between the time of acquisition of the target event related data and the time of acquisition of the last event related data of the target user interaction event. The acquisition sub-parameters may include a second acquisition time interval, an amount of data, an acquisition-free duration, a sub-program state parameter, and so forth.
The collection parameters may be set according to the actual application requirements, which will not be described herein.
For example, the acquisition parameters for acquiring the target event related data may specifically be a first acquisition time interval, a second acquisition time interval, a data amount, a no-acquisition duration, and/or a subroutine state parameter for acquiring the target event related data.
Wherein, the second acquisition time interval is: the time interval between the time of acquisition of the target event related data and the time of acquisition of the last event related data of the target user interaction event.
The no-acquisition duration represents the accumulated continuous duration that no new event related data is acquired for the target user interaction event from the acquisition time of the target event related data.
The subroutine state parameter may be a parameter indicating a state of the subroutine, for example, indicating that the subroutine is in an on state or an off state, etc.
The above data amount may be understood as a data size of the target event related data.
104. And when the acquisition parameters are matched with the reference acquisition parameters, determining the target event associated data as data to be reported.
The reference acquisition parameters in this embodiment refer to indexes for performing overall feature evaluation on the acquisition result of the target event related data. The reference acquisition parameter is reference information of an acquisition parameter for determining whether the target event related data can be determined as data to be reported. The reference acquisition parameters may include a first reference acquisition time interval and a reference acquisition sub-parameter. For example, the first reference acquisition time interval is a reference value of the first acquisition time interval, the reference acquisition sub-parameter is a reference value of the acquisition sub-parameter, and so on.
The reference acquisition parameters may be set according to the actual application requirements, which will not be described herein.
In one example, an acquisition data queue is provided in the memory area, and the target event associated data is stored in the acquisition data queue after the target event associated data is acquired.
Wherein, gather the data queue and be: and a storage section for storing the acquired data. The event association data of all user interaction events can jointly occupy one collected data queue. Generally, when a user opens a subroutine, the collected data queue is empty, or the collected data queue is empty after the data report is completed.
In the scheme of setting the collected data queue, the first collection time interval may be: the time interval between the collection time of the target event related data and the collection time of the first stored event related data in the event related data stored in the collection data queue currently. Wherein the first stored event association data is not limited to a target user interaction event.
Wherein, the second acquisition time interval may be: the time interval between the collection time of the target event related data and the collection time of the first stored event related data in the event related data stored in the collection data queue currently. That is, the definition of the first acquisition time interval and the second acquisition time interval may be the same.
The no-acquisition duration may represent an accumulated continuous duration during which no new event related data is acquired for the target user interaction event from the time of acquisition of the target event related data. Or the no-acquisition duration may represent an accumulated continuous duration from the time of acquisition of the target event-related data, where no new event-related data is stored in the acquisition data queue.
The subroutine state parameter may be a parameter indicating a state of the subroutine, for example, indicating that the subroutine is in an on state or an off state, etc.
The above data amount may be understood as a data size of the target event related data.
The step of determining the target event related data as data to be reported when the acquisition parameter matches with the reference acquisition parameter may specifically include:
And if the target event associated data is the target event associated data acquired for the first time after the acquired data queue is empty, determining the target event associated data as the data to be reported.
And if the target event associated data is not the target event associated data acquired for the first time after the acquired data queue is empty, determining the target event associated data as data to be reported when the acquired parameters are matched with the reference acquired parameters.
In this embodiment, the collected data queue may be set in a preset memory area, and when the collected parameters of the target event related data match with the reference collected parameters, all the event related data in the collected data queue may be transferred to a specific external storage device, such as a hard disk. In this embodiment, the external storage device may be a data cache area. The event-related data after transfer becomes data to be reported.
It will be appreciated that if the collected data queue is continuously storing data, but is not transferred to the external storage device for reporting, more and more memory space is occupied, and in order to ensure that the content space is sufficient, optionally, in one example, when the total memory occupation of the event-related data in the collected data queue is not less than the preset memory occupation threshold,
The step of determining the target event related data as data to be reported when the acquisition parameters are matched with the reference acquisition parameters can report all the event related data in the acquisition data queue without matching the acquisition parameters of the target event related data with the reference acquisition parameters.
The preset memory occupation threshold may be set to values of 10MB, 500MB, etc.
In one example, the step of determining the target event association data as data to be reported when the acquisition parameter matches the reference acquisition parameter may specifically include: if the first acquisition time interval of the target event associated data is higher than the first reference acquisition time interval, matching the reference acquisition sub-parameters with the acquisition sub-parameters of the target event associated data; and if the reference acquisition sub-parameters are matched with the acquisition sub-parameters of the target event associated data, determining the target event associated data as data to be reported.
Wherein the first reference acquisition time interval may be set to a value of e.g. 50ms, 55ms, 1 s.
The reference acquisition sub-parameters may include, among other things, a second reference acquisition time interval, a reference data amount, a reference no acquisition time period, a reference subroutine status parameter, and so forth.
The step of determining the target event related data as the data to be reported if the reference acquisition sub-parameter matches with the acquisition sub-parameter of the target event related data may include:
If the second acquisition time interval of the target event associated data is greater than the second reference acquisition time interval, or if the data volume of the target event associated data is greater than the reference data volume, or if the no-acquisition time period of the target event associated data is greater than the reference no-acquisition time period, or if the subroutine state parameter of the target event associated data is the same as the reference subroutine state parameter, determining the target event associated data as the data to be reported.
Wherein the reference subroutine status parameters may include: a subroutine shutdown state parameter or a subroutine application page shutdown parameter. The sub-program closing state parameter is used for indicating that the sub-program is in a closing state, and the sub-program application page closing parameter is used for indicating that the application page is in a closing state when the target user interaction event is triggered.
Therefore, when any acquisition parameter of the target event associated data is matched with the corresponding reference acquisition parameter, the electronic equipment can determine the target event associated data as data to be reported.
105. And reporting the data to be reported based on the reference reporting parameters corresponding to the subprogram.
The reference reporting parameter refers to an index for performing overall feature evaluation on reporting conditions of data to be reported. The reference reporting parameter is used for determining whether the data to be reported can be reported.
In one example, the reference reporting parameters may include a cached data screening parameter and a data reporting control parameter. The reference report parameter may be set according to the actual application requirement, which is not described herein.
In one example, step 105 may specifically include steps (1) - (4) as follows:
(1) And obtaining the report state information of the cache data of the data cache area of the subprogram.
The data buffer area refers to a buffer area for buffering data to be reported. The cache data reporting status information refers to information obtained based on a reporting status of data to be reported, and is used for determining whether the information to be reported can be used as target data to be reported. The buffered data reporting status information may include the number of reports, etc.
For reasons such as poor channel quality or equipment failure, the electronic device may not be able to report the data to be reported successfully once, and some data to be reported may be reported multiple times. The number of reporting in this embodiment refers to the number of times that the data to be reported that was not successfully reported has been reported.
It can be appreciated that the event-related data collected at different times can be cached in the data cache area, so that the reporting times of different data can be different.
(2) And determining target data to be reported, which is cached in the data cache area, based on the cached data reporting state information and the cached data screening parameter.
The cache data screening parameter is an index for judging whether the data to be reported can be used as target data to be reported. The buffered data screening parameter may include a reporting number threshold.
Optionally, the step of determining the target data to be reported buffered in the data buffering area based on the buffered data reporting status information and the buffered data screening parameter may include:
If the reporting times of the data to be reported, which is cached in the data cache area, are lower than the reporting times threshold, determining that the data to be reported is target reporting data.
The method of the embodiment can further comprise: and if the reporting times of the data to be reported, which is cached in the data cache area, are not lower than the reporting times threshold, determining that the data to be reported is non-reporting data. In one example, the non-reporting data may be deleted from the data cache region or stored into a particular exception reporting data storage space.
For example, if the reporting number threshold is set to 3, the data to be reported, of which the reporting number is lower than 3, in the data buffer area is determined to be the target reporting data, and the data to be reported, of which the reporting number is not lower than 3, is non-reporting data, and needs to be deleted from the data buffer area.
The present embodiment may further include: and determining the reporting failure condition of the data according to the non-reporting data in the abnormal reporting data storage space, and adjusting the reference acquisition parameters and the reference reporting parameters based on the reporting failure condition of the data.
(3) And caching the data to be reported corresponding to the target user interaction event into the data caching area as target data to be reported.
(4) And reporting the target data to be reported in the data cache area based on the data reporting control parameter.
The data reporting control parameter refers to an index for controlling the data to be reported of the reporting target. The data reporting control parameter may include a data reporting time interval, a data format of the reporting data, a splicing mode of the reporting data, and the like. The data reporting control parameter may be set according to the actual application requirement, which is not described herein.
The data reporting time interval is as follows: and a time interval between the reporting time of the target data to be reported and the reporting time of a group of target data to be reported in the data cache area.
The data format of the reported data is as follows: the format of the data to be reported by the target when the data to be reported by the target is reported can be a character string or other data formats which can be reported.
The splicing mode of the reported data is as follows: the method for splicing the target data to be reported before reporting the target data to be reported can be array splicing or other modes capable of realizing the data splicing effect.
In this embodiment, for the target data to be reported, in order to improve the reporting efficiency, the data to be reported may be processed into data with a format first, and then the data is reported after being fused.
Optionally, the step of reporting the target data to be reported in the data buffer area based on the data reporting control parameter may include:
based on the data reporting control parameter, converting the data format of the target data to be reported in the data buffer area into the same preset data format;
Splicing the target data to be reported based on the preset data format to obtain spliced reporting data;
and reporting the spliced reporting data based on the data reporting control parameters.
Before the target data to be reported is cached in the data caching area, the data caching area may be empty, or there may be cache data that is not successfully reported, and if the data in the data caching area is empty, the above-mentioned judgment about the target data to be reported in the data caching area may not be performed. Optionally, before the step of acquiring the status information of reporting the buffered data in the data buffer area of the subroutine, the method of the embodiment of the present application may further include:
Detecting whether unreported data to be reported are stored in the data cache area;
if yes, continuing to execute the step of acquiring the report state information of the cache data of the data cache area of the subprogram;
If not, executing the step of caching the data to be reported corresponding to the target user interaction event into the data caching area as the target data to be reported.
In order to improve the comprehensiveness of the collected data, when the target user interaction event in the preset user interaction event is triggered, the method of the embodiment may further include:
and acquiring application page display data of an application page displayed by the subroutine when the target user interaction event is triggered.
Correspondingly, before the step of reporting the target data to be reported in the data buffer area based on the data reporting control parameter, the method further includes:
And caching the display data of the application page serving as target data to be reported into a data caching area.
It should be noted that the application page data should at least include data related to the current page display, such as numbers of the page display after clicking, page prompt information after clicking, etc., so that the current page can be restored for analysis after reporting.
Before reporting the data to be reported, the application page data and the cached data in the data caching area can be spliced and then reported, or the data can be directly reported without splicing.
In order to save reporting resources, the step of "taking the application page display data as target data to be reported" may include:
Based on a preset data compression program, carrying out data compression on the application page display data to obtain compressed page display data; and taking the compressed page display data as target data to be reported.
The preset data compression program may be a plug-in program of the subroutine. In this embodiment, the manner of performing data compression on the application page display data is not limited.
Optionally, in order to implement personalized reporting of data security, the embodiment may adjust the reference acquisition parameter and the reference reporting parameter according to reporting conditions of data to be reported in a statistics period of historical data, and implement tuning of the reference acquisition parameter and the reference reporting parameter through a feedback adjustment mechanism, so as to be shown in fig. 3, the method of the embodiment may further include:
106. And determining the data reporting quality information of the subroutine based on the reporting condition of the data to be reported in the historical data statistics period.
The data reporting quality information in this embodiment refers to an evaluation index for reporting conditions of data to be reported in a statistical period of historical data. The data reporting quality information may include: the method comprises the steps of reporting data comprehensive indication information, reporting data buffer occupation indication information, reporting data frequency indication information and/or reporting data memory occupation indication information.
Wherein, the historical data statistics period is: the period of time for reporting the reported data to be reported can be set to be a value of 24 hours or 1 week. The statistics period of the historical data can be set according to the actual application requirement, and will not be described herein.
The data reporting quality information may be set according to the actual application requirement, which is not described herein.
The determining the data reporting quality information of the subroutine based on the reporting condition of the data to be reported in the historical data statistics period may include:
Acquiring reporting data quantity of data to be reported in a historical data statistics period, and determining comprehensive indication information of the reporting data based on the reporting data quantity and a reference reporting data quantity;
acquiring buffer occupancy conditions in a data buffer area in adjacent two reporting moments of data to be reported in a historical data statistics period, and determining reporting data buffer occupancy indication information based on the buffer occupancy conditions;
acquiring reporting frequency of data to be reported in a historical data statistics period, and determining reporting data frequency indication information based on the reporting frequency and a reference reporting frequency;
And acquiring the memory occupation condition of the data to be reported in the corresponding data memory area of the subprogram in the historical data statistics period, and determining the reporting data memory occupation indication information based on the memory occupation condition.
The reference reported data volume is the data volume generated in actual application or the expected data volume.
107. And adjusting the reference acquisition parameters and the reference reporting parameters based on the data reporting quality index of the subroutine and the data reporting quality information.
The data reporting quality index is a reference index of the data reporting quality information, and is used for determining whether the data reporting quality information of the data to be reported meets the requirement of reporting data quality in practical application.
For example, if the reporting data integrity indicator does not meet the data reporting quality indicator, the first reference acquisition time interval, the second reference acquisition time interval, and so on may be adjusted. If the reported data buffer occupancy indication information does not meet the data reporting quality index, the reference no-acquisition time length, the buffer data screening parameter and the like can be adjusted. If the reporting data frequency indication information does not conform to the data reporting quality index, the first reference acquisition time interval, the second reference acquisition time interval, the buffer data reporting status information, and the like can be adjusted. If the reported data memory usage indication information does not meet the data reporting quality index, the reference data amount, the first reference acquisition time interval, the second reference acquisition time interval, and so on can be adjusted.
The reference acquisition parameters and the reference reporting parameters of the subroutine can be adjusted according to the actual application requirements, and are not described herein.
As can be seen from the foregoing, in this embodiment, when a subroutine of a host program is started, a preset user interaction event of the subroutine is registered based on an event reporting program in a preset event reporting program set, where the preset user interaction event includes an event triggered by user interaction with the subroutine, and when a target user interaction event in the preset user interaction event is triggered, target event associated data of the target user interaction event is collected based on the subroutine, where the target event associated data is associated with the target user interaction event, an acquisition parameter of the target event associated data is obtained, and when the acquisition parameter is matched with a reference acquisition parameter, the target event associated data is determined as data to be reported, and the data to be reported is reported based on the reference reporting parameter corresponding to the subroutine; because all preset acquisition events are registered when the program runs, event data can be automatically acquired every time the preset acquisition events are triggered, and all data of an application page are acquired, the API method can be automatically acquired when the events are acquired, the developer self-defined method can be automatically acquired, the data acquisition can be carried out on the events of the subprogram without manually burying points in the subprogram, the requirement of the data acquisition reporting work of the subprogram on human resources is reduced, and the data reporting efficiency of the subprogram is improved.
Furthermore, in this embodiment, according to the reporting condition of the data to be reported according to the statistics period of the historical data, the reference acquisition parameters and the reference reporting parameters are adjusted, and the adjustment and optimization of the reference acquisition parameters and the reference reporting parameters are realized through the feedback adjustment mechanism, so that the data security personalized reporting is realized.
The method described in the previous examples is described in further detail below by way of example.
In this embodiment, the data acquisition and reporting device will be specifically integrated into an electronic device.
As shown in fig. 4, a specific flow of a data acquisition reporting method may be as follows:
401. when the subprogram is started, the electronic equipment registers the preset user interaction event of the subprogram based on an event reporting program in a preset event reporting program set.
The specific scheme for registering the preset user interaction event may refer to the related description in the foregoing content, which is not described herein again.
402. And when a target user interaction event in the preset user interaction events is triggered, the electronic equipment collects target event association data of the target user interaction event based on the subprogram.
For example, if the event triggered by the interaction between the user and the subroutine through the electronic device is a click event, the target user interaction event is a click event, then at this time, the electronic device may collect API interaction data related to the subroutine and the click event, and collect associated page data related to the current page of the subroutine and the click event. The electronic device takes the API interaction data and the associated page data as target event associated data.
403. And the electronic equipment acquires acquisition parameters of the target event associated data.
For example, the acquisition parameters of the electronic device for acquiring the target event related data may specifically include a first acquisition time interval, a second acquisition time interval, a data amount, a no-acquisition duration, and/or a subroutine status parameter of the electronic device for acquiring the target event related data.
404. And when the acquisition parameters are matched with the reference acquisition parameters, the electronic equipment determines the target event associated data as data to be reported.
For example, when the collection parameter is matched with the reference collection parameter, the electronic device determines the target event related data as data to be reported, and specifically, if a first collection time interval of the target event related data is higher than the first reference collection time interval, the reference collection sub-parameter is matched with the collection sub-parameter of the target event related data.
The reference acquisition sub-parameters may include, among other things, a second reference acquisition time interval, a reference data amount, a reference no acquisition time period, a reference subroutine status parameter, and so forth. The acquisition sub-parameters may include a second acquisition time interval, an amount of data, a no acquisition duration, a sub-program state parameter, and so forth.
And if the second acquisition time interval of the target event associated data is larger than the second reference acquisition time interval, or if the data volume of the target event associated data is larger than the reference data volume, or if the non-acquisition time period of the target event associated data is longer than the reference non-acquisition time period, or if the subroutine state parameter of the target event associated data is the same as the reference subroutine state parameter, determining the target event associated data as data to be reported.
405. And the electronic equipment reports the data to be reported based on the reference reporting parameters corresponding to the subprogram.
The reference reporting parameter refers to an index for performing overall feature evaluation on reporting conditions of data to be reported. The reference reporting parameter is used for determining whether the data to be reported can be reported. The reference acquisition parameters may include a buffered data screening parameter and a data reporting control parameter.
For example, the following may be specifically mentioned:
(1) And the electronic equipment acquires the buffer data reporting state information of the data buffer area of the subprogram.
The data buffer area refers to a buffer area for buffering data to be reported. The cache data reporting status information refers to information obtained based on a reporting status of data to be reported, and is used for determining whether the information to be reported can be used as target data to be reported. The buffered data reporting status information may include the number of reports, etc.
(2) And determining target data to be reported, which is cached in the data cache area, based on the cached data reporting state information and the cached data screening parameter.
The cache data screening parameter is an index for judging whether the data to be reported can be used as target data to be reported. The buffered data screening parameter may include a reporting number threshold.
For example, if the number of times of reporting the data to be reported, which is cached in the data cache area, is not lower than the threshold value of the number of times of reporting, it is determined that the data to be reported is non-reporting data.
If the reporting times of the data to be reported cached in the data cache area are lower than the threshold value of the reporting times, determining the data to be reported as target reporting data
(3) And caching the data to be reported corresponding to the target user interaction event into the data caching area as target data to be reported.
(4) And reporting the target data to be reported in the data cache area based on the data reporting control parameter.
The data reporting control parameter refers to an index for controlling the data to be reported of the reporting target. The data reporting control parameter may include a data reporting time interval, a data format of the reporting data, and the like.
For example, the electronic device converts the data format of the target data to be reported in the data buffer area into the same preset character string format. And splicing the target data to be reported in an array splicing mode based on the character string format to obtain spliced reporting data. And reporting the spliced reporting data based on the data reporting time interval.
Before the electronic device caches the target data to be reported in the data caching area, the data caching area may be empty, or there may be unreported cached data, and the cached data may be judged to be the target data to be reported. Namely, before the step of obtaining the status information of reporting the buffered data in the data buffer area of the subroutine, the embodiment of the present application may further include:
The electronic equipment detects whether unreported data to be reported are stored in the data buffer area. If yes, continuing to execute the step of obtaining the report state information of the cache data of the data cache area of the subroutine. If not, executing the step of caching the data to be reported corresponding to the target user interaction event into the data caching area as the target data to be reported.
In order to realize full data collection, when the target user interaction event in the preset user interaction event is triggered, the embodiment may further include:
406. The electronic device collects application page display data of an application page displayed by the subroutine when the target user interaction event is triggered. And caching the display data of the application page serving as target data to be reported into the data caching area.
For example, as shown in fig. 5, the current page of the electronic device is a coupon pickup page, and after the user clicks the coupon, the electronic device collects application program interface interaction data, and associates event interaction data with application page data. The application page data includes the number of coupons remaining clicked by the user, the time the coupons remain, the validity of the click event, the coupon's hint information, and so forth. And the electronic equipment takes the display data of the application page as target data to be reported and caches the target data into the data caching area.
Before reporting the data to be reported, the electronic device can splice the application page data with the cached data in the data caching area and report the data, or directly report the data without splicing.
In order to save reporting resources, the step of "taking the application page display data as target data to be reported" may include:
407. And reducing the data volume of the application page display data based on a preset data compression program so as to complete the compression of the application page display data in the subprogram and obtain the compressed page display data.
408. And determining the compressed page display data as data to be reported.
Optionally, in order to implement data security personalized reporting, the embodiment may adjust a reference acquisition parameter and a reference reporting parameter according to reporting conditions of data to be reported in a historical data statistics period, and implement adjustment and optimization of the reference acquisition parameter and the reference reporting parameter through a feedback adjustment mechanism, so the embodiment may further include:
409. And determining the data reporting quality information of the subroutine based on the reporting condition of the data to be reported in the historical data statistics period.
The data reporting quality information refers to an evaluation index of reporting conditions of data to be reported in a historical data statistics period. The data reporting quality information may include: reporting data comprehensive indication information, reporting data buffer occupation indication information, reporting data frequency indication information and or reporting data memory occupation indication information.
The reporting condition of the data to be reported based on the historical data statistics period determines the data reporting quality information of the subroutine, and the reporting condition comprises the following steps:
the electronic equipment acquires the reporting data quantity of the data to be reported in the historical data statistics period, and determines the comprehensive indication information of the reporting data based on the reporting data quantity and the reference reporting data quantity;
In the statistical period of the historical data obtained by the electronic equipment, the buffer occupancy condition in the data buffer area is determined in the adjacent two reporting moments of the data to be reported, and the reporting data buffer occupancy indication information is determined based on the buffer occupancy condition;
The electronic equipment acquires reporting frequency of data to be reported in a historical data statistics period, and determines reporting data frequency indication information based on the reporting frequency and a reference reporting frequency;
And the electronic equipment acquires the memory occupation condition of the data to be reported in the corresponding data memory area of the subprogram in the historical data statistics period, and determines the memory occupation indication information of the data to be reported based on the memory occupation condition.
410. And adjusting the reference acquisition parameters and the reference reporting parameters based on the data reporting quality index of the subroutine and the data reporting quality information.
For example, the electronic device obtains reporting data comprehensive indication information, reporting data buffer occupancy indication information and reporting data frequency indication information of the data to be reported in the historical data statistics period, matches the reporting data comprehensive indication information, the reporting data buffer occupancy indication information and the reporting data frequency indication information with the data reporting quality index of the subroutine, and adjusts the reference acquisition parameters and the reference reporting parameters of the subroutine when any matching is unsuccessful.
For example, if the reporting data integrity indicator does not meet the data reporting quality indicator, the first reference acquisition time interval, the second reference acquisition time interval, and so on may be adjusted. If the reported data buffer occupancy indication information does not meet the data reporting quality index, the reference no-acquisition time length, the buffer data screening parameter and the like can be adjusted. If the reporting data frequency indication information does not conform to the data reporting quality index, the first reference acquisition time interval, the second reference acquisition time interval, the buffer data reporting status information, and the like can be adjusted. If the reported data memory usage indication information does not meet the data reporting quality index, the reference data amount, the first reference acquisition time interval, the second reference acquisition time interval, and so on can be adjusted.
The reference acquisition parameters and the reference reporting parameters of the subroutine can be adjusted according to the requirements of practical applications, and are not described herein.
It can be known from the above that, by adopting the scheme of the embodiment, when the subroutine is started, the preset user interaction event of the subroutine is registered, and the target event related data of the target user interaction event can be automatically acquired every time the preset acquisition event is triggered, so that the API method and the developer self-defining method can be automatically acquired during the acquisition event, the event of the subroutine can be acquired without manually burying points in the subroutine, the requirement of the data acquisition reporting work of the subroutine on human resources is reduced, and the data reporting efficiency of the subroutine is improved.
Furthermore, according to the reporting condition of the data to be reported in the historical data statistics period, the reference acquisition parameters and the reference reporting parameters are adjusted, and the adjustment and optimization of the reference acquisition parameters and the reference reporting parameters are realized through a feedback adjustment mechanism, so that the data security personalized reporting is realized.
In order to better implement the method, correspondingly, the embodiment of the application also provides a data acquisition and reporting device, which can be particularly centralized in a terminal, wherein the terminal can be a mobile phone, a tablet personal computer, a notebook personal computer and other equipment.
For example, as shown in fig. 6, the data acquisition and reporting device includes a registration unit 601, an acquisition unit 602, an acquisition unit 603, a matching unit 604, and a reporting unit 605, as follows:
(1) A registration unit 601;
The registration unit 601 is configured to register, when the subroutine is started, a preset user interaction event of the subroutine based on an event reporting program in a preset event reporting program set.
(2) An acquisition unit 602;
and the acquisition unit 602 is configured to acquire target event association data of a target user interaction event based on the subroutine when the target user interaction event is triggered in the preset user interaction event.
(3) An acquisition unit 603;
the acquiring unit 603 acquires the acquisition parameters of the target event related data.
(4) A matching unit 604;
and the matching unit 604 is configured to determine the target event association data as data to be reported when the acquisition parameter matches with the reference acquisition parameter.
(5) A reporting unit 605;
And the reporting unit 605 is configured to report the data to be reported based on the reference reporting parameter corresponding to the subroutine.
Optionally, as shown in fig. 7, the data collecting and reporting device may further include a cloud function unit 606, a background service unit 607, and a storage unit 608, as follows:
Yun Hanshu unit 606, configured to perform format processing on the reported data, generate a report summary, write the report summary into the reported data, and forward the reported data to the background service unit.
The background service unit 607 is configured to receive the report data, extract a report digest from the report data, verify the report data based on the report digest, determine that the report data is normal report data if the verification passes, control the storage unit 608 to cache the normal report data in the first cache region, and determine that the report data is abnormal report data if the verification does not pass, and control the storage unit 608 to cache the abnormal report data in the second cache region.
And the storage unit 608 is used for storing the data needing to be cached in the data acquisition and reporting process.
In an alternative example, the registration unit is configured to:
when the subprogram is started, determining an application program interface corresponding to each preset user interaction event in the subprogram;
Determining an event reporting program corresponding to the application program interface from the preset event reporting program set, and adding the corresponding event reporting program for the application program interface in the subprogram;
when any application page of the subprogram is started, determining a target component corresponding to each preset user interaction event in the application page;
And determining an event reporting program corresponding to the target component from the preset event reporting program set, and adding the corresponding event reporting program for the target component of the application page in the subprogram.
In an alternative example, the acquisition unit is configured to:
When the target user interaction event in the preset user interaction event is triggered, acquiring target event association data of the target user interaction event based on the subprogram, wherein the method comprises the following steps:
When a target user interaction event in the preset user interaction event is triggered, collecting application program interface interaction data of the subprogram from the subprogram;
And collecting associated application page data associated with the target user interaction event from the application page data of the subprogram;
And determining the associated application page data and the application program interface interaction data as target event associated data.
In an alternative example, the reference acquisition parameters include a first reference acquisition time interval and a reference acquisition sub-parameter; the acquisition parameters comprise a first acquisition time interval and acquisition sub-parameters; a matching unit for:
If the first acquisition time interval of the target event associated data is higher than the first reference acquisition time interval, matching the reference acquisition sub-parameters with the acquisition sub-parameters of the target event associated data;
And if the reference acquisition sub-parameter is matched with the acquisition sub-parameter of the target event associated data, determining the target event associated data as data to be reported.
In an alternative example, the reference acquisition sub-parameters include: the second reference acquisition time interval, the reference data amount, the reference no-acquisition time length and the reference subroutine state parameters;
The acquisition sub-parameters comprise a second acquisition time interval, a data volume, an acquisition-free time length and a subroutine state parameter, wherein the acquisition-free time length represents the accumulated time length when no new event related data is acquired for the target user interaction event from the acquisition time of the target event related data;
a matching unit for:
And if the second acquisition time interval of the target event associated data is larger than the second reference acquisition time interval, or if the data volume of the target event associated data is larger than the reference data volume, or if the non-acquisition time period of the target event associated data is longer than the reference non-acquisition time period, or if the subroutine state parameter of the target event associated data is the same as the reference subroutine state parameter, determining the target event associated data as data to be reported.
In an optional example, the reference reporting parameters include a cache data screening parameter and a data reporting control parameter;
Reporting unit, for:
Obtaining the report state information of the buffer data of the data buffer area of the subprogram, wherein the data buffer area is used for buffering the data to be reported;
determining target data to be reported cached in the data cache area based on the cached data reporting state information and the cached data screening parameter;
The data to be reported corresponding to the target user interaction event is used as target data to be reported and is cached in the data caching area;
And reporting the target data to be reported in the data buffer area based on the data reporting control parameters.
In an optional example, the buffer data reporting status information includes a reporting number, and the buffer data filtering parameter includes a reporting number threshold;
Reporting unit, for:
and if the reporting times of the data to be reported, which is cached in the data cache area, are lower than the reporting times threshold, determining that the data to be reported is target reporting data.
In an alternative example, the apparatus further comprises: the reporting judging unit is used for detecting whether unreported data to be reported are stored in the data cache area before the reporting unit acquires the reporting state information of the cache data of the data cache area of the subprogram;
If yes, the reporting unit is controlled to continuously execute the step of acquiring the reporting state information of the cache data of the data cache area of the subprogram;
if not, controlling the reporting unit to execute the step of caching the data to be reported corresponding to the target user interaction event into the data caching area as the target data to be reported.
In an alternative example, the reporting unit is configured to:
converting the data format of the target data to be reported in the data cache area into the same preset data format;
splicing the target data to be reported based on the preset data format to obtain spliced reporting data;
and reporting the spliced reporting data based on the data reporting control parameters.
In an alternative example, the apparatus further comprises: the page data acquisition unit and the page data caching unit;
The page data acquisition unit is used for acquiring application page display data of an application page displayed by the subroutine when the target user interaction event is triggered in the preset user interaction event;
And the page data caching unit is used for caching the application page display data serving as target data to be reported in the data caching area before the reporting unit reports the target data to be reported in the data caching area based on the data reporting control parameter.
In an alternative example, the apparatus further comprises a feedback adjustment unit for:
determining the data reporting quality information of the subprogram based on the reporting condition of the data to be reported in the historical data statistics period;
and adjusting the reference acquisition parameters and the reference reporting parameters based on the preset data reporting quality index of the subprogram and the data reporting quality information.
In an optional example, the data reporting quality information includes: at least one of reporting data comprehensive indication information, reporting data buffer occupation indication information, reporting data frequency indication information and reporting data memory occupation indication information;
A feedback adjustment unit for:
acquiring the reporting data quantity of the data to be reported in the historical data statistics period, and determining the reporting data comprehensive indication information based on the reporting data quantity and the reference reporting data quantity;
Acquiring the buffer occupancy condition in the data buffer area between two adjacent reporting moments of the data to be reported in the historical data statistics period, and determining the reporting data buffer occupancy indication information based on the buffer occupancy condition;
Acquiring reporting frequency of data to be reported in the historical data statistics period, and determining reporting data frequency indication information based on the reporting frequency and a reference reporting frequency;
And acquiring the memory occupation condition of successfully reported data in the data to be reported in the historical data statistics period in the reporting data processing device corresponding to the data to be reported, and determining the memory occupation indication information of the reporting data based on the memory occupation condition.
As can be seen from the above, since the embodiment of the present application registers the preset user interaction event of the subroutine, the target event related data of the target user interaction event is automatically collected each time the preset collection event is triggered, so that the data of the API method can be automatically collected during the collection event, the data of the developer custom method can be automatically collected, and the full collection of data can be realized.
Accordingly, an embodiment of the present application also provides an electronic device, as shown in fig. 8, where the electronic device may include a Radio Frequency (RF) circuit 701, a memory 702 including one or more computer readable storage media, an input unit 703, a display unit 704, a sensor 705, an audio circuit 706, a wireless fidelity (WiFi, wireless Fidelity) module 707, a processor 708 including one or more processing cores, and a power supply 709. It will be appreciated by those skilled in the art that the electronic device structure shown in fig. 8 is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components. Wherein:
The RF circuit 701 may be used for receiving and transmitting signals during a message or a call, and in particular, after receiving downlink information of a base station, the downlink information is processed by one or more processors 708; in addition, data relating to uplink is transmitted to the base station. Typically, RF circuitry 701 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a subscriber identity module (SIM, subscriber Identity Module) card, a transceiver, a coupler, a low noise amplifier (LNA, low Noise Amplifier), a duplexer, and the like. In addition, the RF circuit 701 may also communicate with networks and other devices through wireless communication. The wireless communication may use any communication standard or protocol including, but not limited to, global system for mobile communications (GSM, global System of Mobile communication), universal packet Radio Service (GPRS, general Packet Radio Service), code division multiple access (CDMA, code Division Multiple Access), wideband code division multiple access (WCDMA, wideband Code Division Multiple Access), long term evolution (LTE, long Term Evolution), email, short message Service (SMS, short MESSAGING SERVICE), and the like.
The memory 702 may be used to store software programs and modules, and the processor 708 may perform various functional applications and data processing by executing the software programs and modules stored in the memory 702. The memory 702 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the electronic device (such as audio data, phonebooks, etc.), and the like. In addition, the memory 702 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 702 may also include a memory controller to provide access to the memory 702 by the processor 708 and the input unit 703.
The input unit 703 may be used to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, in one particular embodiment, the input unit 703 may include a touch-sensitive surface, as well as other input devices. The touch-sensitive surface, also referred to as a touch display screen or a touch pad, may collect touch operations thereon or thereabout by a user (e.g., operations thereon or thereabout by a user using any suitable object or accessory such as a finger, stylus, etc.), and actuate the corresponding connection means according to a predetermined program. Alternatively, the touch-sensitive surface may comprise two parts, a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 708, and can receive commands from the processor 708 and execute them. In addition, touch sensitive surfaces may be implemented in a variety of types, such as resistive, capacitive, infrared, and surface acoustic waves. The input unit 703 may comprise other input devices in addition to the touch-sensitive surface. In particular, other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc.
The display unit 704 may be used to display information input by a user or information provided to a user and various graphical user interfaces of the electronic device, which may be composed of graphics, text, icons, video, and any combination thereof. The display unit 704 may include a display panel, which may optionally be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch-sensitive surface may overlay a display panel, and upon detection of a touch operation thereon or thereabout, the touch-sensitive surface is passed to the processor 708 to determine the type of touch event, and the processor 708 then provides a corresponding visual output on the display panel based on the type of touch event. Although in fig. 8 the touch sensitive surface and the display panel are implemented as two separate components for input and output functions, in some embodiments the touch sensitive surface may be integrated with the display panel to implement the input and output functions.
The electronic device may also include at least one sensor 705, such as a light sensor, a motion sensor, and other sensors. In particular, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel according to the brightness of ambient light, and a proximity sensor that may turn off the display panel and/or backlight when the electronic device is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and the direction when the mobile phone is stationary, and can be used for applications of recognizing the gesture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may also be configured with the electronic device are not described in detail herein.
Audio circuitry 706, speakers, and a microphone may provide an audio interface between the user and the electronic device. The audio circuit 706 may transmit the received electrical signal converted from audio data to a speaker, where it is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signals into electrical signals, which are received by the audio circuit 706 and converted into audio data, which are processed by the audio data output processor 708 for transmission to, for example, another electronic device via the RF circuit 701, or which are output to the memory 702 for further processing. The audio circuit 706 may also include an ear bud jack to provide communication of the peripheral ear bud with the electronic device.
WiFi belongs to a short-distance wireless transmission technology, and the electronic equipment can help a user to send and receive emails, browse webpages, access streaming media and the like through the WiFi module 707, so that wireless broadband Internet access is provided for the user. Although fig. 8 shows a WiFi module 707, it is to be understood that it is not a necessary component of an electronic device, and may be omitted entirely as needed within a range that does not change the essence of the invention.
The processor 708 is the control center of the electronic device, connects the various parts of the overall handset using various interfaces and lines, performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 702, and invoking data stored in the memory 702
. Optionally, the processor 708 may include one or more processing cores; preferably, the processor 708 may integrate an application processor that primarily handles operating systems, user interfaces, applications, etc., with a modem processor that primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 708.
The electronic device also includes a power supply 709 (e.g., a battery) for powering the various components, which may be logically connected to the processor 708 by a power management system, such as to perform functions such as managing charge, discharge, and power consumption by the power management system. The power supply 709 may also include one or more of any of a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown, the electronic device may further include a camera, a bluetooth module, etc., which will not be described herein. Specifically, in this embodiment, the processor 708 in the electronic device loads executable files corresponding to the processes of one or more application programs into the memory 702 according to the following instructions, and the processor 708 executes the application programs stored in the memory 702, so as to implement various functions:
When the subprogram is started, registering a preset user interaction event of the subprogram based on an event reporting program in a preset event reporting program set, wherein the preset user interaction event comprises an event triggered by interaction between a user and the subprogram;
When a target user interaction event in the preset user interaction event is triggered, acquiring target event association data of the target user interaction event based on the subprogram, wherein the target event association data is associated with the target user interaction event;
acquiring acquisition parameters of the target event associated data;
when the acquisition parameters are matched with the reference acquisition parameters, determining the target event associated data as data to be reported;
And reporting the data to be reported based on the reference reporting parameters corresponding to the subprogram.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, an embodiment of the present application provides a storage medium storing a plurality of instructions that can be loaded by a processor to perform any of the steps in the data acquisition reporting method provided in the embodiment of the present application. For example, the instructions may perform the steps of:
When the subprogram is started, registering a preset user interaction event of the subprogram based on an event reporting program in a preset event reporting program set, wherein the preset user interaction event comprises an event triggered by interaction between a user and the subprogram;
when a target user interaction event in the preset user interaction event is triggered, acquiring target event association data of the target user interaction event based on the subprogram, wherein the target event association data is associated with the target user interaction event;
acquiring acquisition parameters of the target event associated data;
when the acquisition parameters are matched with the reference acquisition parameters, determining the target event associated data as data to be reported;
And reporting the data to be reported based on the reference reporting parameters corresponding to the subprogram.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Wherein the storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
The instructions stored in the storage medium can execute the steps in any data acquisition and reporting method provided by the embodiment of the present application, so that the beneficial effects that any data acquisition and reporting method provided by the embodiment of the present application can be realized, and detailed descriptions of the foregoing embodiments are omitted.
The foregoing describes in detail a data acquisition reporting method, apparatus, electronic device and storage medium provided by the embodiments of the present application, and specific examples are applied to illustrate the principles and embodiments of the present application, where the foregoing description of the embodiments is only for helping to understand the method and core idea of the present application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, the present description should not be construed as limiting the present application.

Claims (14)

1. A data acquisition reporting method, suitable for a subroutine of a host program, comprising:
When the subprogram is started, registering a preset user interaction event of the subprogram based on an event reporting program in a preset event reporting program set, wherein the preset user interaction event comprises an event triggered by interaction between a user and the subprogram;
when a target user interaction event in the preset user interaction event is triggered, acquiring target event association data of the target user interaction event based on the subprogram, wherein the target event association data is associated with the target user interaction event;
Acquiring acquisition parameters of the target event associated data;
when the acquisition parameters are matched with the reference acquisition parameters, determining the target event associated data as data to be reported;
Reporting the data to be reported based on the reference reporting parameters corresponding to the subprogram;
When the subprogram is started, registering the preset user interaction event of the subprogram based on an event reporting program in a preset event reporting program set, including:
when the subprogram is started, determining an application program interface corresponding to each preset user interaction event in the subprogram;
Determining an event reporting program corresponding to the application program interface from the preset event reporting program set, and adding the corresponding event reporting program for the application program interface in the subprogram;
when any application page of the subprogram is started, determining a target component corresponding to each preset user interaction event in the application page, wherein the target component comprises a function or a function set for realizing interaction operation when a user interacts with the subprogram;
And determining an event reporting program corresponding to the target component from the preset event reporting program set, and adding the corresponding event reporting program for the target component of the application page in the subprogram.
2. The method according to claim 1, wherein the collecting, based on the subroutine, target event association data of a target user interaction event when the target user interaction event is triggered among the preset user interaction events, includes:
When a target user interaction event in the preset user interaction event is triggered, collecting application program interface interaction data of the subprogram from the subprogram;
And collecting associated application page data associated with the target user interaction event from the application page data of the subprogram;
And determining the associated application page data and the application program interface interaction data as target event associated data.
3. The method of claim 1, wherein the reference acquisition parameters include a first reference acquisition time interval and a reference acquisition sub-parameter; the acquisition parameters comprise a first acquisition time interval and acquisition sub-parameters; and when the acquisition parameters are matched with the reference acquisition parameters, determining the target event associated data as data to be reported, wherein the method comprises the following steps:
If the first acquisition time interval of the target event associated data is higher than the first reference acquisition time interval, matching the reference acquisition sub-parameters with the acquisition sub-parameters of the target event associated data;
And if the reference acquisition sub-parameter is matched with the acquisition sub-parameter of the target event associated data, determining the target event associated data as data to be reported.
4. A method according to claim 3, wherein the reference acquisition subparameter comprises: the second reference acquisition time interval, the reference data amount, the reference no-acquisition time length and the reference subroutine state parameters;
The acquisition sub-parameters comprise a second acquisition time interval, a data volume, an acquisition-free time length and a subroutine state parameter, wherein the acquisition-free time length represents the accumulated time length when no new event related data is acquired for the target user interaction event from the acquisition time of the target event related data;
and if the reference acquisition sub-parameter is matched with the acquisition sub-parameter of the target event associated data, determining the target event associated data as data to be reported, including:
And if the second acquisition time interval of the target event associated data is larger than the second reference acquisition time interval, or if the data volume of the target event associated data is larger than the reference data volume, or if the non-acquisition time period of the target event associated data is longer than the reference non-acquisition time period, or if the subroutine state parameter of the target event associated data is the same as the reference subroutine state parameter, determining the target event associated data as data to be reported.
5. The method of claim 1, wherein the reference reporting parameters include a cache data screening parameter and a data reporting control parameter;
The reporting the data to be reported based on the reference reporting parameters corresponding to the subprogram comprises:
Obtaining the report state information of the buffer data of the data buffer area of the subprogram, wherein the data buffer area is used for buffering the data to be reported;
determining target data to be reported cached in the data cache area based on the cached data reporting state information and the cached data screening parameter;
The data to be reported corresponding to the target user interaction event is used as target data to be reported and is cached in the data caching area;
And reporting the target data to be reported in the data buffer area based on the data reporting control parameters.
6. The method of claim 5, wherein the buffered data reporting status information comprises a number of reports, and the buffered data screening parameter comprises a threshold number of reports;
the determining, based on the status information of reporting the cached data and the cached data screening parameter, the target data to be reported cached in the data cache area includes:
and if the reporting times of the data to be reported, which is cached in the data cache area, are lower than the reporting times threshold, determining that the data to be reported is target reporting data.
7. The method according to claim 5, wherein before obtaining the status information of the buffered data report of the data buffer area of the subroutine, further comprises:
Detecting whether unreported data to be reported are stored in the data cache area;
if yes, continuing to execute the step of acquiring the report state information of the cache data of the data cache area of the subprogram;
And if not, executing the step of caching the data to be reported corresponding to the target user interaction event into the data caching area as the target data to be reported.
8. The method of claim 5, wherein reporting the target data to be reported in the data buffer area based on the data reporting control parameter comprises:
converting the data format of the target data to be reported in the data cache area into the same preset data format;
splicing the target data to be reported based on the preset data format to obtain spliced reporting data;
and reporting the spliced reporting data based on the data reporting control parameters.
9. The method of claim 5, wherein when a target user interaction event of the preset user interaction events is triggered, the method further comprises:
acquiring application page display data of an application page displayed by the subroutine when the target user interaction event is triggered;
before reporting the target data to be reported in the data buffer area based on the data reporting control parameter, the method further comprises:
And caching the display data of the application page serving as target data to be reported into the data caching area.
10. The method as recited in claim 5, further comprising:
determining the data reporting quality information of the subprogram based on the reporting condition of the data to be reported in the historical data statistics period;
and adjusting the reference acquisition parameters and the reference reporting parameters based on the preset data reporting quality index of the subprogram and the data reporting quality information.
11. The method of claim 10, wherein the data reporting quality information comprises: at least one of reporting data comprehensive indication information, reporting data buffer occupation indication information, reporting data frequency indication information and reporting data memory occupation indication information;
the reporting condition of the data to be reported based on the historical data statistics period determines the data reporting quality information of the subroutine, and the method comprises the following steps:
acquiring the reporting data quantity of the data to be reported in the historical data statistics period, and determining the reporting data comprehensive indication information based on the reporting data quantity and the reference reporting data quantity;
Acquiring the buffer occupancy condition in the data buffer area between two adjacent reporting moments of the data to be reported in the historical data statistics period, and determining the reporting data buffer occupancy indication information based on the buffer occupancy condition;
Acquiring reporting frequency of data to be reported in the historical data statistics period, and determining reporting data frequency indication information based on the reporting frequency and a reference reporting frequency;
And acquiring the memory occupation condition of successfully reported data in the data to be reported in the historical data statistics period in the reporting data processing device corresponding to the data to be reported, and determining the memory occupation indication information of the reporting data based on the memory occupation condition.
12. A data acquisition reporting device, adapted to a subroutine of a host program, comprising:
The registration unit is configured to register, when the subroutine is started, a preset user interaction event of the subroutine based on an event reporting program in a preset event reporting program set, and includes: when the subprogram is started, determining an application program interface corresponding to each preset user interaction event in the subprogram; determining an event reporting program corresponding to the application program interface from the preset event reporting program set, and adding the corresponding event reporting program for the application program interface in the subprogram; when any application page of the subprogram is started, determining a target component corresponding to each preset user interaction event in the application page, wherein the target component comprises a function or a function set for realizing interaction operation when a user interacts with the subprogram; determining an event report program corresponding to the target component from the preset event report program set, and adding the corresponding event report program for the target component of the application page in the subprogram;
the acquisition unit is used for acquiring target event related data of the target user interaction event based on the subprogram when the target user interaction event in the preset user interaction event is triggered;
the acquisition unit acquires acquisition parameters of the target event associated data;
the matching unit is used for determining the target event associated data as data to be reported when the acquisition parameters are matched with the reference acquisition parameters;
and the reporting unit is used for reporting the data to be reported based on the reference reporting parameters corresponding to the subprogram.
13. An electronic device comprising a memory and a processor; the memory stores an application program, and the processor is configured to run the application program in the memory to perform the operations in the data acquisition reporting method according to any one of claims 1 to 11.
14. A storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps of the data acquisition reporting method of any one of claims 1 to 11.
CN202011138094.0A 2020-10-22 Data acquisition reporting method and device, electronic equipment and storage medium Active CN114385478B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011138094.0A CN114385478B (en) 2020-10-22 Data acquisition reporting method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011138094.0A CN114385478B (en) 2020-10-22 Data acquisition reporting method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114385478A CN114385478A (en) 2022-04-22
CN114385478B true CN114385478B (en) 2024-07-05

Family

ID=

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110674022A (en) * 2019-09-27 2020-01-10 北京三快在线科技有限公司 Behavior data acquisition method and device and storage medium
CN110704270A (en) * 2019-08-20 2020-01-17 北京奇艺世纪科技有限公司 Zero-buried point data acquisition method and device, electronic equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110704270A (en) * 2019-08-20 2020-01-17 北京奇艺世纪科技有限公司 Zero-buried point data acquisition method and device, electronic equipment and storage medium
CN110674022A (en) * 2019-09-27 2020-01-10 北京三快在线科技有限公司 Behavior data acquisition method and device and storage medium

Similar Documents

Publication Publication Date Title
US9697622B2 (en) Interface adjustment method, apparatus, and terminal
CN110163051B (en) Text extraction method, device and storage medium
CN111273955B (en) Thermal restoration plug-in optimization method and device, storage medium and electronic equipment
CN112749074B (en) Test case recommending method and device
CN108984374B (en) Method and system for testing database performance
JP6915074B2 (en) Message notification method and terminal
CN110347578B (en) Application testing method and device and storage medium
CN107622234B (en) Method and device for displaying budding face gift
CN107632985B (en) Webpage preloading method and device
CN112596980A (en) ios performance collection method and device, mobile terminal and computer readable storage medium
CN112612552A (en) Application program resource loading method and device, electronic equipment and readable storage medium
CN114385478B (en) Data acquisition reporting method and device, electronic equipment and storage medium
CN109240986B (en) Log processing method and device and storage medium
CN107346347B (en) Webpage table display method and device
CN114385478A (en) Data acquisition reporting method and device, electronic equipment and storage medium
CN108269223B (en) Webpage graph drawing method and terminal
CN112965756B (en) Page resource loading amount monitoring method and device, electronic equipment and storage medium
CN111966237B (en) Touch compensation method and device for open screen and terminal
CN112181266B (en) Graphic code identification method, device, terminal and storage medium
CN107871017B (en) Method and device for detecting information filtering function
CN110187929B (en) Icon loading method, terminal and computer readable storage medium
CN107066116B (en) Character string generation method, character analysis method and device
CN115098383A (en) Message query method, device, electronic equipment and storage medium
CN114329263A (en) Rich text data processing method and device, terminal equipment and storage medium
CN117407610A (en) Page preloading method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant