Data collection method, device, computer equipment and storage medium

By determining the exchange processing of key native functions and custom data collection functions in the application, the performance problems caused by code confusion in the traditional method are solved, the data collection efficiency is improved, and efficient operation behavior data collection is achieved.

CN109446067BActive Publication Date: 2024-09-13CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201811122839.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-09-26
Publication Date
2024-09-13
Estimated Expiration
2038-09-26

AI Technical Summary

Technical Problem

The traditional method embeds statistical code in the business code of the application, resulting in mixed code, affecting the performance of the application, and low data collection efficiency.

Method used

Determine key native functions and custom data collection functions when the application starts, perform function exchange processing, listen to operation events, and collect operation behavior data through the exchanged data collection functions to avoid mixing statistical code in business code.

Benefits of technology

It improves application performance and data collection efficiency, and enables the collection of operational behavior data without affecting normal data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN109446067B
    Figure CN109446067B
Patent Text Reader

Abstract

The present application relates to a data collection method, device, computer equipment and storage medium based on the field of big data technology. The method includes: when the application is started, determining the key native function; performing function exchange processing on the key native function and the custom data collection function; during the operation of the application, monitoring the operation events for the application; when the native function to be called by the monitored operation event is the key native function, the operation behavior data corresponding to the operation event is collected by calling the data collection function exchanged with the key native function; after the data collection is completed, triggering the call of the key native function to perform the processing corresponding to the operation event. Using this method for data collection can improve the performance of the application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data collection method, apparatus, computer equipment and storage medium. Background Art

[0002] With the rapid development of science and technology, the types and functions of applications (APP) are becoming more and more diverse. With the rapid development of science and technology, the types and functions of applications are becoming more and more diverse. In people's daily work, study and life, they often need to use various applications to handle corresponding things. Usually, when users use applications, it is necessary to collect statistics on users' operation behavior data for targeted analysis.

[0003] In the traditional method, developers need to proactively embed a large amount of statistical code in the business code during the application development phase, and use the embedded statistical code to collect statistics on the user's operation behavior during the use of the application. Obviously, in the traditional method, mixing statistical code with business code will lead to code confusion, which will affect the performance of the application and lead to poor performance of the application. Summary of the invention

[0004] Based on this, it is necessary to provide a data collection method, device, computer equipment and storage medium that can improve the performance of application programs in response to the above technical problems.

[0005] A data collection method, the method comprising:

[0006] When the application starts, identify key native functions;

[0007] Perform function exchange processing on the key native function and the custom data collection function;

[0008] During the running of the application, monitoring operation events for the application;

[0009] When the native function to be called by the monitored operation event is the key native function,

[0010] Collecting operation behavior data corresponding to the operation event by calling a data collection function exchanged with the key native function;

[0011] After the data is collected, the key native function is triggered to execute processing corresponding to the operation event.

[0012] In one embodiment, when the application is started, determining the key native function includes:

[0013] When the application starts, a startup notification is sent to the server;

[0014] receiving a data acquisition instruction sent by the server after receiving the start notification;

[0015] Extracting the data type identifier carried in the data acquisition instruction;

[0016] A native function that processes data corresponding to the data type identifier is used as a key native function.

[0017] In one embodiment, when the application is started, determining the key native function includes:

[0018] When the application is started, obtaining a type identifier corresponding to the application;

[0019] Get the correspondence between the preset key native functions and type identifiers;

[0020] According to the corresponding relationship, a key native function corresponding to the found type identifier is determined.

[0021] In one embodiment, when the application is started, determining the key native function includes:

[0022] When the application is started, obtaining a key function identifier pre-added for the application;

[0023] Matching the key function identifier with a native function provided by the operating system;

[0024] A native function provided by the operating system and matching the key function identifier is used as the key native function.

[0025] In one of the embodiments, after determining the key native function when the application is started, the method further includes:

[0026] Add corresponding key tags to the identified key native functions;

[0027] During the running of the application, after monitoring the operation events for the application, the method further includes:

[0028] Determine the native function to be called for the monitored operation event;

[0029] Detecting whether the determined native function has a corresponding key tag;

[0030] When the native function has a corresponding key tag, the native function is determined to be a key native function.

[0031] In one embodiment, the method further comprises:

[0032] Acquire the operation behavior data collected by the data collection function;

[0033] Performing feature extraction on the operation behavior data;

[0034] The extracted feature data is reported to the server.

[0035] In one embodiment, the operation behavior data includes text data; the feature data is a feature vector; and the feature extraction of the operation behavior data includes:

[0036] Perform word segmentation on the text's operation behavior data to obtain word fragments;

[0037] Extract keyword segments from each word segment;

[0038] Quantizing each of the extracted keyword fragments into a corresponding word vector;

[0039] The obtained word vectors are combined according to the order of corresponding positions in the operation behavior data to obtain the feature vector of the operation behavior data.

