CN112732546A - Application-based use duration processing method, device, equipment and storage medium - Google Patents

Application-based use duration processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN112732546A
CN112732546A CN202110121311.3A CN202110121311A CN112732546A CN 112732546 A CN112732546 A CN 112732546A CN 202110121311 A CN202110121311 A CN 202110121311A CN 112732546 A CN112732546 A CN 112732546A
Authority
CN
China
Prior art keywords
application
event
page
foreground
events
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.)
Pending
Application number
CN202110121311.3A
Other languages
Chinese (zh)
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
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110121311.3A priority Critical patent/CN112732546A/en
Publication of CN112732546A publication Critical patent/CN112732546A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging

Abstract

The application provides a use duration processing method and device based on application, electronic equipment and a computer readable storage medium; the method comprises the following steps: acquiring a plurality of application events which respectively and correspondingly occur during each foreground state of an application; generating event data corresponding to a plurality of application events of the application based on the plurality of application events, wherein the event data comprises duration data; determining a target application event matched with the statistical index of the application from the plurality of application events; and adding the event data corresponding to the target application event based on the target application event matched with the application statistical index, and taking the result of the addition as the service life of the application corresponding statistical index. Through the application, the application events applied in the foreground state period can be combined, and the information precision of the service duration is improved.

Description

