Disclosure of Invention
In order to solve the problem in the prior art, embodiments of the present invention provide a method and an apparatus for reporting statistical data. The technical scheme is as follows:
in a first aspect, a method for reporting statistical data is provided, where the method includes:
acquiring running statistical data in the running process of a target application program, wherein the running statistical data comprises one or more of behavior class data of a user of the target application program, performance class data of the target application program and quality class data of the target application program;
encoding the operation statistical data according to an encoding mode of a type length value TLV;
and sending the encoded running statistical data to a server.
Optionally, the field of the encoded running statistical data is a continuous field composed of a uid field, a cType field, a dwBufferCode field, a cVerLen field, a strVerison field, a cmachienecorden field, a strmachienecode field and a stData field, where the uid field is a login account of the target application program, the cType field is a service type, the dwBufferCode field is a reserved field, the cVerLen field is a byte number of a version number of the target application program, the strVerison field is the version number, the cmachienecorden field is a byte number of a machine code of a login terminal of the target application program, the strmachienecode field is the machine code, and the stData field is a custom protocol body part and is used for carrying the running statistical data.
Optionally, the stData field is a continuous field composed of a wfeldnum field, a wween field and a stField1+ stField2+ stField3+ … … stField, wherein the wfeldnum field is the number of stfields, the wween field is the total number of bytes of the stfields 1+ stField2+ stField3+ … … stField, and the stField1+ stField2+ stField3+ … … stField is used for carrying the operation statistics.
Thus, the number of interactions between the terminal and the server can be reduced.
Optionally, each stField is a continuous field composed of a dwrid (t) field, a wlen (l) field and an stval (v) field, the dwrid (t) field is a service item in the service type, the wlen (l) field is the number of bytes of the stval (v) field, and the stval (v) field is used for carrying running statistics data.
Thus, the number of interactions between the terminal and the server can be reduced.
Optionally, the stval (v) field is a continuous field composed of a csubtype (t) field, a clen (l) field and a wcount (v) field, the csubtype (t) field is a sub-service item in the service item, the clen (l) field is the number of bytes of the wcount (v) field, and the wcount (v) field is used for carrying the running statistics data.
Thus, the expansibility of uploading statistics can be improved.
Optionally, the dwrid (t) field is represented using 4 bytes DWORD and the wcount (v) field is represented using bytes.
In a second aspect, an apparatus for reporting statistical data is provided, where the apparatus includes:
the system comprises an acquisition module, a quality class analysis module and a quality class analysis module, wherein the acquisition module is used for acquiring operation statistical data in the operation process of a target application program, and the operation statistical data comprises one or more of behavior class data of a user of the target application program, performance class data of the target application program and quality class data of the target application program;
the encoding module is used for encoding the operation statistical data according to an encoding mode of a type length value TLV;
and the sending module is used for sending the encoded running statistical data to the server.
Optionally, the field of the encoded running statistical data is a continuous field composed of a uid field, a cType field, a dwBufferCode field, a cVerLen field, a strVerison field, a cmachienecorden field, a strmachienecode field and a stData field, where the uid field is a login account of the target application program, the cType field is a service type, the dwBufferCode field is a reserved field, the cVerLen field is a byte number of a version number of the target application program, the strVerison field is the version number, the cmachienecorden field is a byte number of a machine code of a login terminal of the target application program, the strmachienecode field is the machine code, and the stData field is a custom protocol body part and is used for carrying the running statistical data.
Optionally, the stData field is a continuous field composed of a wfeldnum field, a wween field and a stField1+ stField2+ stField3+ … … stField, wherein the wfeldnum field is the number of stfields, the wween field is the total number of bytes of the stfields 1+ stField2+ stField3+ … … stField, and the stField1+ stField2+ stField3+ … … stField is used for carrying the operation statistics.
Optionally, each stField is a continuous field composed of a dwrid (t) field, a wlen (l) field and an stval (v) field, the dwrid (t) field is a service item in the service type, the wlen (l) field is the number of bytes of the stval (v) field, and the stval (v) field is used for carrying running statistics data.
Optionally, the stval (v) field is a continuous field composed of a csubtype (t) field, a clen (l) field and a wcount (v) field, the csubtype (t) field is a sub-service item in the service item, the clen (l) field is the number of bytes of the wcount (v) field, and the wcount (v) field is used for carrying the running statistics data.
Optionally, the dwrid (t) field is represented using 4 bytes DWORD and the wcount (v) field is represented using bytes.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, in the running process of the target application program, the running statistical data is obtained, the running statistical data is coded according to the coding mode of the type length value TLV, and the coded running statistical data is sent to the server. In this way, the operation statistical data are encoded according to the TLV encoding mode, the terminal can only store one encoding mode, and the corresponding server can also only store one encoding mode, so that the storage resources can be saved.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
The embodiment of the invention provides a method for reporting statistical data, and an execution main body of the method can be a terminal. The terminal can be a mobile phone, a tablet computer and the like, a target application program is installed in the terminal, the target application program is any application program in all application programs, the terminal can be provided with a processor, a memory, a transceiver and the like, the processor can be used for processing in the process of reporting statistical data, the memory can be used for reporting data required in the process of the statistical data and generated data, and the transceiver can be used for receiving and sending messages and the like. The terminal may further be provided with an input/output device such as a screen, and the screen may be used to display an interface of the target application program. In this embodiment, a terminal is taken as an example of a mobile phone, and a detailed description of the scheme is performed, and other situations are similar to the above, and are not described again in this embodiment.
As shown in fig. 1, the processing flow of the method may include the following steps:
step 101, acquiring running statistical data in the running process of the target application program.
The technical staff can classify the operation statistical data according to the service type of the operation statistical data, for example, the operation statistical data can be classified into behavior data, performance data and quality data of the user, the behavior data of the user can be data of clicking options of an application program, the use duration of the application program and the like, the performance data can be power consumption of the application program and the like, the quality data can be packet loss rate of a voice data packet and the like, and the operation statistical data mentioned in the embodiment of the present invention includes one or more of the behavior data of the user of a target application program, the performance data of the target application program and the quality data of the target application program. The target application program is any application program in all application programs, such as a live application program and the like.
In implementation, a technician may set a data statistics process in a target application program, and when the target application program is started, the target application program may start the data statistics process in a manner of calling an interface, as shown in fig. 2, in an operation process of the target application program, each time a user clicks one option in the target application program, the data statistics process may record a click event of clicking the option once, and the data statistics process may record power consumption of the target application program every 10 minutes, and may also record a packet loss rate of data sent by the user every time.
It should be noted that, for the operation statistical data of different service types, a technician may set different data statistical processes respectively, or may set only one data statistical process.
And 102, encoding the operation statistical data according to the encoding mode of the type length value TLV.
In implementation, after the terminal obtains the running statistical data by using a data statistics process in the target application, as shown in fig. 2, the terminal may use a TLV (type, length, value) encoding manner to perform encoding, so as to obtain the encoded running statistical data.
Optionally, the field of the encoded running statistical data is a continuous field composed of a uid field, a cType field, a dwBufferCode field, a cVerLen field, a strVerison field, a cmachienecordeen field, a strmachienecode field and a stData field, where the uid field is a login account of the target application program, the cType field is a service type, the dwBufferCode field is a reserved field, the cVerLen field is a byte number of a version number of the target application program, the strVerison field is a version number, the cmachienecorden field is a byte number of a machine code of a login terminal of the target application program, the strchine code field is a machine code, and the stData field is a custom protocol body part and is used for carrying the running statistical data.
In implementation, a technician prestores TLV encoding modes in the terminals, where the encoding modes have a bag format of uid field + cType field + dwBufferCode field + cVerLen field + strVerison field + cmacheinecodelen field + strMachineCode field + stData field, and the terminals of the fields can be filled with different contents.
The uid field is a login account of the target application program, and the login account does not refer to a user name of the user for logging in the target application program, but is a unique identifier of the user name of the server corresponding to the user for logging in the target application program.
The cType field is a service type, and can be a behavior type, a performance type, a quality type and the like of the user.
The dwBufferCode field is a reserved field, the default value can now be 0 in consideration of subsequent protocol changes or service type extensions, and the target application can negotiate other values with the server subsequently if extensions are desired.
The cVerLen field is the length of the version number of the target application, i.e. the number of bytes.
The strVerison field is the version number of the target application program, so that the running condition information of the application programs with different version numbers can be counted for the same application program.
The cMachineCodeLen field is the length of the machine code of the login terminal of the target application, i.e. the number of bytes.
The strMachineCode field is a machine code of the login terminal of the target application program, and the machine code may be a unique identifier of the login terminal, and may be a Media Access Control (MAC) address. Therefore, the running condition information of different types of terminals for the same application program can be counted.
It should be noted that the machine code related to the embodiment of the present invention is an MAC address, and any unique identifier that can be used for identifying a terminal can be used as the machine code, which is not limited in the embodiment of the present invention.
The stData field is a custom protocol body part and can be used for carrying running statistical data.
Optionally, the stData field is a continuous field composed of a wfeldnum field, a wween field and a stField1+ stField2+ stField3+ … … stField, wherein the wfeldnum field is the number of stfields, the wween field is the total number of bytes of the stfields 1+ stField2+ stField3+ … … stField, and the stField1+ stField2+ stField3+ … … stField is used for carrying the operation statistics.
In an implementation, the stData field may be a continuous field composed of a wfeldnum field, a wLen field, and stField1+ stField2+ stField3+ … … stField, i.e., stData ═ wfeldnum + wLen + stField1+ stField2+. + stField. wFielddNum denotes the number of stFields, where wFielddNum is N due to the presence of stFieldN, indicating that there are N stFields. wLen is stField1+ stField2+. + stField dn total number of bytes, which can be represented by the following formula: wLen ═ Len (stField1+ stField2+. + stField dn). stField1+ stField2+. + stField may be used to carry running statistics.
It should be noted that the number of stField fields may be determined based on the data size of the operation statistical data, where N is larger when the data size is larger, and N is smaller when the data size is smaller.
It should be further noted that one type field corresponds to one service type, and in one service type, service items of multiple stField fields included in the stData field may be the same or different, and the embodiment of the present invention is not limited thereto.
Through the processing, the service items of the stField fields can be different, so that the operation statistical data of different service items of the same service type can be sent to the server at one time without being sent for multiple times, the interaction times of the terminal and the server can be reduced, and the service performance of the terminal is improved.
Optionally, each stField is a continuous field composed of a dwrid (t) field, a wlen (l) field and an stval (v) field, the dwrid (t) field is a service item in the service type, the wlen (l) field is the number of bytes of the stval (v) field, and the stval (v) field is used for carrying running statistics data.
In implementation, N stfields are described above, N may be determined based on the data amount of the running statistics, and each stField field is a continuous field composed of a dwrid (t) field, a wlen (l) field, and an stval (v) field, i.e., stField ═ dwrid (t) + wlen (l) + stval (v).
The dwrid (t) field is a service item in the service type, for example, the service type is a behavior class of the user, and the service item may be a click item (for example, the number of times a certain option is clicked, etc.), a duration item (for example, the duration of use, etc.), a login status item (for example, stealth, online, etc.), and the like. The service type is performance type, the service item is power consumption, card pause times and the like, the service type is quality type, and the service item is packet loss rate (the proportion of lost of every 100 data packets) and the like.
wLen (L) is the length of stVal (V), i.e., the number of bytes.
stval (v) is used to carry the running statistics of the traffic items represented by dwrid (t). For example, the service type is a behavior class of the user, the service item is a click item, and the operation statistical data is a click number.
Optionally, since sometimes, in order to obtain more detailed operation statistics data, each service item may further include a sub-service item, where the corresponding stval (v) field is a continuous field composed of a csubtype (t) field, a clen (l) field, and a wcount (v) field, the csubtype (t) field is a sub-service item in the service item, the clen (l) field is the number of bytes of the wcount (v) field, and the wcount (v) field is used for carrying the operation statistics data.
In an implementation, the stval (v) field is a continuous field composed of a csubtype (t) field, a clen (l) field, and a wcount (v) field, i.e., stval (v) ═ csubtype (t) + clen (l) + wcount (v).
The csubtype (t) field is a sub-service item in the service item, for example, the target application program is a live broadcast application program, the service type is a behavior class of the user, the service item may be a click item (e.g., the number of times a certain option is clicked, etc.), a time length item (e.g., the duration of use, etc.), the service item is a click item, the sub-service item may be the number of clicks of an option entering a live broadcast room, the number of clicks of a gift delivery option in the live broadcast room, etc., and the service item is a duration item, the sub-service item may be the duration of live broadcast watching in the live broadcast room, the duration of use of the target application program, the duration of jump between pages, etc.
The clen (l) field is the length of the wcount (v) field, i.e. the number of bytes, so that the server can determine the number of bytes of the running statistics.
The wcount (v) field is used for carrying the running statistical data of the sub-service item represented by the csubtype (t), for example, the target application program is a live broadcast application program, the service type is a behavior type of the user, the service item may be a click item, the sub-service item is the click number of the gift delivery option in the live broadcast room, and the running statistical data is the click number.
It should be noted that the number of stval (v) in one stField may be one or more, and the embodiment of the present invention is not limited.
Optionally, the dwrid (t) field is represented using 4 bytes DWORD and the wcount (v) field is represented using bytes.
In implementation, since there are generally many service items, the dwrid (t) field is represented by DWORD (4 bytes), DWORD is 4 bytes, and one byte is 8 bits, so there are 32 bits, each bit is represented by 0 or 1, that is, there are 32 power of service items that can be 2, that is, 32 power of service items that can show 2 at most, and the number of service items that can basically satisfy the statistics of an application program is calculated to be as much as 40 hundred million.
Meanwhile, in order to obtain more detailed operation statistical data, each service item may further include a sub-service item, the sub-service item may be represented by a byte, one byte is 8 bits, each bit is represented by 0 or 1, and it is equivalent to that the service sub-item may have 2 power-of-8 sub-service items, that is, each service may include at most 2 power-of-8 sub-service items.
Step 103, sending the encoded running statistical data to a server.
In implementation, as shown in fig. 2, the terminal obtains the encoded operation statistical data, may send the encoded operation statistical data to the server, and the server may decode the operation statistical data sent by the terminal after receiving the operation statistical data sent by the terminal.
In addition, the server can also send the operation statistical data to a terminal used by a technician, and the technician can improve the function of the target application program by checking the operation statistical data of the target application program, so that the target application program can be used more smoothly.
In the embodiment of the invention, in the running process of the target application program, the running statistical data is obtained, the running statistical data is coded according to the coding mode of the type length value TLV, and the coded running statistical data is sent to the server. In this way, the operation statistical data are encoded according to the TLV encoding mode, the terminal can only store one encoding mode, and the corresponding server can also only store one encoding mode, so that the storage resources can be saved.
Based on the same technical concept, an embodiment of the present invention further provides a device for reporting statistical data, as shown in fig. 3, the device includes:
an obtaining module 310, configured to obtain running statistical data during a running process of a target application, where the running statistical data includes one or more of behavior class data of a user of the target application, performance class data of the target application, and quality class data of the target application;
the encoding module 320 is configured to encode the operation statistic data according to an encoding manner of the type length value TLV;
a sending module 330, configured to send the encoded running statistic data to a server.
Optionally, the field of the encoded running statistical data is a continuous field composed of a uid field, a cType field, a dwBufferCode field, a cVerLen field, a strVerison field, a cmachienecorden field, a strmachienecode field and a stData field, where the uid field is a login account of the target application program, the cType field is a service type, the dwBufferCode field is a reserved field, the cVerLen field is a byte number of a version number of the target application program, the strVerison field is the version number, the cmachienecorden field is a byte number of a machine code of a login terminal of the target application program, the strmachienecode field is the machine code, and the stData field is a custom protocol body part and is used for carrying the running statistical data.
Optionally, the stData field is a continuous field composed of a wfeldnum field, a wween field and a stField1+ stField2+ stField3+ … … stField, wherein the wfeldnum field is the number of stfields, the wween field is the total number of bytes of the stfields 1+ stField2+ stField3+ … … stField, and the stField1+ stField2+ stField3+ … … stField is used for carrying the operation statistics.
Optionally, each stField is a continuous field composed of a dwrid (t) field, a wlen (l) field and an stval (v) field, the dwrid (t) field is a service item in the service type, the wlen (l) field is the number of bytes of the stval (v) field, and the stval (v) field is used for carrying running statistics data.
Optionally, the stval (v) field is a continuous field composed of a csubtype (t) field, a clen (l) field and a wcount (v) field, the csubtype (t) field is a sub-service item in the service item, the clen (l) field is the number of bytes of the wcount (v) field, and the wcount (v) field is used for carrying the running statistics data.
Optionally, the dwrid (t) field is represented using 4 bytes DWORD and the wcount (v) field is represented using bytes.
In the embodiment of the invention, in the running process of the target application program, the running statistical data is obtained, the running statistical data is coded according to the coding mode of the type length value TLV, and the coded running statistical data is sent to the server. In this way, the operation statistical data are encoded according to the TLV encoding mode, the terminal can only store one encoding mode, and the corresponding server can also only store one encoding mode, so that the storage resources can be saved.
It should be noted that: in the device for reporting statistical data provided in the above embodiment, when recommending songs, only the division of the above functional modules is used as an example, and in practical applications, the function distribution may be completed by different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions. In addition, the apparatus for reporting statistical data and the method for reporting statistical data provided in the foregoing embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments and are not described herein again.
Please refer to fig. 4, which illustrates a schematic structural diagram of a terminal according to an embodiment of the present invention, where the terminal may be configured to implement the method for reporting statistical data provided in the foregoing embodiment. Specifically, the method comprises the following steps:
the terminal 400 may include RF (Radio Frequency) circuitry 110, memory 120 including one or more computer-readable storage media, an input unit 130, a display unit 140, a sensor 150, audio circuitry 160, a WiFi (wireless fidelity) module 170, a processor 180 including one or more processing cores, and a power supply 190. Those skilled in the art will appreciate that the terminal configuration shown in fig. 4 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the RF circuit 110 may be used for receiving and transmitting signals during information transmission and reception or during a call, and in particular, receives downlink information from a base station and then sends the received downlink information to the one or more processors 180 for processing; in addition, data relating to uplink is transmitted to the base station. In general, the RF circuitry 110 includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, and the like. In addition, the RF circuitry 110 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), e-mail, SMS (short messaging Service), etc.
The memory 120 may be used to store software programs and modules, and the processor 180 executes various functional applications and data processing by operating the software programs and modules stored in the memory 120. The memory 120 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the terminal 400, and the like. Further, the memory 120 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 120 may further include a memory controller to provide the processor 180 and the input unit 130 with access to the memory 120.
The input unit 130 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 130 may include a touch-sensitive surface 131 as well as other input devices 132. The touch-sensitive surface 131, also referred to as a touch display screen or a touch pad, may collect touch operations by a user on or near the touch-sensitive surface 131 (e.g., operations by a user on or near the touch-sensitive surface 131 using a finger, a stylus, or any other suitable object or attachment), and drive the corresponding connection device according to a predetermined program. Alternatively, the touch sensitive surface 131 may comprise two parts, a touch detection means and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 180, and can receive and execute commands sent by the processor 180. Additionally, the touch-sensitive surface 131 may be implemented using various types of resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch-sensitive surface 131, the input unit 130 may also include other input devices 132. In particular, other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 140 may be used to display information input by or provided to a user and various graphical user interfaces of the terminal 400, which may be made up of graphics, text, icons, video, and any combination thereof. The Display unit 140 may include a Display panel 141, and optionally, the Display panel 141 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch-sensitive surface 131 may cover the display panel 141, and when a touch operation is detected on or near the touch-sensitive surface 131, the touch operation is transmitted to the processor 180 to determine the type of the touch event, and then the processor 180 provides a corresponding visual output on the display panel 141 according to the type of the touch event. Although in FIG. 4, touch-sensitive surface 131 and display panel 141 are shown as two separate components to implement input and output functions, in some embodiments, touch-sensitive surface 131 may be integrated with display panel 141 to implement input and output functions.
The terminal 400 can also include at least one sensor 150, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 141 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 141 and/or a backlight when the terminal 400 is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when the mobile phone is stationary, and can be used for applications of recognizing the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured in the terminal 400, detailed descriptions thereof are omitted.
Audio circuitry 160, speaker 161, and microphone 162 may provide an audio interface between a user and terminal 400. The audio circuit 160 may transmit the electrical signal converted from the received audio data to the speaker 161, and convert the electrical signal into a sound signal for output by the speaker 161; on the other hand, the microphone 162 converts the collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 160, and then outputs the audio data to the processor 180 for processing, and then to the RF circuit 110 to be transmitted to, for example, another terminal, or outputs the audio data to the memory 120 for further processing. The audio circuit 160 may also include an earbud jack to provide communication of a peripheral headset with the terminal 400.
WiFi belongs to a short-distance wireless transmission technology, and the terminal 400 can help a user send and receive e-mails, browse web pages, access streaming media, and the like through the WiFi module 170, and provides wireless broadband internet access for the user. Although fig. 4 shows the WiFi module 170, it is understood that it does not belong to the essential constitution of the terminal 400, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 180 is a control center of the terminal 400, connects various parts of the entire mobile phone using various interfaces and lines, and performs various functions of the terminal 400 and processes data by operating or executing software programs and/or modules stored in the memory 120 and calling data stored in the memory 120, thereby performing overall monitoring of the mobile phone. Optionally, processor 180 may include one or more processing cores; preferably, the processor 180 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 180.
The terminal 400 further includes a power supply 190 (e.g., a battery) for powering the various components, which may preferably be logically coupled to the processor 180 via a power management system to manage charging, discharging, and power consumption management functions via the power management system. The power supply 190 may also include any component including one or more of a dc or ac power source, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown, the terminal 400 may further include a camera, a bluetooth module, etc., which will not be described herein. Specifically, in this embodiment, the display unit of the terminal 400 is a touch screen display, and the terminal 400 further includes a memory and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for:
acquiring running statistical data in the running process of a target application program, wherein the running statistical data comprises one or more of behavior class data of a user of the target application program, performance class data of the target application program and quality class data of the target application program;
encoding the operation statistical data according to an encoding mode of a type length value TLV;
and sending the encoded running statistical data to a server.
Optionally, the field of the encoded running statistical data is a continuous field composed of a uid field, a cType field, a dwBufferCode field, a cVerLen field, a strVerison field, a cmachienecorden field, a strmachienecode field and a stData field, where the uid field is a login account of the target application program, the cType field is a service type, the dwBufferCode field is a reserved field, the cVerLen field is a byte number of a version number of the target application program, the strVerison field is the version number, the cmachienecorden field is a byte number of a machine code of a login terminal of the target application program, the strmachienecode field is the machine code, and the stData field is a custom protocol body part and is used for carrying the running statistical data.
Optionally, the stData field is a continuous field composed of a wfeldnum field, a wween field and a stField1+ stField2+ stField3+ … … stField, wherein the wfeldnum field is the number of stfields, the wween field is the total number of bytes of the stfields 1+ stField2+ stField3+ … … stField, and the stField1+ stField2+ stField3+ … … stField is used for carrying the operation statistics.
Optionally, each stField is a continuous field composed of a dwrid (t) field, a wlen (l) field and an stval (v) field, the dwrid (t) field is a service item in the service type, the wlen (l) field is the number of bytes of the stval (v) field, and the stval (v) field is used for carrying running statistics data.
Optionally, the stval (v) field is a continuous field composed of a csubtype (t) field, a clen (l) field and a wcount (v) field, the csubtype (t) field is a sub-service item in the service item, the clen (l) field is the number of bytes of the wcount (v) field, and the wcount (v) field is used for carrying the running statistics data.
Optionally, the dwrid (t) field is represented using 4 bytes DWORD and the wcount (v) field is represented using bytes.
In the embodiment of the invention, in the running process of the target application program, the running statistical data is obtained, the running statistical data is coded according to the coding mode of the type length value TLV, and the coded running statistical data is sent to the server. In this way, the operation statistical data are encoded according to the TLV encoding mode, the terminal can only store one encoding mode, and the corresponding server can also only store one encoding mode, so that the storage resources can be saved.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.