[0040] A data collection device, comprising:

[0041] The key function determination module is used to determine the key native function when the application starts;

[0042] A function exchange module, used for performing function exchange processing between the key native function and the custom data collection function;

[0043] A data collection module, used to monitor operation events for the application during the running of the application; when the native function to be called by the monitored operation event is the key native function, collect the operation behavior data corresponding to the operation event by calling the data collection function exchanged with the key native function;

[0044] The processing module is used to trigger the calling of the key native function to execute the processing corresponding to the operation event after the data collection is completed.

[0045] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0046] When the application starts, identify key native functions;

[0047] Perform function exchange processing on the key native function and the custom data collection function;

[0048] During the running of the application, monitoring operation events for the application;

[0049] When the native function to be called by the monitored operation event is the key native function,

[0050] Collecting operation behavior data corresponding to the operation event by calling a data collection function exchanged with the key native function;

[0051] After the data is collected, the key native function is triggered to execute processing corresponding to the operation event.

[0052] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0053] When the application starts, identify key native functions;

[0054] Perform function exchange processing on the key native function and the custom data collection function;

[0055] During the running of the application, monitoring operation events for the application;

[0056] When the native function to be called by the monitored operation event is the key native function,

[0057] Collecting operation behavior data corresponding to the operation event by calling a data collection function exchanged with the key native function;

[0058] After the data is collected, the key native function is triggered to execute processing corresponding to the operation event.

[0059] The above-mentioned data collection method, device, computer equipment and storage medium determine the key native function when the application is started; perform function exchange processing on the key native function and the customized data collection function; monitor the operation events for the application during the operation of the application; when the native function to be called by the monitored operation event is the key native function, collect the operation behavior data corresponding to the operation event by calling the data collection function exchanged with the key native function; after the data collection is completed, trigger the call of the key native function to perform the processing corresponding to the operation event. This is equivalent to realizing the collection of operation behavior data through function exchange without affecting normal data processing, without the need to embed statistical code in the business code like the traditional method, avoiding the problem of mixing statistical code in the business code and affecting the performance of the application, thereby improving the performance of the application. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 An application scenario diagram of a data collection method in an embodiment;

[0061] Figure 2 is a flow chart of a data collection method in one embodiment;

[0062] Figure 3 A flowchart of the steps for determining a key native function in one embodiment;

[0063] Figure 4 A schematic diagram of a data reporting process in an embodiment;

[0064] Figure 5 is a structural block diagram of a data collection device in one embodiment;

[0065] Figure 6 is a structural block diagram of a data collection device in another embodiment;

[0066] Figure 7 is a structural block diagram of a feature extraction module in one embodiment;

[0067] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0068] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0069] The data collection method provided in this application can be applied to Figure 1 In the application environment shown. Among them, the terminal 110 communicates with the server 120 through the network. Among them, the terminal 110 can be but not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 120 can be implemented with an independent server or a server cluster composed of multiple servers. It should be noted that an application is installed in the terminal 110. The data collection method provided in each embodiment of the present application is mainly used to perform performance monitoring on the target application to be monitored installed locally in the terminal 110.

[0070] The terminal 110 can determine the key native function when the application is started; and perform function exchange processing on the key native function and the custom data collection function. During the operation of the application, the terminal 110 can monitor the operation events for the application. When the native function to be called by the monitored operation event is a key native function, the terminal 110 can collect the operation behavior data corresponding to the operation event by calling the data collection function exchanged with the key native function. After the data collection is completed, the terminal 110 can trigger the call of the key native function to perform the processing corresponding to the operation event. Furthermore, the terminal 110 can also report the collected operation behavior data to the server 120, so that the server 120 can perform corresponding analysis and processing based on the reported operation behavior data. It should be noted that in other embodiments, the terminal 110 can also analyze the collected operation behavior data locally without reporting it to the server 120. The embodiment of the present application does not limit whether the collected operation behavior data is reported.

[0071] In one embodiment, Figure 2 As shown, a data collection method is provided, which is applied to Figure 1 The terminal 110 in the example is used as an example to illustrate, and the following steps are included:

[0072] S202, when the application is started, determining key native functions.

[0073] Among them, native functions are functions that come with the system, and key native functions are key native functions that need to be exchanged.

[0074] Function swapping means swapping the target function that you actually want to call with other functions, so that when you want to call the target function, the function that is swapped with it is called first, and then the target function is called. For example, if you swap function A with function B, then when you want to call function A during data processing, you will call function B first, and then call function A after function B is called.

[0075] In one embodiment, the key native function can be pre-set when developing the application. That is, the R&D personnel can pre-specify the key native function from the native function according to actual needs. In one embodiment, step S202 determines the key native function when the application starts, including: when the application starts, obtaining the key function identifier pre-added for the application; matching the key function identifier with the native function provided by the operating system; and using the native function matching the key function identifier in the native function provided by the operating system as the key native function.