Application-based use duration processing method, device, equipment and storage medium
Technical Field
The present disclosure relates to data processing technologies, and in particular, to a method and an apparatus for processing a use duration based on an application, an electronic device, and a computer-readable storage medium.
Background
With the development of computer technology, applications (apps) run by electronic devices are more diversified, and the emergence of various apps can meet various requirements of users, for example, using reading apps can help users to know about recently hot topics, such as hot entertainment events, economic events, and the like; the use of the office App can help the user to quickly complete work tasks, such as making work report files; the online classroom App can help the user to study effectively even if the user is out of home.
In order to enable a user to know the time spent on the App, the electronic equipment obtains the use time of various Apps by counting the time intervals from starting to closing of various Apps, and displays the use time of various Apps to the user in a form of a table.
In this way, though, the user can be roughly aware of the usage duration of the various apps. However, the method cannot accurately count the use duration of the App, so that the information accuracy of the statistical data is not high, the user is easily misled, and the experience of the user is greatly reduced.
Disclosure of Invention
The embodiment of the application-based use duration processing method and device, the electronic device and the computer-readable storage medium can be used for improving the information precision of use duration by combining application events applied in a foreground state.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a use duration processing method based on application, which comprises the following steps:
acquiring a plurality of application events which respectively and correspondingly occur during each foreground state of an application;
generating event data corresponding to a plurality of application events of the application respectively based on the plurality of application events, wherein the event data comprises duration data;
determining a target application event from the plurality of application events that matches the statistical indicator of the application;
and adding event data corresponding to the target application event based on the target application event matched with the statistical index of the application, and taking the result of the addition as the service life of the statistical index corresponding to the application.
An embodiment of the present application provides a device for processing a usage duration based on an application, including:
the acquisition module is used for acquiring a plurality of application events which respectively and correspondingly occur during each foreground state;
a data module, configured to generate event data corresponding to a plurality of application events of the application, based on the plurality of application events, where the event data includes duration data;
a determining module, configured to determine, from the plurality of application events, a target application event that matches a statistical indicator of the application;
and the processing module is used for summing event data corresponding to the target application event based on the target application event matched with the statistical index of the application, and taking the result of the summing processing as the service life of the statistical index corresponding to the application.
In the foregoing technical solution, the obtaining module is further configured to execute the following processing for each foreground state period of the application:
collecting a plurality of state switching data of the application through a code buried point;
determining, based on the plurality of state-switch data, a plurality of application events that occur during the foreground state by the application.
In the above technical solution, the application event includes a start event and an operation event; the obtaining module is further configured to obtain a start event occurring during the foreground state of the application when the state switching data representation of the application switches from a closed state to a start state;
and when the state switching data of the application represent that the application is in the starting state and is not switched to the background state of the application, acquiring the running event of the application during the foreground state.
In the above technical solution, the operation event includes a foreground event and a page event; the obtaining module is further configured to obtain a foreground state event occurring during a foreground state of the application when the state switching data of the application indicates that the application is in a foreground state switching occasion;
and when the state switching data of the application represent that the application is in the page state switching opportunity, acquiring a page event occurring in the foreground state period of the application.
In the above technical solution, the foreground state event includes a foreground entering event and a foreground leaving event; the obtaining module is further configured to obtain a foreground entering event occurring during the foreground state of the application when the foreground state switching occasion indicates that the application is switched from the starting state or the background state to the foreground state;
and when the foreground state switching occasion represents that the application leaves the foreground state, acquiring a foreground leaving event which occurs in the foreground state period of the application.
In the above technical solution, the page event includes a page entry event and a page exit event; the obtaining module is further configured to obtain a page entry event that occurs during the foreground state of the application when the page state switching timing indicates that the page of the application is switched from the invisible state to the visible state;
and when the page state switching opportunity represents that the page of the application is switched from the visible state to the invisible state, acquiring a page leaving event occurring during the foreground state of the application.
In the above technical solution, the data module is further configured to execute the following processing for any application event of the plurality of application events:
when the application event of the application has an incidence relation with other application events, acquiring event parameters and event parameter values of the other application events;
generating an event parameter and an event parameter value of the application event based on the application event;
and taking the combination of the event parameters and the event parameter values of the other application events and the event parameters and the event parameter values of the application events as the event data of the application events.
In the above technical solution, the application event includes a start event, a foreground entry event, a page entry event, and a page exit event; the data module is further configured to obtain event parameters and event parameter values corresponding to the start event, the foreground entry event, and the page entry event, respectively, when an association relationship exists between the page exit event of the application and the start event, the foreground entry event, and the page entry event;
acquiring the page stay time of the page departure event based on the timer corresponding to the page departure event of the application;
and recording the event parameter value of the page leaving event as the page stay time.
In the above technical solution, the application event includes a start event, a foreground entering event, and a foreground leaving event; the data module is further configured to obtain event parameters and event parameter values corresponding to the start event and the foreground entering event, respectively, when a foreground leaving event of the application has an association relationship with the start event and the foreground entering event;
acquiring the foreground running time of the foreground leaving event based on the timer corresponding to the foreground leaving event of the application;
recording the event parameter value of the foreground leaving event as the foreground running duration.
In the above technical solution, when the statistical indicator is the usage duration after the application is started each time, the target application event matched with the statistical indicator of the application is a foreground leaving event; the processing module is further configured to determine a first start event and a second start event corresponding to the application, where the first start event is before the second start event;
dividing foreground leaving events between the first initiating event and the second initiating event into a group;
acquiring a plurality of foreground leaving events in the group;
and adding and processing the foreground running durations respectively corresponding to the plurality of foreground leaving events, and taking the result of the adding and processing as the use duration of the application after corresponding to the first starting event.
In the above technical solution, when the statistical indicator is the usage duration after the application is started each time, the target application event matched with the statistical indicator of the application is a page leaving event; the processing module is further configured to determine a first start event and a second start event corresponding to the application, where the first start event is before the second start event;
dividing page leave events between the first start event and the second start event into a group;
acquiring a plurality of page leaving events in the group;
and adding the page stay time lengths corresponding to the plurality of page leaving events respectively, and taking the result of the adding as the use time length of the application after corresponding to the first starting event.
In the above technical solution, when the statistical indicator is a run-time length in different foreground states, the target application event matched with the statistical indicator of the application is a foreground departure event; the processing module is further configured to perform the following processing for any of the foreground states:
obtaining the foreground leaving event associated with the starting event during the foreground state based on the event parameter of the starting event of the application;
and taking the foreground running time corresponding to the foreground leaving event as the running time of the foreground state.
In the above technical solution, when the statistical indicator is a run-time length of different foreground states, the target application event matched with the statistical indicator of the application is a page leave event; the processing module is further configured to perform the following processing for any of the foreground states:
obtaining a plurality of page leaving events associated with the start event during the foreground state based on event parameters of the start event of the application;
and adding the page staying time lengths corresponding to the multiple page leaving events respectively, and taking the result of the adding as the running time length of the foreground state.
In the above technical solution, when the statistical indicator is the page dwell time of different pages in the foreground state, the target application event matched with the statistical indicator of the application is a page leave event; the processing module is further configured to perform the following for any page during the foreground state:
dividing a plurality of the page leave events associated with the page during the foreground state into a group;
and adding the page staying time lengths corresponding to the multiple page leaving events in the group, and taking the result of the adding as the page staying time length of the page in the foreground state.
In the above technical solution, when the statistical indicator is the page stay time of different pages after the application is started, the target application event matched with the statistical indicator of the application is a page leave event; the processing module is further configured to execute the following processing for any page after the application is started:
dividing a plurality of the page departure events associated with the page after the application is started into a group;
and adding the page staying time lengths corresponding to the multiple page leaving events in the group, and taking the result of the adding as the page staying time length of the page after the application is started.
An embodiment of the present application provides an electronic device for duration processing, where the electronic device includes:
a memory for storing executable instructions;
and the processor is used for realizing the application-based service life processing method provided by the embodiment of the application when the executable instructions stored in the memory are executed.
The embodiment of the application provides a computer-readable storage medium, which stores executable instructions and is used for causing a processor to execute the computer-readable storage medium to realize the application-based use duration processing method provided by the embodiment of the application.
The embodiment of the application has the following beneficial effects:
the target application events matched with the application statistical indexes are determined from the application events applied in the foreground state, and the use duration of the application corresponding to the statistical indexes is obtained based on the event data corresponding to the target application events, so that the information accuracy of the use duration can be improved by combining the application events applied in the foreground state, the use duration is not limited to the application, and the diversity of the use duration is improved.
Drawings
Fig. 1 is an application mode diagram of an application-based usage duration processing method according to an embodiment of the present application;
FIG. 2 is a schematic structural diagram of an electronic device for duration of use processing according to an embodiment of the present disclosure;
3A-3C are schematic flow charts of application-based duration processing methods provided by embodiments of the present application;
FIG. 4 is a schematic diagram of an application event provided by an embodiment of the present application;
FIG. 5 is a schematic diagram of a terminal interface provided in an embodiment of the present application;
FIG. 6 is a schematic illustration of a page display provided by an embodiment of the present application;
FIG. 7 is a schematic diagram of an application event provided by an embodiment of the present application;
8-13 are statistical diagrams of usage durations provided by embodiments of the present application;
fig. 14 is a schematic diagram of calculating App usage time provided by the related art;
fig. 15 is a schematic diagram of calculating App usage time provided by the related art;
FIG. 16 is a schematic illustration of index disassembly provided by an embodiment of the present application;
fig. 17 is a schematic diagram of an App event reporting process provided in the embodiment of the present application;
fig. 18 is a schematic diagram of an App event reporting process provided in the embodiment of the present application.
Detailed Description
In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the attached drawings, the described embodiments should not be considered as limiting the present application, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
In the following description, references to the terms "first", "second", and the like are only used for distinguishing similar objects and do not denote a particular order or importance, but rather the terms "first", "second", and the like may be used interchangeably with the order of priority or the order in which they are expressed, where permissible, to enable embodiments of the present application described herein to be practiced otherwise than as specifically illustrated and described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the application.
Before further detailed description of the embodiments of the present application, terms and expressions referred to in the embodiments of the present application will be described, and the terms and expressions referred to in the embodiments of the present application will be used for the following explanation.
1) Application events: events that occur from open to closed of an application, such as an open event (i.e., a cold start, which starts an application while it is in a closed state); a foreground enter event (i.e., the application is in an open state and is currently using the application, e.g., the application switches from background to foreground); a foreground away event (i.e., the application is in an open state and is currently exiting the application, e.g., the application switches from foreground to background); a page enter event (i.e., an application is in an open state and is currently browsing a certain page of the application); a page leave event (i.e. the application is in an open state and is currently exiting the displayed page, e.g. switching from a rendered a page to a B page, i.e. performing an a page leave event first and then a B page enter event).
2) Foreground: after the application is opened, the currently used program, including various interfaces directly interacting with the user, is presented to the user, and the user can directly access and operate the foreground, for example, the user clicks on a certain instant messaging application and presents a chat interface of the instant messaging application, that is, the foreground of the instant messaging application is presented to the user.
3) Background: after the application is opened, the currently running program which cannot be presented to the user includes various hidden interfaces which cannot be directly accessed and operated by the user, for example, after the user opens a certain instant messaging application on the main interface of the mobile terminal, and clicks a main key on the mobile terminal to present the main interface of the mobile terminal, the instant messaging application is in an open state, and the user can still receive chat messages, but does not present the interface of the instant messaging application.
4) Process identification (Session _ id): one start of the application serves as an application process, and Session _ id is generated when an application cold start event is triggered.
5) Run identification (Launch _ id): and switching the primary application to the foreground to run as the primary application, and generating the Launch _ id when the foreground entering event (application foreground switching event) is triggered.
6) Page view identifier (Pageview _ id): one page entry is used as one page view, and the Pageview _ id is generated when a page entry event is triggered.
The embodiment of the application provides a use duration processing method and device based on application, electronic equipment and a computer readable storage medium, and the use duration processing method and device can be used for improving the information precision of use duration by combining application events applied in a foreground state.
An exemplary application of the electronic device provided by the embodiment of the present application is described below, and the electronic device provided by the embodiment of the present application may be implemented as various types of user terminals such as a notebook computer, a tablet computer, a desktop computer, a set-top box, a mobile device (e.g., a mobile phone, a portable music player, a personal digital assistant, a dedicated messaging device, and a portable game device). In the following, an exemplary application will be explained when the electronic device is implemented as a terminal.
In order to facilitate easier understanding of the application-based usage duration processing method provided in the embodiments of the present application, an exemplary implementation scenario of the application-based usage duration processing method provided in the embodiments of the present application is first described, and the implementation scenario may be completely based on terminal output.
Referring to fig. 1, fig. 1 is an application mode diagram of an application-based usage duration processing method according to an embodiment of the present application, in which a terminal 100 runs a client 110 (including various applications, such as a game application, a reading application, an online education application, a traffic monitoring application, and the like), and during a running process of the client 110 (during a foreground state of the application), in response to a user operation, automatically obtains a plurality of application events 120 that occur during the foreground state, such as a start event, a page entry event, and the like, determines a target application event that matches a statistical indicator of the application from the plurality of application events, and sums event data corresponding to the target application event to obtain a usage duration of the statistical indicator corresponding to the application, such as a usage duration of each page of the application.
As an implementation scenario, for a game application, a game client automatically acquires a plurality of application events occurring during a foreground state in response to a game operation of a player during the foreground state, for example, a start event occurs when the game application is opened; after the game application is opened, a foreground entering event occurs, timing is carried out until the game application is switched to a background, and timing is stopped to obtain the running time of the foreground; opening a setting page to set parameters, namely, generating a setting page entering event; and opening the fight page to enter a fight mode, namely, generating a fight page entry event, timing until exiting the fight page, and stopping timing to obtain the page dwell time of the fight page. When the time length (statistical index) of the player battle needs to be counted, the page stay time lengths of the battle pages are added to obtain the time length of the player battle, so that the information accuracy of various use time lengths is improved by combining the application events of the game application in the foreground state, and subsequent game processing, such as player grade upgrading, player win and lose in the battle, can be conveniently carried out based on various use time lengths in the game.
As another implementation scenario, for the reading application, the reading client automatically acquires, in response to a browsing operation of the reader during the foreground state, a plurality of application events, such as a plurality of page entry events and a plurality of page exit events, occurring during the foreground state. When the reading duration of each article, namely the dwell duration (statistical index) of each page, needs to be counted, the page dwell durations of the article pages are added to obtain the reading duration of each article, so that the information precision of the reading duration is improved by combining with the application event of the reading application in the foreground state, and the reading preference of a reader is determined for subsequent article recommendation based on various reading durations, so that articles meeting the user interest can be recommended to the reader, and the article recommendation accuracy is improved.
As another implementation scenario, for an online education application, an online education client automatically acquires a plurality of application events, such as a plurality of page entry events and a plurality of page exit events, occurring during a foreground state in response to a browsing operation of a student during the foreground state. When the completion duration of each task, namely the stay duration (statistical index) of each page, needs to be counted, the page stay duration of each article page is added to obtain the completion duration of each task, so that the information precision of the completion duration is improved by combining the application events of the online education application in the foreground state, whether students cheat or not is determined on the basis of various completion durations, for example, when the students finish the tasks only in a short time, cheating of the students is explained, the function of automatically detecting whether the students cheat or not is realized, and the cheating detection efficiency and accuracy are improved.
As another implementation scenario, for a traffic monitoring application, during a foreground state of each of other applications, a traffic monitoring client automatically acquires a plurality of application events occurring during the foreground state, such as a plurality of foreground entry events and a plurality of foreground exit events. When the use duration (statistical index) of each application needs to be counted, the foreground running duration corresponding to the foreground leaving event of each application is added to obtain the use duration of each application, so that the information precision of the use duration is improved by combining the application events of each application in the foreground state, and the applications frequently used by a user are determined based on various use durations in the following process.
The following describes a structure of an electronic device for duration usage processing according to an embodiment of the present application, referring to fig. 2, fig. 2 is a schematic structural diagram of an electronic device 500 for duration usage processing according to an embodiment of the present application, and taking the electronic device 500 as a terminal as an example, the electronic device 500 for duration usage processing shown in fig. 2 includes: at least one processor 510, memory 550, at least one network interface 520, and a user interface 530. The various components in the electronic device 500 are coupled together by a bus system 540. It is understood that the bus system 540 is used to enable communications among the components. The bus system 540 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 540 in fig. 2.
The Processor 510 may be an integrated circuit chip having Signal processing capabilities, such as a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like, wherein the general purpose Processor may be a microprocessor or any conventional Processor, or the like.
The memory 550 may comprise volatile memory or nonvolatile memory, and may also comprise both volatile and nonvolatile memory. The non-volatile Memory may be a Read Only Memory (ROM), and the volatile Memory may be a Random Access Memory (RAM). The memory 550 described in embodiments herein is intended to comprise any suitable type of memory. Memory 550 optionally includes one or more storage devices physically located remote from processor 510.
In some embodiments, memory 550 can store data to support various operations, examples of which include programs, modules, and data structures, or subsets or supersets thereof, as exemplified below.
An operating system 551 including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
a network communication module 552 for communicating to other computing devices via one or more (wired or wireless) network interfaces 520, exemplary network interfaces 520 including: bluetooth, wireless compatibility authentication (WiFi), and Universal Serial Bus (USB), etc.;
in some embodiments, the application-based duration of use processing apparatus provided in the embodiments of the present application may be implemented in a software manner, and the application-based duration of use processing apparatus provided in the embodiments of the present application may be provided in various software embodiments, including various forms of application programs, software modules, scripts, or codes.
Fig. 2 shows an application-based duration of use processing device 555 stored in a memory 550, which may be software in the form of programs and plug-ins, etc., and includes a series of modules, including an acquisition module 5551, a data module 5552, a determination module 5553, and a processing module 5554, which are logical and thus may be arbitrarily combined or further divided according to the functions implemented, the functions of each of which will be described below.
As described above, the application-based usage duration processing method provided by the embodiment of the present application can be implemented by various types of electronic devices. Referring to fig. 3A, fig. 3A is a schematic flowchart of an application-based duration processing method according to an embodiment of the present application, and is described with reference to the steps shown in fig. 3A.
In the following steps, the application events include an open event (i.e., cold start, when the application is in a closed state, the application is started), a foreground enter event (i.e., the application is in an open state and is currently being used, e.g., the application is switched from a background to a foreground), a foreground exit event (i.e., the application is in an open state and is currently exiting, e.g., the application is switched from a foreground to a background), a page enter event (i.e., the application is in an open state and is currently browsing a certain page of the application), a page exit event (i.e., the application is in an open state and is currently exiting a displayed page, e.g., switching from a presented a page to a B page, i.e., performing the a page exit event first and then performing the B page entry event).
In step 101, a plurality of application events respectively and correspondingly occurring during each foreground state of the application are acquired.
As an example of obtaining an application event, an application included in a terminal is in a running process (during a foreground state of the application), and multiple application events occurring during the foreground state (during the foreground running process) are automatically generated in response to various operations of a user, such as a click operation.
Referring to fig. 3B, fig. 3B is an optional flowchart of the application-based duration processing method according to the embodiment of the present invention, and fig. 3B illustrates that step 101 in fig. 3A can be implemented by steps 1011 to 1012: in step 1011, the following processing is performed for each foreground state period of the application: collecting a plurality of state switching data of the application through a code buried point; in step 1012, a plurality of application events that occur during the foreground state by the application are determined based on the plurality of state switch data.
For example, each application may have a process of foreground running for multiple times, and code embedding is performed on a certain application according to an actual application requirement, so as to collect state switching data (data representing that the state of the application changes) of the application through the code embedding, and once the state switching data is collected, the application event occurring this time is determined based on the state switching data.
In some embodiments, the application events include a start event and a run event; determining, based on the plurality of state-switch data, a plurality of application events that occur during the foreground state for the application, including: when the representation of the state switching data of the application is switched from a closed state to a starting state, acquiring a starting event occurring during the foreground state of the application; and when the state switching data of the application represent that the application is in a starting state and is not switched to a background state of the application, acquiring a running event occurring during a foreground state of the application.
As shown in fig. 4, when an application is cold-started, it is determined that a start event occurs in the application when the application is detected to be switched from a closed state to a start state by a code embedded point, and after the application is started, the application is in the start state and is not switched to a background state (during background running), various events may occur in a foreground running stage, and a running event occurring during the foreground state is detected by the code embedded point.
In some embodiments, the running events include foreground events and page events; acquiring a running event occurring during a foreground state of an application, including: when the state switching data of the application represent the switching time of the application in the foreground state, acquiring a foreground state event occurring in the foreground state period of the application; and when the state switching data of the application represent that the application is in the page state switching opportunity, acquiring a page event occurring in the foreground state.
For example, the foreground state event includes a foreground entering event and a foreground leaving event, and when the current station state switching time represents that the application is switched from a starting state or a background state to a foreground state, the foreground entering event occurring during the foreground state is acquired; and when the current station state switching opportunity represents that the application leaves the foreground state, acquiring a foreground leaving event which occurs in the foreground state period.
As shown in fig. 4, after an application is started and the application is not immediately closed, it is determined that a foreground entry event occurs when the application is switched from the start state to the foreground state by collecting the embedded code point, or when the application is switched from the background state to the foreground state by collecting the embedded code point, it is determined that the foreground entry event occurs. For example, as shown in fig. 5, if the application is exited by clicking the main key 501, but the application is not closed, and the application runs in the background, it is collected through the code embedded point that the application is switched from the foreground state to the background state, and it is determined that the foreground leaving event occurs this time.
In some embodiments, the page events include page enter events and page leave events; acquiring a running event occurring during a foreground state of an application, including: when the page state switching time represents that the page of the application is switched from the invisible state to the visible state, acquiring a page entering event occurring during the foreground state of the application; when the page state switching opportunity represents that the page of the application is switched from the visible state to the invisible state, acquiring a page leaving event occurring during the foreground state of the application.
As shown in fig. 4, when an application is in a foreground running period, an icon a (e.g., a recommendation button) is clicked, and it is collected through a code embedded point that the page a is switched from an invisible state to a visible state, it is determined that a page entry event occurs this time, and the recommendation interface 601 shown in fig. 6 is entered. For example, if the user clicks the focus button 602 while the recommendation interface 601 is being presented, the page leave event occurs when the recommendation interface 601 switches from the visible state to the invisible state.
In step 102, event data corresponding to each of the plurality of application events of the application is generated based on the plurality of application events.
Wherein the event data includes duration data. After the plurality of application events are obtained, event data corresponding to the plurality of application events are generated, and the event data corresponding to the plurality of application events are reported, so that the use duration can be counted based on the event data corresponding to the plurality of application events.
Referring to fig. 3C, fig. 3C is an optional flowchart of the application-based duration processing method according to the embodiment of the present invention, and fig. 3C shows that step 102 in fig. 3A can be implemented through steps 1021 to 1023: in step 1021, the following process is performed for any of the plurality of application events: when the application event of the application has an incidence relation with other application events, acquiring event parameters and event parameter values of other application events; in step 1021, generating event parameters and event parameter values of the application event based on the application event; in step 1023, the event parameters and the event parameter values of the other application events, and the combination of the event parameters and the event parameter values of the application events are used as the event data of the application events.
For example, as shown in fig. 7, a foreground entering event is associated with a start event, an event parameter of the start event is a process identifier (Session _ id) and an event parameter value is a process identifier value, an event parameter of the foreground entering event is an operation identifier (Launch _ id) and an event parameter value is an operation identifier value, and then event data of the foreground entering event is { (process identifier, process identifier value); (run flag, run flag value) }. The page access event is related to a start event and a foreground access event, the event parameter of the page access event is a page browsing identifier (Pageview _ id), the event parameter value is a page browsing identifier value, and the event data of the page access event is { (process identifier, process identifier value); (run identification, run identification value); (page view flag, page view flag value).
In some embodiments, the application events include a launch event, a foreground entry event, a page entry event, and a page exit event; when the application event of the application has an incidence relation with other application events, acquiring event parameters and event parameter values of the other application events, including: when the page leaving event of the application has an incidence relation with a starting event, a foreground entering event and a page entering event, acquiring event parameters and event parameter values respectively corresponding to the starting event, the foreground entering event and the page entering event; generating event parameters and event parameter values for the application event based on the application event, including: acquiring the page staying time of a page leaving event based on a timer corresponding to the page leaving event of the application; and recording the event parameter value of the page leaving event as the page stay time.
For example, as shown in fig. 7, a Page leaving event is associated with a start event, a foreground entering event, and a Page entering event, after the Page entering event occurs, a Page staying timer (for recording a staying duration of a Page) starts to time, when the Page leaving event occurs, the Page staying timer stops timing, and obtains a Page staying duration of the Page leaving event (a staying duration of a Page corresponding to the Page leaving event), where an event parameter of the Page leaving event is a Page staying duration parameter (Page _ duration), an event parameter value is a Page staying duration, and event data of the Page leaving event is { (process identifier, process identifier value); (run identification, run identification value); (page view flag, page view flag value), (page dwell time parameter, page dwell time) }.
In some embodiments, the application events include a launch event, a foreground entry event, and a foreground exit event; when the application event of the application has an incidence relation with other application events, acquiring event parameters and event parameter values of the other application events, including: when the foreground leaving event of the application has an incidence relation with the starting event and the foreground entering event, acquiring event parameters and event parameter values corresponding to the starting event and the foreground entering event respectively; generating event parameters and event parameter values for the application event based on the application event, including: acquiring the foreground running time of a foreground leaving event based on a timer corresponding to the foreground leaving event of the application; recording the event parameter value of the foreground leaving event as the foreground running time.
For example, as shown in fig. 7, a foreground leaving event is associated with a start event and a foreground entering event, after the foreground entering event occurs, a foreground running timer (used for recording the running duration of the foreground) starts to time, when the foreground leaving event occurs, the foreground running timer stops timing, and obtains the foreground running duration of the foreground leaving event (the running duration of the foreground corresponding to the foreground leaving event), the event parameter of the foreground leaving event is a page foreground running duration parameter (Launch _ duration), the event parameter value is a foreground running duration, and the event data of the foreground leaving event is { (process identifier, process identifier value); (run identification, run identification value); (foreground running time parameter, foreground running time) }.
In step 103, a target application event matching the statistical indicator of the application is determined from the plurality of application events.
For example, different statistical indexes have matching relations with different application events, for example, a statistical index of a usage duration after each application start has matching relations with a start event and a foreground leaving event. After the target application event matched with the applied statistical index is determined, subsequent statistical processing is carried out based on the target application event, and the statistical efficiency is improved.
In step 104, based on the target application event matched with the applied statistical index, the event data corresponding to the target application event is summed, and the result of the summation is used as the usage duration of the applied statistical index.
After the target application event is obtained, only the event data corresponding to the target application event is added, so that the use duration of the application corresponding to the statistical index can be obtained, such as the use duration after the application is started each time, the running durations of different foreground states, the page dwell duration of different pages in the foreground state and the like, and therefore the diversity of the use duration is improved, and wider application requirements can be met.
In some embodiments, when the statistical indicator is the usage duration after each application is started, the target application event matched with the statistical indicator of the application is a foreground leaving event; based on the target application event matched with the application statistical index, adding the event data corresponding to the target application event, and taking the result of the adding processing as the service life of the application corresponding statistical index, wherein the method comprises the following steps: determining a first starting event and a second starting event corresponding to the application, wherein the first starting event is before the second starting event; dividing foreground leaving events between a first start event and a second start event into a group; acquiring a plurality of foreground leaving events in a group; and adding and processing the foreground running time lengths corresponding to the plurality of foreground leaving events respectively, and taking the result of the adding and processing as the use time length after the application corresponds to the first starting event.
The first start event and the second start event are start events corresponding to a certain start of the application, and the first start event and the second start event are two adjacent start events. As shown in fig. 8, a start event corresponding to the first start of the application is used as a first start event, a second start of the application is used as a second start event, foreground leave events between the first start event and the second start event are divided into 1 group, foreground running durations corresponding to a plurality of foreground leave events in the 1 group are summed, and a result of the summation is used as a duration of use after the first start event (a total duration of use of the first start of the application).
In some embodiments, when the statistical indicator is the usage duration after each application start, the target application event matched with the statistical indicator of the application is a page leave event; based on the target application event matched with the application statistical index, adding the event data corresponding to the target application event, and taking the result of the adding processing as the service life of the application corresponding statistical index, wherein the method comprises the following steps: determining a first starting event and a second starting event corresponding to the application, wherein the first starting event is before the second starting event; dividing the page leaving events between the first start event and the second start event into a group; acquiring a plurality of page leaving events in a group; and adding the page stay time lengths corresponding to the multiple page leaving events respectively, and taking the result of the addition as the use time length after the application corresponds to the first starting event.
As shown in fig. 9, a start event corresponding to the first start of the application is used as a first start event, a second start of the application is used as a second start event, page leave events between the first start event and the second start event are divided into 2 groups, page stay durations corresponding to a plurality of page leave events in the 2 groups are summed, and a result of the summation is used as a usage duration after the first start event (a total usage duration of the first start of the application).
In some embodiments, when the statistical indicator is a run-time length of a different foreground state, the target application event matching the statistical indicator of the application is a foreground departure event; based on the target application event matched with the application statistical index, adding the event data corresponding to the target application event, and taking the result of the adding processing as the service life of the application corresponding statistical index, wherein the method comprises the following steps: the following processing is performed for any foreground state: obtaining a foreground leaving event associated with the starting event during a foreground state based on an event parameter of the starting event of the application; and taking the foreground running time corresponding to the foreground leaving event as the running time of the foreground state.
As shown in fig. 10, in the process of the 1 st App foreground operation (a certain foreground state), a first foreground leaving event is obtained, and the foreground operation duration corresponding to the first foreground leaving event is used as the 1 st App foreground operation duration.
In some embodiments, when the statistical indicator is a run-time length of a different foreground state, the target application event matched with the statistical indicator of the application is a page leave event; based on the target application event matched with the application statistical index, adding the event data corresponding to the target application event, and taking the result of the adding processing as the service life of the application corresponding statistical index, wherein the method comprises the following steps: the following processing is performed for any foreground state: obtaining a plurality of page leaving events associated with the starting event during the foreground state based on the event parameters of the starting event of the application; and adding the page stay time lengths corresponding to the multiple page leaving events respectively, and taking the result of the addition as the running time length of the foreground state.
As shown in fig. 11, in the process of the 1 st App foreground operation (a certain foreground state), multiple page departure events associated with the start event during the foreground state, that is, an a page departure event and a B page departure event, are obtained, and a page dwell duration corresponding to the a page departure event (a page first dwell duration) and a page dwell duration corresponding to the B page departure event (B page first dwell duration) are summed up to obtain the 1 st App foreground operation duration.
In some embodiments, when the statistical indicator is the page dwell time of a different page during the foreground state, the target application event matching the statistical indicator of the application is a page leave event; based on the target application event matched with the application statistical index, adding the event data corresponding to the target application event, and taking the result of the adding processing as the service life of the application corresponding statistical index, wherein the method comprises the following steps: the following processing is performed for any page during the foreground state: dividing a plurality of page leave events associated with a page during a foreground state into a group; and adding the page staying time lengths corresponding to the multiple page leaving events in the group, and taking the added result as the page staying time length of the page in the foreground state.
As shown in fig. 12, in the process of the 1 st App foreground operation (a certain foreground state), multiple page departure events (two a page departure events) associated with the start event during the foreground state are obtained, the two a page departure events are divided into a group a, and page dwell durations corresponding to the multiple a page departure events (i.e., a first dwell duration of the a page and a second dwell duration of the a page) are summed up to obtain a page dwell duration of the a page during the 1 st App foreground state.
In some embodiments, when the statistical indicator is the page stay time of different pages after the application is started, the target application event matched with the statistical indicator of the application is a page leave event; based on the target application event matched with the application statistical index, adding the event data corresponding to the target application event, and taking the result of the adding processing as the service life of the application corresponding statistical index, wherein the method comprises the following steps: executing the following processing aiming at any page after the application is started: dividing a plurality of page leaving events associated with the page after the application is started into a group; and adding the page staying time lengths corresponding to the multiple page leaving events in the group, and taking the result of the adding processing as the page staying time length of the page after the application is started.
As shown in fig. 13, after App is started for the 1 st time, multiple page departure events (two page departure events a) associated with the start event during the foreground state are acquired, the two page departure events a are divided into a group a, and page dwell durations corresponding to the multiple page departure events a (that is, a first dwell duration of the page a and a second dwell duration of the page a) are summed to obtain a page dwell duration of the page a after App is started for the first time.
Next, an exemplary application of the embodiment of the present application in a practical application scenario will be described.
In the related art, the determination modes of App use duration are different, and mainly include two determination modes, as follows:
1) mode 1: app duration is equal to start end time (end _ time) -start time (start _ time)
As shown in fig. 14, in the process of starting the App this time, if the App is switched from the foreground to the background to run, and the running time of the background does not exceed the threshold N seconds, and is switched back to the foreground to run again, the running time of the background is counted into the use time of the App this time; and if the background running time length exceeds the threshold value N seconds, the App is considered to be finished in use. If T2 is less than or equal to N seconds, the using time of App is T1+ T2+ T3; if T2 is greater than N seconds, T1 and T3 are respectively App usage durations of two starts.
2) Mode 2: app duration is the sum of multiple page stay durations
In the starting process, a user starts timing from zero when entering a current page, switches from a foreground to a background in the browsing process, pauses a current page timer, and switches back to the foreground of the App when the running duration of the background is not exceeded, so that the current page continues timing until jumping to other pages or closing the App.
As shown in fig. 15, if the background running duration does not exceed the limited duration, the App use duration is T2+ T3, at this time, T2 is the total duration of two times of page a browsing, and the duration result includes T1; if the background running time length exceeds the limited time length, the starting process is killed, the first browsing time length data (T1) of the page A is lost, the page A enters a new process again, the App use time length is T2+ T3, at the moment, T2 is the second browsing time length data, and the time length result does not contain T1.
The applicant has found the following problems in the course of implementing embodiments of the present application:
1) inaccurate duration statistics: for example, in the mode 1, the statistical result (the usage duration) includes the background operation duration, and if multiple background operations occur, the error between the statistical result and the real result is larger; in the mode 2, data loss may be caused by the fact that the running time of the background exceeds the limit, and the accuracy of a data result is influenced finally;
2) the demand coverage is narrow: for example, the mode 1 can only count App running time; although the mode 2 adds statistics of the page dwell time based on the mode 1, when the detail needs to be broken to each page dwell time, the dwell time of each page cannot be provided.
In order to solve the above problems, embodiments of the present application provide a scheme for counting App usage time and page dwell time, index disassembly is performed through a calculation formula (all events occurring before App is switched to a background are recorded in detail, and subsequent addition and calculation are performed in a targeted manner), accuracy of a time counting index is improved, statistics can be performed on the statistical index according to needs, and usage time is counted.
The following specifically describes a scheme for counting App use duration and page dwell duration provided in the embodiment of the present application, and the scheme can be applied to a platform type product with a clear page structure. As shown in fig. 16, the total App usage duration is equal to the sum of the durations of multiple App foreground operations, which is equal to the 1 st App foreground operation duration + the 2 nd App foreground operation duration + … + the nth App foreground operation duration; the length of a certain foreground operation of the App is equal to the sum of the lengths of multiple times of stay of multiple pages in the foreground operation process, for example, the length of the 1 st foreground operation of the App is equal to the length of the first stay of the page a + the length of the first stay of the page B.
As shown in fig. 17, in the App event reporting process, when an App is started, a start event and an App foreground switching event are reported, and the App starts to time by running a timer; after App is started, entering a home page, reporting a page entering event (aiming at the home page), and starting timing by a page staying timer (aiming at the home page); when leaving the home page, stopping timing by a page staying timer (aiming at the home page) and reporting a page leaving event; after leaving the home page, entering a page A, reporting a page entering event (aiming at the page A), and starting timing by a page staying timer (the page A); when the App leaves, the App runs a timer to stop timing, a page stay timer (page A) stops timing, and a page leaving event (aiming at the page A) and an App background switching event are reported.
Wherein, 5 events related to FIG. 17, the specific event explanation is shown in Table 1
Table 1 event interpretation
Figure BDA0002922369130000201
Figure BDA0002922369130000211
The parameters involved in the 5 events are shown in table 2:
TABLE 2 parameter interpretation
Figure BDA0002922369130000212
The reporting event composition comprises event codes and event data, the event data comprises event parameters and event values, the event data is organized in a Key-Value pair (Key-Value) mode, one reporting event can have a plurality of Key-values, and the event data corresponds to parameter interpretations in a table 2. The form of the reporting event is shown in table 3:
table 3 reporting events
Figure BDA0002922369130000221
As shown in fig. 18, App reports a start event after starting, generates a Session _ id of the current start, and reports the start event. And when the App enters a foreground visible state, generating a Session _ id of the current visible foreground, recording the time when the App enters the foreground, and reporting the Appin event. When the App enters a specific page, generating a Pageview _ id of the current page, recording the page entering time and reporting the PageIn event. When App is switched, generating a next page Pageview _ id, calculating the retention time of the page, and reporting a PageOut event and a next page PageIn event. When the App is switched to the invisible state of the background, reporting a PageOut event of the current page, calculating the stay time of the App and reporting an Appout event.
The specific duration statistical scheme is as follows:
a) the using time of App is started each time: (i and ii schemes can mutually verify the accuracy)
i. Grouping according to the Session _ id, taking Launch _ duration data of the ApPout event in each group for addition processing, and obtaining the use duration of each App (corresponding to different Session _ id);
ii, grouping according to the Session _ id, and adding and processing the Page _ duration data of the PageOut event in each group to obtain the use duration of each App (corresponding to different Session _ id);
b) the running time of different runs (Launch _ id) of a certain starting process: (i and ii schemes can mutually verify the accuracy)
i. Fixing the Session _ id, and obtaining the Launch _ duration in the ApPout event including the Session _ id to know the duration of each App operation (corresponding to different Launch _ ids);
ii, fixing Session _ id, grouping according to Launch _ id, taking page _ duration of PageOut event in each group for addition processing, and obtaining duration of each App operation (corresponding to different Launch _ id);
c) the page dwell time of different pages in a certain running process is as follows: and fixing Launch _ id, grouping according to the Pagene, and adding and processing the page _ duration of the PageOut event in each group, namely knowing the page dwell time of different pages in the operation process. For example, in the process of the 1 st App foreground operation in fig. 16, the page dwell time of the page a is equal to the first dwell time of the page a, and the page dwell time of the page B is equal to the first dwell time of the page B;
d) the page dwell time of different pages in a certain starting process is as follows: and fixing Session _ id, grouping according to Pagene, and adding page _ duration of PageOut event in each group, so as to know the page dwell time of different pages in the operation process. For example, as in the starting process in fig. 16, the page dwell time of the a page is equal to the a page first dwell time, and the page dwell time of the B page is equal to the B page first dwell time + the B page second dwell time.
To sum up, the scheme for counting the App service duration and the page dwell time provided by the embodiment of the application performs index disassembly through a calculation formula, improves the accuracy of the duration counting index, is not limited to counting the running time, and also comprises counting the dwell time of various pages to increase the coverage of the demand.
The application-based usage duration processing method provided by the embodiment of the present application has been described so far with reference to the exemplary application and implementation of the terminal provided by the embodiment of the present application, and the following continues to describe a scheme in which each module in the application-based usage duration processing apparatus 555 provided by the embodiment of the present application cooperates to implement usage duration processing.
An obtaining module 5551, configured to obtain a plurality of application events that respectively and correspondingly occur during each foreground state by an application; a data module 5552, configured to generate event data corresponding to each of the plurality of application events of the application based on the plurality of application events, where the event data includes duration data; a determining module 5553, configured to determine a target application event matching the statistical indicator of the application from the plurality of application events; a processing module 5554, configured to sum event data corresponding to a target application event based on the target application event matched with the statistical indicator of the application, and use a result of the sum as a usage duration of the statistical indicator corresponding to the application.
In some embodiments, the obtaining module 5551 is further configured to, for each foreground state of the application: collecting a plurality of state switching data of the application through a code buried point; determining, based on the plurality of state-switch data, a plurality of application events that occur during the foreground state by the application.
In some embodiments, the application events include a start event and a run event; the obtaining module 5551 is further configured to obtain a start event occurring during the foreground state of the application when the state switching data of the application indicates switching from an off state to a start state; and when the state switching data of the application represent that the application is in the starting state and is not switched to the background state of the application, acquiring the running event of the application during the foreground state.
In some embodiments, the running events include a foreground event and a page event; the obtaining module 5551 is further configured to obtain a foreground state event occurring during a foreground state of the application when the state switching data of the application indicates that the application is in a foreground state switching occasion; and when the state switching data of the application represent that the application is in the page state switching opportunity, acquiring a page event occurring in the foreground state period of the application.
In some embodiments, the foreground state events include a foreground entry event and a foreground exit event; the obtaining module 5551 is further configured to obtain a foreground entering event occurring during the foreground state of the application when the foreground state switching occasion indicates that the application is switched from the starting state or the background state to the foreground state; and when the foreground state switching occasion represents that the application leaves the foreground state, acquiring a foreground leaving event which occurs in the foreground state period of the application.
In some embodiments, the page events include page enter events and page leave events; the obtaining module 5551 is further configured to obtain a page entry event that occurs during the foreground state of the application when the page state switching occasion indicates that the page of the application is switched from an invisible state to a visible state; and when the page state switching opportunity represents that the page of the application is switched from the visible state to the invisible state, acquiring a page leaving event occurring during the foreground state of the application.
In some embodiments, the data module 5552 is further configured to perform the following for any of the plurality of application events: when the application event of the application has an incidence relation with other application events, acquiring event parameters and event parameter values of the other application events; generating an event parameter and an event parameter value of the application event based on the application event; and taking the combination of the event parameters and the event parameter values of the other application events and the event parameters and the event parameter values of the application events as the event data of the application events.
In some embodiments, the application events include a launch event, a foreground entry event, a page entry event, and a page exit event; the data module 5552 is further configured to, when an association relationship exists between a page leaving event of the application and the start event, the foreground entering event, and the page entering event, obtain event parameters and event parameter values corresponding to the start event, the foreground entering event, and the page entering event, respectively; acquiring the page stay time of the page departure event based on the timer corresponding to the page departure event of the application; and recording the event parameter value of the page leaving event as the page stay time.
In some embodiments, the application events include a launch event, a foreground entry event, and a foreground exit event; the data module 5552 is further configured to, when a foreground exiting event of the application has an association relationship with the start event and the foreground entering event, obtain an event parameter and an event parameter value corresponding to the start event and the foreground entering event respectively; acquiring the foreground running time of the foreground leaving event based on the timer corresponding to the foreground leaving event of the application; recording the event parameter value of the foreground leaving event as the foreground running duration.
In some embodiments, when the statistical indicator is the usage duration after each application is started, the target application event matched with the statistical indicator of the application is a foreground leaving event; the processing module 5554 is further configured to determine a first start event and a second start event corresponding to the application, where the first start event is before the second start event; dividing foreground leaving events between the first initiating event and the second initiating event into a group; acquiring a plurality of foreground leaving events in the group; and adding and processing the foreground running durations respectively corresponding to the plurality of foreground leaving events, and taking the result of the adding and processing as the use duration of the application after corresponding to the first starting event.
In some embodiments, when the statistical indicator is the usage duration after each application is started, the target application event matched with the statistical indicator of the application is a page leaving event; the processing module 5554 is further configured to determine a first start event and a second start event corresponding to the application, where the first start event is before the second start event; dividing page leave events between the first start event and the second start event into a group; acquiring a plurality of page leaving events in the group; and adding the page stay time lengths corresponding to the plurality of page leaving events respectively, and taking the result of the adding as the use time length of the application after corresponding to the first starting event.
In some embodiments, when the statistical indicator is a runtime length in a different foreground state, the target application event matching the statistical indicator of the application is a foreground departure event; the processing module 5554 is further configured to perform the following for any of the foreground states: obtaining the foreground leaving event associated with the starting event during the foreground state based on the event parameter of the starting event of the application; and taking the foreground running time corresponding to the foreground leaving event as the running time of the foreground state.
In some embodiments, when the statistical indicator is a runtime length of a different foreground state, the target application event matching the statistical indicator of the application is a page leave event; the processing module 5554 is further configured to perform the following for any of the foreground states: obtaining a plurality of page leaving events associated with the start event during the foreground state based on event parameters of the start event of the application; and adding the page staying time lengths corresponding to the multiple page leaving events respectively, and taking the result of the adding as the running time length of the foreground state.
In some embodiments, when the statistical indicator is a page dwell time of a different page during a foreground state, the target application event matching the statistical indicator of the application is a page leave event; the processing module 5554 is further configured to perform the following for any page during the foreground state: dividing a plurality of the page leave events associated with the page during the foreground state into a group; and adding the page staying time lengths corresponding to the multiple page leaving events in the group, and taking the result of the adding as the page staying time length of the page in the foreground state.
In some embodiments, when the statistical indicator is a page stay time of a different page after the application is started, the target application event matched with the statistical indicator of the application is a page leave event; the processing module 5554 is further configured to execute the following processing for any page after the application is started: dividing a plurality of the page departure events associated with the page after the application is started into a group; and adding the page staying time lengths corresponding to the multiple page leaving events in the group, and taking the result of the adding as the page staying time length of the page after the application is started.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, so that the computer device executes the application-based usage duration processing method according to the embodiment of the present application.
Embodiments of the present application provide a computer-readable storage medium storing executable instructions, which when executed by a processor, cause the processor to execute an application-based duration processing method provided by embodiments of the present application, for example, the application-based duration processing method shown in fig. 3A to 3C.
In some embodiments, the computer-readable storage medium may be memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
In some embodiments, executable instructions may be written in any form of programming language (including compiled or interpreted languages), in the form of programs, software modules, scripts or code, and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
By way of example, executable instructions may correspond, but do not necessarily have to correspond, to files in a file system, and may be stored in a portion of a file that holds other programs or data, such as in one or more scripts in a hypertext Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
By way of example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices at one site or distributed across multiple sites and interconnected by a communication network.
The above description is only an example of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, and improvement made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims (18)