[0076] Among them, the key function identifier is used to uniquely identify the key native function corresponding to the application.

[0077] Specifically, the developer can pre-specify the key native function corresponding to the application and add the corresponding key function identifier to the application. The terminal can match the key function identifier with the native function provided by the operating system and use the native function that matches the key function identifier among the native functions provided by the operating system as the key native function.

[0078] In the above embodiment, key native functions can be specified at the application level, which is equivalent to different applications corresponding to different key native functions. This takes into account the differentiated factors of the data required to be collected due to different applications, thereby improving the targeting and accuracy.

[0079] In other embodiments, the key native functions may also be analyzed accordingly when the application is started, so as to dynamically determine the key native functions from the native functions of the system.

[0080] S204, performing function exchange processing on the key native function and the custom data collection function.

[0081] The behavior data function is a custom function used to collect operation behavior data. It can be understood that the custom data collection function is not a native function that comes with the system.

[0082] Specifically, the terminal can use the runtime mechanism to modify the first function pointer corresponding to the function number targeted by the operation event to the second function pointer, so as to exchange the key native function with the custom data collection function. In this way, when data processing is required during the running of the application, the custom data collection function can be called first, and then the key native function can be called.

[0083] The first function pointer is used to store the address of the key native function. The second function pointer is used to store the address of the custom function. The function number (SEL, selector) represents the signature of the function and does not point to the function. The function pointer (IMP) stores the address of the function.

[0084] S206: During the running of the application, monitor operation events for the application.

[0085] Among them, the operation event is an operation that can be recognized by the control.

[0086] Specifically, during the running of the application, the user can operate the application. Each operation of the user that can be recognized by the control is an operation event. The terminal can monitor the operation events for the application.

[0087] S208, when the native function to be called by the monitored operation event is a key native function, the operation behavior data corresponding to the operation event is collected by calling a data collection function that exchanges with the key native function.

[0088] It can be understood that, under normal circumstances, each operation event needs to call the corresponding native function for processing. Each operation event corresponds to certain operation behavior data. The operation behavior data is the description information of the operation behavior represented by the operation event.

[0089] The terminal can determine whether the native function to be called by the monitored operation event is a key native function. If so, the terminal calls the custom data collection function that is exchanged with the key native function, and collects the operation behavior data corresponding to the operation event through the called data collection function. In one embodiment, when the native function to be called by the monitored operation event is a key native function, the terminal can intercept the call to the key native function, and determine the custom data collection function after the exchange with the key native function based on the exchange relationship recorded when the function is exchanged.

[0090] It can be understood that when the native function that the monitored operation event wants to call is not a critical native function, since the native function of the non-critical native function is not subjected to function exchange processing, the native function that is wanted to be called can be directly called to perform processing corresponding to the operation event.

[0091] S210, after the data collection is completed, triggering and calling a key native function to execute processing corresponding to the operation event.

[0092] It can be understood that after the data collection is completed, the terminal can be triggered to call the native function to be called by the operation event, and the processing corresponding to the operation event is performed through the native function. This is equivalent to realizing the collection of operation behavior data without affecting normal data processing.

[0093] In one embodiment, the terminal may report the collected operation behavior data to the server. It is understood that the terminal may directly report the collected original operation behavior data to the server. The terminal may also extract key data from the collected original operation behavior data and then report the extracted key data.

[0094] The above data collection method determines the key native function when the application starts; performs function exchange processing on the key native function and the custom data collection function; monitors the operation events for the application during the operation of the application; when the native function to be called by the monitored operation event is the key native function, the operation behavior data corresponding to the operation event is collected by calling the data collection function exchanged with the key native function; after the data collection is completed, the key native function is triggered to perform the processing corresponding to the operation event. This is equivalent to collecting the operation behavior data through function exchange without affecting the normal data processing, without the need to embed statistical code in the business code like the traditional method, avoiding the problem of mixing statistical code in the business code and affecting the performance of the application, thereby improving the performance of the application.

[0095] In addition, the collection of operation behavior data is achieved through function exchange, which avoids the problem of low overall efficiency of data collection caused by the traditional method of pre-embedded statistical codes that consumes a lot of time, thereby improving the efficiency of data collection.

[0096] like Figure 3 As shown, in one embodiment, step S202 determines the key native function when the application is started (hereinafter referred to as the key native function determination step), which specifically includes the following steps:

[0097] S302: When the application is started, a startup notification is sent to the server.

[0098] Among them, the startup notification is used to inform the application of the startup event.

[0099] Specifically, when the application is started, the terminal may send a startup notification to the server to inform the server that the application has been started.

[0100] S304, receiving a data acquisition command sent by the server after receiving the start notification.

[0101] The data acquisition command is a command used to instruct the terminal to acquire operation behavior data.

[0102] Specifically, after receiving the start notification, the server may send a data acquisition command to the terminal.

[0103] It is understood that after receiving the startup notification, the server can automatically generate a data acquisition command and send it to the terminal. In one embodiment, the server stores configuration information for triggering the generation of the data acquisition command. According to the configuration information, the server can automatically generate a data acquisition command and send it to the terminal. The configuration information for triggering the generation of the data acquisition command may include information such as a data type identifier.

[0104] In other embodiments, after receiving the start notification, the server may forward the notification to the technical terminal used by the technician for obtaining the operation behavior data. The technician can select the data type of the operation behavior data to be obtained on the technical terminal, and the technical terminal obtains the corresponding data type identifier and reports it to the server to trigger the server to generate a data acquisition command according to the selected data type identifier, and send the data acquisition command to the terminal (it can be understood that the "terminal" here is the user terminal where the application from which the operation behavior data is collected is installed, rather than the technical terminal used by the technician).

[0105] S306: extract the data type identifier carried in the data acquisition command.

[0106] It can be understood that the data acquisition command includes the data type identifier. In other embodiments, the data acquisition command may also include other information besides the data type identifier, which is not limited thereto.

[0107] Among them, the data type identifier uniquely identifies the data type. The data type is the type obtained by dividing the operation behavior data according to the behavior action object. The behavior action object is the object targeted by the user operation behavior. The behavior action object includes the interface, function control, etc. Therefore, the data type can include the interface display class and the function control class, etc.

[0108] Furthermore, the data type may also include secondary classification types under the interface display class and the function control class. That is, the interface display class and the function control class are primary classification types. In one embodiment, the secondary classification types of the interface display class include the static page display class and the dynamic page jump class. The secondary classification type of the function control class may be an actual function control, that is, each function control is a secondary classification type.

[0109] It should be noted that the key native function corresponding to the data type identifier of the first-level classification type may include all or part of the key native functions corresponding to all second-level classification types under the first-level classification type.

[0110] Specifically, the terminal may parse the data acquisition command to extract the data type identifier carried in the data acquisition command.

[0111] S308 : Use a native function that processes data corresponding to the data type identifier as a key native function.

[0112] In one embodiment, the terminal stores the correspondence between the data type identifier and the native function. The correspondence is set according to the data type identifier of the native function and the data processed by the native function, that is, the native function is used to process the data with the data type identifier having the correspondence relationship with it. The terminal can obtain the native function corresponding to the extracted data type identifier according to the correspondence, and use the native function as the key native function.

[0113] For ease of understanding, the process of determining key native functions is explained with examples. For example, if a technician wants to collect operational behavior data of a functional control class (i.e., the user's operational behavior data on the control), he can send a data acquisition command through the server, and the terminal can use the native function UIControl corresponding to the data type identifier (i.e., the functional control class identifier) ​​in the command as a key native function. For another example, if a technician wants to collect operational behavior data of a dynamic page jump class (i.e., the user's operational behavior data on page jump), he can use the native functions viewDidAppear, viewDidDisappear, etc. corresponding to the dynamic page jump class identifier as key native functions. Among them, UIControl, that is, creating a user interface control object, is to create various components on the form (such as buttons, static text boxes, pop-up menus, etc.), and specify the callback functions of these components. viewDidAppear is a native function called when the view has completely transitioned to the screen. viewDidDisappear is a native function called when the view has disappeared, been covered or hidden.

[0114] In the above embodiment, the key native functions are dynamically specified according to the data acquisition requirements of the server, which improves the targeting and accuracy compared to specifying the key native functions in general in advance.

[0115] In one embodiment, step S202 determines the key native function when the application is started, including: when the application is started, obtaining the type identifier corresponding to the application; obtaining the correspondence between the preset key native function and the type identifier; and determining the key native function corresponding to the found type identifier based on the correspondence.

[0116] Among them, the type identifier is an identifier of the type of the application, which is used to uniquely identify the type of the application. It can be understood that the type identifier can also be called an application type identifier. In one embodiment, the type of the application includes an interface display class and a communication class. The first-order types such as the interface display class and the communication class can also include second-order types. The interface display class can also include second-order types such as game applications and shopping applications. The communication class includes second-order types such as instant messaging and content publishing.

[0117] Specifically, when the application is started, the terminal can request the server to obtain the type identifier corresponding to the application. The terminal can also extract the type identifier corresponding to the application from the local installation information of the application. The terminal can obtain the correspondence between the preset key native functions and the type identifier from the local or server, and determine the key native function corresponding to the obtained type identifier according to the correspondence.

[0118] For example, if the APP is an interface display APP (for example, interface game APP, shopping APP, etc. are mostly used for interface display), it means that page loading and jumping are often involved, so viewDidLoad, viewDidAppear, and viewDidDisappear can be identified as key native functions. Among them, viewDidLoad is a native function called after the view is created.