1. An application-based use duration processing method, the method comprising:
acquiring a plurality of application events which respectively and correspondingly occur during each foreground state of an application;
generating event data corresponding to a plurality of application events of the application respectively based on the plurality of application events, wherein the event data comprises duration data;
determining a target application event from the plurality of application events that matches the statistical indicator of the application;
and adding event data corresponding to the target application event based on the target application event matched with the statistical index of the application, and taking the result of the addition as the service life of the statistical index corresponding to the application.
2. The method of claim 1, wherein obtaining a plurality of application events respectively occurring during each foreground state by the application comprises:
performing the following for each foreground state period of the application:
collecting a plurality of state switching data of the application through a code buried point;
determining, based on the plurality of state-switch data, a plurality of application events that occur during the foreground state by the application.
3. The method of claim 2,
the application events comprise starting events and running events;
the determining, based on the plurality of state-switch data, a plurality of application events that occur during the foreground state by the application comprises:
when the state switching data representation of the application is switched from a closed state to a starting state, acquiring a starting event occurring during the foreground state of the application;
and when the state switching data of the application represent that the application is in the starting state and is not switched to the background state of the application, acquiring the running event of the application during the foreground state.
4. The method of claim 3,
the running events comprise foreground events and page events;
the obtaining of the running event occurring during the foreground state of the application includes:
when the state switching data of the application represents the switching time of the application in the foreground state, acquiring a foreground state event occurring in the foreground state period of the application;
and when the state switching data of the application represent that the application is in the page state switching opportunity, acquiring a page event occurring in the foreground state period of the application.
5. The method of claim 4,
the foreground state events comprise a foreground entering event and a foreground leaving event;
the acquiring a foreground state event that occurs during the foreground state of the application includes:
when the foreground state switching occasion represents that the application is switched from the starting state or the background state to the foreground state, acquiring a foreground entering event occurring during the foreground state of the application;
and when the foreground state switching occasion represents that the application leaves the foreground state, acquiring a foreground leaving event which occurs in the foreground state period of the application.
6. The method of claim 4,
the page event comprises a page entering event and a page leaving event;
the obtaining of the running event occurring during the foreground state of the application includes:
when the page state switching occasion represents that the page of the application is switched from the invisible state to the visible state, acquiring a page entering event occurring during the foreground state of the application;
and when the page state switching opportunity represents that the page of the application is switched from the visible state to the invisible state, acquiring a page leaving event occurring during the foreground state of the application.
7. The method according to claim 1, wherein the generating event data corresponding to a plurality of application events of the application based on the plurality of application events comprises:
performing the following for any of the plurality of application events:
when the application event of the application has an incidence relation with other application events, acquiring event parameters and event parameter values of the other application events;
generating an event parameter and an event parameter value of the application event based on the application event;
and taking the combination of the event parameters and the event parameter values of the other application events and the event parameters and the event parameter values of the application events as the event data of the application events.
8. The method of claim 7,
the application events comprise a starting event, a foreground entering event, a page entering event and a page leaving event;
when the application event of the application has an incidence relation with other application events, acquiring event parameters and event parameter values of the other application events, including:
when the page leaving event of the application has an incidence relation with the starting event, the foreground entering event and the page entering event, acquiring event parameters and event parameter values corresponding to the starting event, the foreground entering event and the page entering event respectively;
the generating the event parameter and the event parameter value of the application event based on the application event comprises:
acquiring the page stay time of the page departure event based on the timer corresponding to the page departure event of the application;
and recording the event parameter value of the page leaving event as the page stay time.
9. The method of claim 7,
the application events comprise a starting event, a foreground entering event and a foreground leaving event;
when the application event of the application has an incidence relation with other application events, acquiring event parameters and event parameter values of the other application events, including:
when the foreground leaving event of the application has an incidence relation with the starting event and the foreground entering event, acquiring event parameters and event parameter values respectively corresponding to the starting event and the foreground entering event;
the generating the event parameter and the event parameter value of the application event based on the application event comprises:
acquiring the foreground running time of the foreground leaving event based on the timer corresponding to the foreground leaving event of the application;
recording the event parameter value of the foreground leaving event as the foreground running duration.
10. The method of claim 1,
when the statistical index is the use duration after the application is started each time, the target application event matched with the statistical index of the application is a foreground leaving event;
the summing processing of the event data corresponding to the target application event based on the target application event matched with the statistical index of the application, and taking the result of the summing processing as the service life of the statistical index corresponding to the application, includes:
determining a first starting event and a second starting event corresponding to the application, wherein the first starting event is before the second starting event;
dividing foreground leaving events between the first initiating event and the second initiating event into a group;
acquiring a plurality of foreground leaving events in the group;
and adding and processing the foreground running durations respectively corresponding to the plurality of foreground leaving events, and taking the result of the adding and processing as the use duration of the application after corresponding to the first starting event.
11. The method of claim 1,
when the statistical index is the use duration after the application is started each time, the target application event matched with the statistical index of the application is a page leaving event;
the summing processing of the event data corresponding to the target application event based on the target application event matched with the statistical index of the application, and taking the result of the summing processing as the service life of the statistical index corresponding to the application, includes:
determining a first starting event and a second starting event corresponding to the application, wherein the first starting event is before the second starting event;
dividing page leave events between the first start event and the second start event into a group;
acquiring a plurality of page leaving events in the group;
and adding the page stay time lengths corresponding to the plurality of page leaving events respectively, and taking the result of the adding as the use time length of the application after corresponding to the first starting event.
12. The method of claim 1,
when the statistical indexes are running lengths of different foreground states, the target application event matched with the statistical indexes of the application is a foreground leaving event;
the summing processing of the event data corresponding to the target application event based on the target application event matched with the statistical index of the application, and taking the result of the summing processing as the service life of the statistical index corresponding to the application, includes:
executing the following processing aiming at any foreground state:
obtaining the foreground leaving event associated with the starting event during the foreground state based on the event parameter of the starting event of the application;
and taking the foreground running time corresponding to the foreground leaving event as the running time of the foreground state.
13. The method of claim 1,
when the statistical indexes are running lengths of different foreground states, the target application event matched with the statistical indexes of the application is a page leaving event;
the summing processing of the event data corresponding to the target application event based on the target application event matched with the statistical index of the application, and taking the result of the summing processing as the service life of the statistical index corresponding to the application, includes:
executing the following processing aiming at any foreground state:
obtaining a plurality of page leaving events associated with the start event during the foreground state based on event parameters of the start event of the application;
and adding the page staying time lengths corresponding to the multiple page leaving events respectively, and taking the result of the adding as the running time length of the foreground state.
14. The method of claim 1,
when the statistical index is the page stay time of different pages in the foreground state, the target application event matched with the statistical index of the application is a page leaving event;
the summing processing of the event data corresponding to the target application event based on the target application event matched with the statistical index of the application, and taking the result of the summing processing as the service life of the statistical index corresponding to the application, includes:
performing the following for any page during the foreground state:
dividing a plurality of the page leave events associated with the page during the foreground state into a group;
and adding the page staying time lengths corresponding to the multiple page leaving events in the group, and taking the result of the adding as the page staying time length of the page in the foreground state.
15. The method of claim 1,
when the statistical index is the page stay time of different pages after the application is started, the target application event matched with the statistical index of the application is a page leaving event;
the summing processing of the event data corresponding to the target application event based on the target application event matched with the statistical index of the application, and taking the result of the summing processing as the service life of the statistical index corresponding to the application, includes:
executing the following processing aiming at any page after the application is started:
dividing a plurality of the page departure events associated with the page after the application is started into a group;
and adding the page staying time lengths corresponding to the multiple page leaving events in the group, and taking the result of the adding as the page staying time length of the page after the application is started.
16. An application-based usage duration processing apparatus, the apparatus comprising:
the acquisition module is used for acquiring a plurality of application events which respectively and correspondingly occur during each foreground state;
a data module, configured to generate event data corresponding to a plurality of application events of the application, based on the plurality of application events, where the event data includes duration data;
a determining module, configured to determine, from the plurality of application events, a target application event that matches a statistical indicator of the application;
and the processing module is used for summing event data corresponding to the target application event based on the target application event matched with the statistical index of the application, and taking the result of the summing processing as the service life of the statistical index corresponding to the application.
17. An electronic device, characterized in that the electronic device comprises:
a memory for storing executable instructions;
a processor configured to implement the application-based duration of use processing method of any one of claims 1 to 15 when executing the executable instructions stored in the memory.
18. A computer-readable storage medium storing executable instructions for implementing the application-based duration of use processing method of any one of claims 1 to 15 when executed by a processor.
CN202110121311.3A 2021-01-28 2021-01-28 Application-based use duration processing method, device, equipment and storage medium Pending CN112732546A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110121311.3A CN112732546A (en) 2021-01-28 2021-01-28 Application-based use duration processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110121311.3A CN112732546A (en) 2021-01-28 2021-01-28 Application-based use duration processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112732546A true CN112732546A (en) 2021-04-30