[0119] In the above embodiment, key native functions are specified at the type level of the application. Different key native functions can be determined according to the types of different applications, taking into account the differentiated factors of the required collected data due to different types, without generally specifying fixed key native functions, thereby improving specificity and accuracy.

[0120] In one embodiment, when the application starts, step S202 determines the key native function when the application starts, including: sending a startup notification to the server when the application starts; receiving a data acquisition instruction sent by the server after receiving the startup notification; extracting the data type identifier carried in the data acquisition instruction; determining the native function corresponding to the data type identifier, and obtaining the type identifier corresponding to the application; from the determined native functions, screening out the native function corresponding to the type identifier corresponding to the application as the key native function.

[0121] In the above embodiment, the data acquisition requirements of the server are combined with the type of application to dynamically determine key native functions, thereby avoiding the situation where the technician does not understand the type of application when requesting to obtain operation behavior data, resulting in unnecessary operation behavior data being obtained, thereby further improving accuracy.

[0122] In one embodiment, after determining the key native function when the application is started in step S202, the method further includes: adding a corresponding key tag to the determined key native function. After monitoring the operation event for the application during the running of the application in step S206, the method further includes: determining the native function to be called by the monitored operation event; detecting whether the determined native function has a corresponding key tag; and determining that the native function is a key native function when the native function has a corresponding key tag.

[0123] The key tag is a tag used to identify a native function as a key native function. It can be understood that a native function with a corresponding key tag is a key native function.

[0124] Specifically, in step S206, during the running process of the application, after monitoring the operation event for the application, the method further includes the step of determining whether the native function to be called by the operation event is a key native function. Specifically, the terminal can determine the native function to be called by the monitored operation event, and detect whether the native function to be called has a corresponding key tag. When the native function has the corresponding key tag, the native function is determined to be a key native function, and when the native function does not have the corresponding key tag, the native function is determined to be a non-key native function.

[0125] In the above embodiment, by adding a key tag and detecting whether the key tag exists to determine whether the native function to be called by the operation event is a key native function, it is possible to more quickly identify whether the native function to be called by the operation event is a key native function.

[0126] like Figure 4 As shown, in one embodiment, the method further includes a data reporting step, specifically including the following steps:

[0127] S402, obtaining operation behavior data collected by a data collection function.

[0128] The operation behavior data collected by the data collection function is the collected original operation behavior data. It can be understood that the original operation behavior data is the collected operation behavior data itself without further data processing or processing.

[0129] S404: extracting features from the operation behavior data.

[0130] Specifically, the terminal performs feature extraction on the original operation behavior data to extract feature data. Feature data is key data that can concisely express the substantial features of the operation behavior data. It can be understood that the feature data retains the substantial features and is relatively concise compared to the original operation behavior data.

[0131] In one embodiment, the operation behavior data includes text data. Step S404 extracts features from the operation behavior data, including: performing word segmentation on the text operation behavior data to obtain word segments; extracting keyword segments from each word segment; quantizing each keyword segment obtained by extraction into a corresponding word vector; and combining each word vector obtained according to the order relationship of corresponding positions in the operation behavior data to obtain a feature vector of the operation behavior data.

[0132] Among them, word fragments are words. Keyword fragments are word fragments with substantial meaning. It can be understood that keyword fragments can express features. Word embedding is a vector that can be understood by computers obtained by converting words in natural language.

[0133] Specifically, the terminal may perform word segmentation processing on the operation behavior data of the text to obtain word fragments, and extract keyword fragments from each word fragment. In one embodiment, a keyword library may be pre-stored in the terminal. The keyword library includes one or more preset keywords. The terminal may match the word fragments obtained by the word segmentation processing with each preset keyword in the keyword library, and use the word fragments with matching preset keywords in the keyword library as keyword fragments.

[0134] The terminal can quantize each extracted keyword fragment into a corresponding word vector. In one embodiment, the terminal can mark the position of the preset keyword matched by the keyword fragment in the keyword library as 1, and mark the positions of the remaining preset keywords in the keyword library as 0, and then the word vector corresponding to the keyword fragment can be obtained. It should be noted that in other embodiments, the position of the preset keyword matched by the keyword fragment in the keyword library can be marked as 0, and the positions of the remaining preset keywords in the keyword library can be marked as 1, so as to obtain the word vector corresponding to the keyword fragment.

[0135] Then, the terminal can combine the obtained word vectors according to the order of the corresponding positions in the operation behavior data to obtain the feature vector of the operation behavior data. Among them, the corresponding position of the word vector in the operation behavior data is the corresponding position of the keyword fragment corresponding to the word vector in the operation behavior data. It can be understood that the obtained feature vector belongs to the feature data.

[0136] S406: Report the extracted feature data to the server.

[0137] Specifically, the terminal may report the extracted concise feature data to the server. In one embodiment, the terminal may report the extracted feature vector to the server.

[0138] In one embodiment, the reported feature data or feature vector is used to instruct the server to input the reported feature data or feature vector into a corresponding analysis model to output a corresponding analysis result. The analysis model is a machine learning model for analysis obtained by the server through machine learning training in advance.

[0139] In the above embodiment, the original data of the collected operation behavior data is not directly reported, but features are extracted from the operation behavior data and the feature data is reported. Compared with the original data, the feature data can not only retain the features required for analysis, but also reduce the amount of data transmission, thereby reducing the network resources consumed during reporting and improving data reporting efficiency.

[0140] In addition, by combining the word vectors of the keyword segments to obtain the feature vector, the amount of data can be further reduced. Moreover, the characteristics of the operation behavior data can be reflected more simply and accurately.

[0141] It should be understood that although Figure 2-4 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-4 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0142] In one embodiment, Figure 5 As shown, a data collection device 500 is provided, comprising: a key function determination module 502, a function exchange module 504, a data collection module 506 and a processing module 508, wherein:

[0143] The key function determination module 502 is used to determine the key native function when the application is started.

[0144] The function exchange module 504 is used to perform function exchange processing on the key native function and the custom data collection function.

[0145] The data collection module 506 is used to monitor operation events for the application during the operation of the application; when the native function to be called by the monitored operation event is a key native function, the operation behavior data corresponding to the operation event is collected by calling the data collection function that exchanges with the key native function.

[0146] The processing module 508 is used to trigger the calling of key native functions to perform processing corresponding to the operation event after the data collection is completed.

[0147] In one embodiment, the key function determination module 502 is also used to send a startup notification to the server when the application is started; receive a data acquisition instruction sent by the server after receiving the startup notification; extract the data type identifier carried in the data acquisition instruction; and use the native function that processes the data corresponding to the data type identifier as the key native function.

[0148] In one embodiment, the key function determination module 502 is also used to obtain the type identifier corresponding to the application when the application is started; obtain the correspondence between the preset key native function and the type identifier; and determine the key native function corresponding to the found type identifier based on the correspondence.

[0149] In one embodiment, the key function determination module 502 is also used to obtain a key function identifier pre-added for the application when the application is started; match the key function identifier with the native function provided by the operating system; and use the native function that matches the key function identifier among the native functions provided by the operating system as the key native function.

[0150] In one embodiment, the key function determination module 502 is also used to add a corresponding key tag to the determined key native function; the data collection module 506 is also used to determine the native function to be called by the monitored operation event; detect whether the determined native function has a corresponding key tag; when the native function has a corresponding key tag, the native function is determined to be a key native function.

[0151] like Figure 6 As shown, in one embodiment, the device 500 further includes:

[0152] The feature extraction module 510 is used to obtain the operation behavior data collected by the data collection function; and perform feature extraction on the operation behavior data.

[0153] The data reporting module 512 is used to report the extracted feature data to the server.

[0154] like Figure 7 As shown, in one embodiment, the operation behavior data includes text data; the feature data is a feature vector. The feature extraction module 510 includes:

[0155] The word segmentation module 510a is used to perform word segmentation processing on the operation behavior data of the text to obtain word segments; and extract keyword segments from each word segment.

[0156] The feature vector generation module 510b is used to quantify each extracted keyword segment into a corresponding word vector; combine each word vector obtained according to the order relationship of the corresponding positions in the operation behavior data to obtain a feature vector of the operation behavior data.

[0157] For the specific definition of the data collection device, please refer to the definition of the data collection method above, which will not be repeated here. Each module in the above data collection device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0158] In one embodiment, a computer device is provided, which may be Figure 1 The internal structure diagram of the terminal 110 in FIG. 1 may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data collection method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0159] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0160] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program: when an application is started, determining a key native function; performing function exchange processing on the key native function and a custom data collection function; during the running of the application, monitoring operation events for the application; when the native function to be called by the monitored operation event is a key native function, collecting operation behavior data corresponding to the operation event by calling the data collection function exchanged with the key native function; after the data collection is completed, triggering the call of the key native function to perform processing corresponding to the operation event.

[0161] In one embodiment, when an application is started, determining the key native function includes: sending a startup notification to a server when the application is started; receiving a data acquisition instruction sent by the server after receiving the startup notification; extracting a data type identifier carried in the data acquisition instruction; and using a native function that processes data corresponding to the data type identifier as a key native function.

[0162] In one embodiment, when an application is started, determining the key native function includes: when the application is started, obtaining a type identifier corresponding to the application; obtaining a correspondence between a preset key native function and the type identifier; and determining the key native function corresponding to the found type identifier based on the correspondence.