Family

ID=75594411

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110121311.3A Pending CN112732546A (en) 2021-01-28 2021-01-28 Application-based use duration processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112732546A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116662130A (en) * 2022-11-21 2023-08-29 荣耀终端有限公司 Method for counting application use time length, electronic equipment and readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109324946A (en) * 2018-09-10 2019-02-12 天津字节跳动科技有限公司 Operational monitoring method, apparatus, electronic equipment and computer readable storage medium
CN110489654A (en) * 2019-09-12 2019-11-22 五八有限公司 Obtain method, apparatus, electronic equipment and the storage medium of user interest degree
CN110633255A (en) * 2018-06-05 2019-12-31 北京世纪好未来教育科技有限公司 Method and device for acquiring user use duration
CN111241453A (en) * 2020-01-20 2020-06-05 平安科技(深圳)有限公司 Page access time length acquisition method, device, medium and electronic equipment
WO2020216580A1 (en) * 2019-04-25 2020-10-29 Thomson Licensing Method for monitoring usage of at least one application executed within an operating system, corresponding apparatus, computer program product and computer-readable carrier medium
CN112000541A (en) * 2020-07-23 2020-11-27 招联消费金融有限公司 Buried point data reporting method and device, computer equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110633255A (en) * 2018-06-05 2019-12-31 北京世纪好未来教育科技有限公司 Method and device for acquiring user use duration
CN109324946A (en) * 2018-09-10 2019-02-12 天津字节跳动科技有限公司 Operational monitoring method, apparatus, electronic equipment and computer readable storage medium
WO2020216580A1 (en) * 2019-04-25 2020-10-29 Thomson Licensing Method for monitoring usage of at least one application executed within an operating system, corresponding apparatus, computer program product and computer-readable carrier medium
CN110489654A (en) * 2019-09-12 2019-11-22 五八有限公司 Obtain method, apparatus, electronic equipment and the storage medium of user interest degree
CN111241453A (en) * 2020-01-20 2020-06-05 平安科技(深圳)有限公司 Page access time length acquisition method, device, medium and electronic equipment
CN112000541A (en) * 2020-07-23 2020-11-27 招联消费金融有限公司 Buried point data reporting method and device, computer equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116662130A (en) * 2022-11-21 2023-08-29 荣耀终端有限公司 Method for counting application use time length, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN105872837B (en) User's recommended method and device
CN110267059B (en) Live broadcast method and device, electronic equipment and storage medium
Kahng et al. Statistical foundations of virtual democracy
CN109671320B (en) Rapid calculation exercise method based on voice interaction and electronic equipment
CN112689155B (en) Virtual resource pushing method and device and server
CN109446031B (en) Control method of terminal equipment, terminal and readable storage medium
CN109636218B (en) Learning content recommendation method and electronic equipment
CN110704750A (en) Article pushing method, article pushing device, article pushing equipment and storage medium based on user tags
WO2015051750A1 (en) Determining ranking threshold for applications
CN108960587A (en) Evaluation method, device and the readable storage medium storing program for executing of purchase of property consulting services quality
CN113383362B (en) User identification method and related product
CN107358471A (en) A kind of tourist resources based on visit behavior recommends method and system
CN110619772A (en) Data processing method, device, equipment and medium
CN109409952A (en) A kind of marketing data acquisition system and method based on block chain
CN110162360A (en) Intelligent helping method, device and computer readable storage medium
CN112732546A (en) Application-based use duration processing method, device, equipment and storage medium
CN107648854B (en) Game classification method and device and electronic equipment
CN110781998A (en) Recommendation processing method and device based on artificial intelligence
CN110765348A (en) Hot word recommendation method and device, electronic equipment and storage medium
CN111046156B (en) Method, device and server for determining rewarding data
CN107786561B (en) Application use duration management and control method and client
CN111581518A (en) Information pushing method and device
US20240091643A1 (en) Method and apparatus for controlling virtual objects in game, and electronic device and storage medium
CN106332054A (en) Method and device for identifying verification in data migration
CN112308582A (en) Resource processing method and device, storage medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40042611

Country of ref document: HK