[0163] In one embodiment, when an application is started, determining a key native function includes: when the application is started, obtaining a key function identifier pre-added for the application; matching the key function identifier with a native function provided by the operating system; and using a native function in the native function provided by the operating system that matches the key function identifier as a key native function.

[0164] In one embodiment, when the application is started, after determining the key native function, the processor also implements the following steps when executing the computer program: adding a corresponding key tag to the determined key native function; during the running of the application, after listening to the operation events for the application, the method also includes: determining the native function to be called by the listened operation event; detecting whether the determined native function has the corresponding key tag; when the native function has the corresponding key tag, determining that the native function is a key native function.

[0165] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining the operation behavior data collected by the data collection function; performing feature extraction on the operation behavior data; and reporting the extracted feature data to the server.

[0166] In one embodiment, the operation behavior data includes text data; the feature data is a feature vector; feature extraction of the operation behavior data includes: performing word segmentation processing on the text operation behavior data to obtain word fragments; extracting keyword fragments from each word fragment; quantizing each extracted keyword fragment into a corresponding word vector; combining each obtained word vector according to the order relationship of corresponding positions in the operation behavior data to obtain a feature vector of the operation behavior data.

[0167] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: when an application is started, a key native function is determined; the key native function is exchanged with a custom data collection function; during the operation of the application, operation events for the application are monitored; when the native function to be called by the monitored operation event is a key native function, operation behavior data corresponding to the operation event is collected by calling the data collection function exchanged with the key native function; after the data collection is completed, the key native function is triggered to execute processing corresponding to the operation event.

[0168] In one embodiment, when an application is started, determining the key native function includes: sending a startup notification to a server when the application is started; receiving a data acquisition instruction sent by the server after receiving the startup notification; extracting a data type identifier carried in the data acquisition instruction; and using a native function that processes data corresponding to the data type identifier as a key native function.

[0169] In one embodiment, when an application is started, determining the key native function includes: when the application is started, obtaining a type identifier corresponding to the application; obtaining a correspondence between a preset key native function and the type identifier; and determining the key native function corresponding to the found type identifier based on the correspondence.

[0170] In one embodiment, when an application is started, determining a key native function includes: when the application is started, obtaining a key function identifier pre-added for the application; matching the key function identifier with a native function provided by the operating system; and using a native function in the native function provided by the operating system that matches the key function identifier as a key native function.

[0171] In one embodiment, when the application is started, after determining the key native function, the processor further implements the following steps when executing the computer program: adding a corresponding key tag to the determined key native function; during the running process of the application, after monitoring the operation event for the application, the method also includes: determining the native function to be called by the monitored operation event; detecting whether the determined native function has a corresponding key tag; when the native function has a corresponding key tag, determining that the native function is a key native function. On the contrary, when the native function does not have a corresponding key tag, it is determined that the system function is not a key native function.

[0172] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining the operation behavior data collected by the data collection function; performing feature extraction on the operation behavior data; and reporting the extracted feature data to the server.

[0173] In one embodiment, the operation behavior data includes text data; the feature data is a feature vector; feature extraction of the operation behavior data includes: performing word segmentation processing on the text operation behavior data to obtain word fragments; extracting keyword fragments from each word fragment; quantizing each extracted keyword fragment into a corresponding word vector; combining each obtained word vector according to the order relationship of corresponding positions in the operation behavior data to obtain a feature vector of the operation behavior data.

[0174] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0175] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0176] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A data collection method, the method comprising: When the application starts, identify key native functions; The key native function is a system-provided function that is key in the corresponding application and needs to be processed by function exchange; Performing function exchange processing on the key native function and the custom data collection function; wherein, the key native function and the custom data collection function are exchanged by modifying the first function pointer corresponding to the function number targeted by the operation event into a second function pointer; the first function pointer is a function pointer that stores the address of the key native function, and the second function pointer is a function pointer that stores the address of the custom function; the custom data collection function is a native function that is not provided by the system; During the running of the application, monitoring operation events for the application; When the native function to be called by the monitored operation event is the key native function, the call to the key native function is intercepted, and according to the exchange relationship recorded when the function is exchanged, a customized data collection function after the exchange with the key native function is determined, so as to collect the operation behavior data corresponding to the operation event by calling the data collection function exchanged with the key native function; After the data collection is completed, triggering and calling the key native function to execute processing corresponding to the operation event; When the application is started, determining the key native function includes: When the application is started, a startup notification is sent to the server; a data acquisition instruction sent by the server after receiving the startup notification is received; a data type identifier carried in the data acquisition instruction is extracted; a native function that processes data corresponding to the data type identifier is used as a key native function; wherein the data type is used to identify a unique identifier data type, and the data type represents a type obtained by dividing the operation behavior data according to the behavior action object, and the behavior action object includes an interface and a function control; the data type includes an interface display class and a function control class as first-level classification types, and a second-level classification type under the interface display class and the function control class; the second-level classification type of the interface display class includes a static page display class and a dynamic page jump class, and the second-level classification type of the function control class includes an actual function control; Among them, if it is necessary to collect the operation behavior data of the functional control class, the native function UIControl corresponding to the functional control class identifier will be used as the key native function; if it is necessary to collect the operation behavior data of the dynamic page jump class, the native function viewDidAppear or viewDidDisappear corresponding to the dynamic page jump class identifier will be used as the key native function; the UIControl represents the creation of a user interface control object, which is used to create various components on the form and specify the callback functions of these components; the viewDidAppear represents the native function called when the view has been completely transitioned to the screen, and the viewDidDisappear represents the native function called when the view has disappeared, been covered or hidden.

2. The method according to claim 1, characterized in that When the application is started, determining the key native function includes: When the application is started, obtaining a type identifier corresponding to the application; Get the correspondence between the preset key native functions and type identifiers; According to the corresponding relationship, a key native function corresponding to the found type identifier is determined.

3. The method according to claim 1, characterized in that When the application is started, determining the key native function includes: When the application is started, obtaining a key function identifier pre-added for the application; Matching the key function identifier with a native function provided by the operating system; A native function provided by the operating system and matching the key function identifier is used as the key native function.

4. The method according to claim 1, characterized in that: After determining the key native function when the application is started, the method further includes: Add corresponding key tags to the identified key native functions; During the running of the application, after monitoring an operation event for the application, the method further includes: Determine the native function to be called for the monitored operation event; Detecting whether the determined native function has a corresponding key tag; When the native function has a corresponding key tag, the native function is determined to be a key native function.

5. The method according to claim 1, characterized in that The method further comprises: Acquire the operation behavior data collected by the data collection function; Performing feature extraction on the operation behavior data; The extracted feature data is reported to the server.

6. The method according to claim 5, characterized in that The operation behavior data includes text data; the feature data is a feature vector; and the feature extraction of the operation behavior data includes: Perform word segmentation on the text's operation behavior data to obtain word fragments; Extract keyword segments from each word segment; Quantizing each of the extracted keyword fragments into a corresponding word vector; The obtained word vectors are combined according to the order of corresponding positions in the operation behavior data to obtain a feature vector of the operation behavior data.

7. A data collection device, characterized in that: The device comprises: A key function determination module is used to determine a key native function when the application is started; the key native function is a system-provided function that is key in the corresponding application and needs to be processed by function exchange; A function exchange module, used for performing function exchange processing on the key native function and the custom data collection function; wherein, the key native function and the custom data collection function are exchanged by modifying the first function pointer corresponding to the function number targeted by the operation event into a second function pointer; the first function pointer is a function pointer for storing the address of the key native function, and the second function pointer is a function pointer for storing the address of the custom function; the custom data collection function is a native function that is not provided by the system; A data collection module, used to monitor operation events for the application during the operation of the application; when the native function to be called by the monitored operation event is the key native function, intercept the call to the key native function, and determine a custom data collection function after the exchange with the key native function according to the exchange relationship recorded when the function is exchanged, so as to collect the operation behavior data corresponding to the operation event by calling the data collection function exchanged with the key native function; A processing module, used for triggering and calling the key native function to execute processing corresponding to the operation event after the data collection is completed; The key function determination module is also used to: send a startup notification to the server when the application is started; receive a data acquisition instruction sent by the server after receiving the startup notification; extract the data type identifier carried in the data acquisition instruction; and use the native function that processes the data corresponding to the data type identifier as the key native function; wherein the data type is used to identify a unique identification data type, and the data type represents the type obtained by dividing the operation behavior data according to the behavior action object, and the behavior action object includes an interface and a function control; the data type includes an interface display class and a function control class as the first-level classification types, and a second-level classification type under the interface display class and the function control class; the second-level classification type of the interface display class includes a static page display class and a dynamic page jump class, and the function control class The secondary classification types include actual functional controls; among them, if it is necessary to collect the operational behavior data of the functional control class, the native function UIControl corresponding to the functional control class identifier will be used as the key native function; if it is necessary to collect the operational behavior data of the dynamic page jump class, the native function viewDidAppear or viewDidDisappear corresponding to the dynamic page jump class identifier will be used as the key native function; the UIControl represents the creation of a user interface control object, which is used to create various components on the form and specify the callback functions of these components; the viewDidAppear represents the native function called when the view has been completely transitioned to the screen, and the viewDidDisappear represents the native function called when the view has disappeared, been covered or hidden.

8. The device according to claim 7, characterized in that The key function determination module is also used for: When the application is started, a type identifier corresponding to the application is obtained; a correspondence between a preset key native function and the type identifier is obtained; and a key native function corresponding to the found type identifier is determined according to the correspondence.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

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