Data reporting method, device, equipment, system and storage medium
Through the collaborative work between the server and the terminal device, the reporting code is generated and called, which solves the problem of mismatch in data reporting format and high cost, and achieves the accuracy and cost-effectiveness of data reporting.
Patent Information
- Application Number
- CN202110316592.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-24
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2041-03-24
AI Technical Summary
In the existing data reporting methods, data reporting is prone to errors, the format of the reported data does not match the format of the server, and the cost is high.
The server sends the data reporting configuration information of the target program to the first terminal device. The first terminal device generates the reporting code based on the data reporting configuration information, and sends the reporting code to the server. The server then sends it to the second terminal device, so that the second terminal device calls the reporting code to the server during the operation of the target program.
The format of the reported data is matched with the server format, which reduces the probability of errors in data reporting and reduces the development cost of reporting codes.
Smart Images

Figure CN112882918B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and particularly to a data reporting method, apparatus, device, system and storage medium. Background Art
[0002] In order to understand the running status of an application, etc., the application needs to report data to a server.
[0003] However, in the current data reporting methods, data reporting is prone to errors, the format of the reported data does not match the format of the server, and the cost is high. Summary of the Invention
[0004] The main object of the present invention is to provide a data reporting method, apparatus, device, system and storage medium, aiming to solve the problems that the existing data reporting is prone to errors, the format of the reported data does not match the format of the server, and the cost is high.
[0005] To achieve the above object, the present invention provides a data reporting method, which is applied to a first terminal device. The data reporting method includes:
[0006] Receiving data reporting configuration information of a target program sent by a server, where the target program is installed on a second terminal device;
[0007] Generating a reporting code based on the data reporting configuration information;
[0008] Sending the reporting code to the server, so that the server sends the reporting code to the second terminal device, and enabling the second terminal device to call the reporting code to report data to the server during the process of running the target program.
[0009] Optionally, the step of sending the reporting code to the server, so that the server sends the reporting code to the second terminal device, and enabling the second terminal device to call the reporting code to report data to the server during the process of running the target program includes:
[0010] Packing the reporting code into an installation package of the target program;
[0011] Sending the installation package to the server, so that the server sends the installation package to the second terminal device, and enabling the second terminal device to call the reporting code to report data to the server after installing the target program based on the installation package and during the process of running the target program.
[0012] Optionally, the data reporting configuration information includes at least one target event;
[0013] The step of generating a reporting code based on the data reporting configuration information includes:
[0014] For each of the target events, generate a corresponding reporting sub-code;
[0015] Based on the reporting sub-codes of each of the target events, generate a reporting code.
[0016] In addition, to achieve the above object, the present invention also proposes a data reporting method, which is applied to a server. The data reporting method includes:
[0017] Send the data reporting configuration information of the target program to a first terminal device, so that the first terminal device generates a reporting code based on the data reporting configuration information. The target program is installed on a second terminal device;
[0018] Receive the reporting code sent by the first terminal device;
[0019] Send the reporting code to the second terminal device, so that the second terminal device calls the reporting code to report data to the server during the process of running the target program.
[0020] Optionally, the step of receiving the reporting code sent by the first terminal device includes:
[0021] Receive the installation package of the target program sent by the first terminal device. The installation package includes the reporting code;
[0022] The step of sending the reporting code to the second terminal device, so that the second terminal device calls the reporting code to report data to the server during the process of running the target program, includes:
[0023] Send the installation package to the second terminal device, so that after the second terminal device installs the target program based on the installation package, it calls the reporting code to report data to the server during the process of running the target program.
[0024] In addition, to achieve the above object, the present invention also proposes a data reporting method, which is applied to a second terminal device. The data reporting method includes:
[0025] Receive the reporting code sent by the server. The reporting code is generated by a first terminal device based on the data reporting configuration information of the target program in the server. The target program is installed on the second terminal device;
[0026] Receive the start instruction of the target program to start the target program;
[0027] During the running of the target program, call the reporting code to report data to the server.
[0028] Optionally, the step of receiving the reporting code sent by the server includes:
[0029] Receive the installation package of the target program sent by the server, where the installation package includes the reporting code;
[0030] Before the step of receiving the start instruction of the target program to start the target program, the data reporting method further includes:
[0031] Install the target program based on the installation package.
[0032] Optionally, before the step of calling the reporting code during the running of the target program to report data to the server, the data reporting method further includes:
[0033] Create a content provider of the target program;
[0034] Initialize the reporting code based on the content provider so that the second terminal device can call system resources for the running of the reporting code.
[0035] Optionally, the reporting code includes reporting sub - codes for at least one target event;
[0036] The step of calling the reporting code during the running of the target program to report data to the server includes:
[0037] During the running of the target program, when any of the target events occurs, call the reporting sub - code corresponding to the target event to obtain the data to be reported for the target event through the reporting sub - code, and report the data to be reported to the server.
[0038] In addition, to achieve the above object, the present invention also proposes a data reporting device, which is applied to the first terminal device. The data reporting device includes:
[0039] A first receiving module, configured to receive the data reporting configuration information of the target program sent by the server, where the target program is installed on the second terminal device;
[0040] A generating module, configured to generate a reporting code based on the data reporting configuration information;
[0041] A first sending module, configured to send the reporting code to the server, so that the server sends the reporting code to the second terminal device, and enables the second terminal device to call the reporting code to report data to the server during the running of the target program.
[0042] In addition, to achieve the above object, the present invention further provides a data reporting device, which is applied to a server. The data reporting device includes:
[0043] A second sending module, configured to send data reporting configuration information of a target program to a first terminal device, so that the first terminal device generates a reporting code based on the data reporting configuration information. The target program is installed on the second terminal device;
[0044] A second receiving module, configured to receive the reporting code sent by the first terminal device;
[0045] A third sending module, configured to send the reporting code to the second terminal device, so that the second terminal device calls the reporting code to report data to the server during the running of the target program.
[0046] In addition, to achieve the above object, the present invention further provides a data reporting device, which is applied to a second terminal device. The data reporting device includes:
[0047] A third receiving module, configured to receive a reporting code sent by a server. The reporting code is generated by the first terminal device based on data reporting configuration information in the server. The target program is installed on the second terminal device;
[0048] A startup module, configured to receive a startup instruction of the target program to start the target program;
[0049] A reporting module, configured to call the reporting code to report data to the server during the running of the target program.
[0050] In addition, to achieve the above object, the present invention further provides a data reporting system. The data reporting system includes: a first terminal device, a second terminal device, and a server;
[0051] The server sends data reporting configuration information of a target program to the first terminal device. The target program is installed on the second terminal device;
[0052] The first terminal device generates a reporting code based on the data reporting configuration information and sends the reporting code to the server;
[0053] The server sends the reporting code to the second terminal device;
[0054] The second terminal device receives a start instruction of the target program to start the target program, and during the running of the target program, calls the reporting code to report data to the server.
[0055] In addition, to achieve the above object, the present invention further provides a data reporting device, which includes: a memory, a processor, and a first data reporting program, a second data reporting program, or a third data reporting program stored on the memory and running on the processor. When the first data reporting program is executed by the processor, it implements the steps of the foregoing data reporting method on the first terminal device side. When the second data reporting program is executed by the processor, it implements the steps of the foregoing data reporting method on the server side. When the third data reporting program is executed by the processor, it implements the steps of the foregoing data reporting method on the second terminal device side.
[0056] In addition, to achieve the above object, the present invention further provides a storage medium, on which a first data reporting program, a second data reporting program, or a third data reporting program is stored. When the first data reporting program is executed by a processor, it implements the steps of the foregoing data reporting method on the first terminal device side. When the second data reporting program is executed by the processor, it implements the steps of the foregoing data reporting method on the server side. When the second data reporting program is executed by the processor, it implements the steps of the foregoing data reporting method on the second terminal device side.
[0057] The technical solution provided by the present invention is that the server sends the data reporting configuration information of the target program to the first terminal device, where the target program is installed on the second terminal device; the first terminal device generates a reporting code based on the data reporting configuration information and sends the reporting code to the server, and the server sends the reporting code to the second terminal device, so that after receiving the reporting code, the second terminal device calls the reporting code to report data to the server during the running of the target program. That is to say, in the present invention, the reporting code is generated by the first terminal device based on the data reporting configuration information of the target program in the server. In this way, not only can the format of the reported data match the format of the server, reducing the probability of data reporting errors, but also the development cost of the reporting code can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 It is a schematic structural diagram of a data reporting device in a hardware operating environment related to the embodiment solution of the present invention;
[0059] Figure 2 It is a schematic flowchart of the first embodiment of the data reporting method of the present invention;
[0060] Figure 3It is a schematic flowchart of the second embodiment of the data reporting method of the present invention;
[0061] Figure 4 It is a schematic flowchart of the fourth embodiment of the data reporting method of the present invention;
[0062] Figure 5 It is a structural block diagram of the first embodiment of the data reporting device of the present invention;
[0063] Figure 6 It is a structural block diagram of the second embodiment of the data reporting device of the present invention;
[0064] Figure 7 It is a structural block diagram of the third embodiment of the data reporting device of the present invention.
[0065] The realization, functional characteristics and advantages of the object of the present invention will be further described with reference to the embodiments and the accompanying drawings. Specific embodiments
[0066] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0067] Refer to Figure 1 , Figure 1 It is a schematic structural diagram of a data reporting device for the hardware operating environment involved in the embodiment solution of the present invention.
[0068] The data reporting device may be a user equipment (UE) such as a mobile phone, a smart phone, a laptop computer, a digital broadcast receiver, a personal digital assistant (PDA), a tablet computer (PAD), a handheld device, a vehicle-mounted device, a wearable device, a computing device, a monitoring device, a server or other processing devices connected to a wireless modem, a mobile station (MS), etc.
[0069] Generally, the data reporting device includes: at least one processor 101, a memory 102, and a first data reporting program, a second data reporting program or a third data reporting program stored on the memory and executable on the processor. The first data reporting program is configured to implement the steps on the first terminal device side in the data reporting method described in any of the following embodiments. The second data reporting program is configured to implement the steps on the server side in the data reporting method described in any of the following embodiments. The third data reporting program is configured to implement the steps on the second terminal device side in the data reporting method described in any of the following embodiments.
[0070] The processor 101 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 101 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 101 may also include a main processor and a coprocessor. The main processor is a processor used to process data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 101 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. The processor 101 may also include an AI (Artificial Intelligence) processor, which is used to process operations related to the data reporting method, enabling the data reporting method model to autonomously train and learn, improving efficiency and accuracy.
[0071] The memory 102 may include one or more storage media, and the storage media may be non-transitory. The memory 102 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash storage devices. In some embodiments, the non-transitory storage media in the memory 102 is used to store at least one instruction, and the at least one instruction is used to be executed by the processor 101 to implement the steps on the first terminal device side, the server side, or the second terminal device side in the data reporting method provided in the method embodiments of the present application.
[0072] In some embodiments, the data reporting device may further optionally include: a communication interface 103 and at least one peripheral device. The processor 101, the memory 102, and the communication interface 103 may be connected by a bus or signal lines. Each peripheral device may be connected to the communication interface 103 through a bus, signal lines, or a circuit board. Specifically, the peripheral devices include at least one of a radio frequency circuit 104, a display screen 105, and a power supply 106.
[0073] The communication interface 103 can be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 101 and the memory 102. In some embodiments, the processor 101, the memory 102, and the communication interface 103 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 101, the memory 102, and the communication interface 103 can be implemented on a separate chip or circuit board, and this embodiment does not limit this.
[0074] The radio frequency circuit 104 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 104 communicates with a communication network and other communication devices through electromagnetic signals. The radio frequency circuit 104 converts an electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 104 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so on. The radio frequency circuit 104 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: a metropolitan area network, generations of mobile communication networks (2G, 3G, 4G, and 5G), a wireless local area network, and / or a WIFI (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 104 may further include a circuit related to NFC (Near Field Communication), and this application does not limit this.
[0075] The display screen 105 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 105 is a touch display screen, the display screen 105 also has the ability to collect touch signals on or above the surface of the display screen 105. The touch signals can be input as control signals to the processor 101 for processing. At this time, the display screen 105 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 105 can be one, the front panel of the electronic device; in other embodiments, the display screen 105 can be at least two, respectively arranged on different surfaces of the electronic device or in a foldable design; in other embodiments, the display screen 105 can be a flexible display screen, arranged on the curved surface or the folding surface of the electronic device. Even, the display screen 105 can also be set to an irregular non-rectangular shape, that is, a special-shaped screen. The display screen 105 can be prepared from materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0076] The power supply 106 is used to supply power to each component in the electronic device. The power supply 106 can be alternating current, direct current, a disposable battery, or a rechargeable battery. When the power supply 106 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology. Those skilled in the art can understand that Figure 1 the structure shown in does not constitute a limitation on the data reporting device, and may include more or fewer components than shown in the figure, or combine some components, or have different component arrangements.
[0077] In addition, an embodiment of the present invention further provides a storage medium, on which a first data reporting program, a second data reporting program, or a third data reporting program is stored. When the first data reporting program is executed by a processor, it implements the steps on the first terminal device side in the data reporting method described in any of the following embodiments. When the second data reporting program is executed by a processor, it implements the steps on the server side in the data reporting method described in any of the following embodiments. When the third data reporting program is executed by a processor, it implements the steps on the second terminal device side in the data reporting method described in any of the following embodiments. Therefore, no further elaboration will be provided here. In addition, the beneficial effects of using the same method will not be described in detail either. For the technical details not disclosed in the storage medium embodiment of the present application, please refer to the description of the method embodiment of the present application. By way of example, the program instructions can be deployed to be executed on one computing device, or on multiple computing devices located at one location, or, on multiple computing devices distributed at multiple locations and interconnected through a communication network.
[0078] Those of ordinary skill in the art can understand that to implement all or part of the processes in the methods of any of the following embodiments, it can be completed by instructing relevant hardware through a computer program. The first data reporting program or the second data reporting program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the following methods. Among them, the above storage medium can be a magnetic disk, an optical disc, a read-only memory (ROM), or a random access memory (RAM), etc.
[0079] In the related art, the reporting code of an application program is usually written manually. Manual writing is not only error-prone and costly, but also it is very difficult for the format of the reported data to exactly correspond to the data format of the server, resulting in a mismatch between the format of the reported data and the data format of the server.
[0080] To solve the above technical problems, based on the above hardware structure, various embodiments of the present invention are proposed.
[0081] Embodiment of the data reporting method:
[0082] Refer to Figure 2 , Figure 2 is a flowchart of the first embodiment of the data reporting method of the present invention. In the embodiment of the present invention, the data reporting method includes the following steps:
[0083] Step S21: The server sends the data reporting configuration information of the target program to the first terminal device.
[0084] It should be noted that the server can be a hardware device providing computing services or a cloud server. The first terminal device can be a terminal device such as a computer or a mobile phone.
[0085] The target program is a program that needs to report data to the server. It can be an application program. For example, it can be "WeChat", "QQ". Among them, the target program is installed on the second terminal device, and the second terminal device can be a terminal device such as a mobile phone, a computer, a TV, a refrigerator, etc.
[0086] The data reporting configuration information of the target program is the data reporting requirement of the target program. It can include the data to be reported, the format of the reported data, etc. Specifically, it can be flexibly set according to actual needs. It should be understood that different target programs have different data reporting requirements and corresponding different data reporting configuration information. Among them, the data reporting configuration information can be in the form of a bi-services.info file. Of course, it can also be in other forms.
[0087] In an embodiment of the present invention, the data reporting configuration information of the target program is stored in the server, and the server sends the data reporting configuration information of the target program to the first terminal device.
[0088] In some embodiments, the server can actively send the data reporting configuration information of the target program to the first terminal device. Or, after receiving the first download request sent by the first terminal device, the server responds to the first download request and sends the data reporting configuration information of the target program to the first terminal device. Among them, the first download request can be generated by the first terminal device based on user operations.
[0089] Step S22: The first terminal device generates a reporting code based on the data reporting configuration information.
[0090] In an embodiment of the present invention, after receiving the data reporting configuration information of the target program sent by the server, the first terminal device analyzes the data reporting configuration information and generates a reporting code based on the data reporting configuration information. Since the data reporting configuration information includes the data reporting requirements of the target program, the reporting code can be automatically generated based on the data reporting configuration information. Compared with the method of manually developing the reporting code, it can reduce the development cost and the probability of errors.
[0091] Step S23: The first terminal device sends the reporting code to the server.
[0092] In an embodiment of the present invention, after generating the reporting code, the first terminal device can send the reporting code to the server so that the server sends the reporting code to the second terminal device, enabling the second terminal device to call the reporting code to report data to the server during the running of the target program.
[0093] Step S24: The server sends the reported code to the second terminal device.
[0094] After receiving the reported code sent by the first terminal device, the server sends the reported code to the second terminal device, so that the second terminal device can call the reported code to report data to the server during the running of the target program.
[0095] In some embodiments, the server can actively send the reported code to the second terminal device after receiving the reported code. Alternatively, the server can send the reported code to the second terminal device in response to the second download request after receiving the second download request sent by the second terminal device. Among them, the second download request can be generated by the second terminal device based on user operations.
[0096] Step S25: The second terminal device receives the start instruction of the target program to start the target program.
[0097] The target program is installed on the second terminal device. Therefore, after receiving the reported code sent by the server, the second terminal device can receive the start instruction of the target program during the running process to start the target program. Among them, the start instruction of the target program can be generated based on user operations, that is, the user can trigger the start instruction of the target program through the user input interface of the second terminal device, where the user input interface includes but is not limited to at least one of a touch screen, a physical button, an audio pickup device (such as a microphone), etc.; or, the start instruction of the target program can be automatically generated when the second terminal device is powered on. Of course, the start instruction of the target program can also be generated in other ways.
[0098] Step S26: The second terminal device calls the reported code during the running of the target program to report data to the server.
[0099] After the second terminal device starts the target program, the target program is in a running state. During the running of the target program, the reported code can be called to make the reported code run, obtain the corresponding data and report it to the server.
[0100] Since the reported code is generated based on the data reporting configuration information of the target program provided by the server, the format of the data obtained and reported by calling the reported code matches the data format supported by the server.
[0101] It should be noted that the data reporting method provided by the embodiments of the present invention can be applied to the Android system. Of course, it can also be applied to other operating systems such as the ios system (that is, the mobile operating system developed by Apple Inc.).
[0102] In the data reporting method provided by an embodiment of the present invention, the server sends the data reporting configuration information of the target program to the first terminal device. The first terminal device generates a reporting code based on the data reporting configuration information and sends the reporting code to the server. The server then sends the reporting code to the second terminal device, so that after receiving the reporting code, the second terminal device calls the reporting code to report data to the server during the operation of the target program. That is to say, in the embodiment of the present invention, the reporting code is generated by the first terminal device based on the data reporting configuration information of the target program in the server. In this way, not only can the format of the reported data match the format of the server, reducing the probability of data reporting errors, but also the development cost of the reporting code can be reduced.
[0103] Based on the first embodiment, a second embodiment of the data reporting method of the present invention is proposed. Refer to Figure 3 , Figure 3 which is a schematic flowchart of the second embodiment of the data reporting method of the present invention. In the embodiment of the present invention, step S22 includes:
[0104] Step S221: The first terminal device generates a corresponding reporting sub-code for each target event.
[0105] It should be noted that in the embodiment of the present invention, the data reporting configuration information includes at least one target event.
[0106] It should be understood that an event is an operation that can be recognized by a control, such as pressing the OK button, selecting a certain radio button or checkbox. Each type of control is configured with the events it can recognize, such as events like form loading, clicking, double-clicking, etc., and text change events of an edit box (text box), etc. Events include system events and user events. System events are triggered by the system, such as every 24 hours, the deposit date of a bank depositor increases by one day. User events are triggered by users, such as when a user clicks a button, specific text is displayed in a text box.
[0107] The target event is an event for which data needs to be reported. It can be a "page jump event" (for example, an event of jumping from page A to page B), an event of an audio play button being triggered, etc. Specifically, it can be flexibly set according to actual needs.
[0108] Since the data reporting configuration information includes at least one target event, and for different target events, their corresponding reporting requirements are different. Therefore, after the first terminal device receives the data reporting configuration information of the target program, for each target event, it can generate a corresponding reporting sub-code. That is to say, for one target event, one segment of reporting sub-code is generated, so that when any target event occurs during the operation of the target program on the second terminal device, it can call the reporting sub-code corresponding to the target event to obtain the data of the target event, and report the data of the target to the server.
[0109] Step S222: The first terminal device generates a reporting code based on the reporting sub-code of each target event.
[0110] After the first terminal device generates the reporting sub-codes of all target events, it can generate a reporting code based on the reporting sub-code of each target event.
[0111] In the embodiment of the present invention, step S26 includes: during the operation of the target program on the second terminal device, when any target event occurs, it calls the reporting sub-code corresponding to the target event to obtain the data to be reported of the target event through the reporting sub-code, and reports the data to be reported of the target event to the server.
[0112] Since the reporting code is generated based on the reporting sub-code of each target event, the reporting code includes the reporting sub-code of each target event. During the operation of the target program, when it is monitored that any target event is triggered, the reporting sub-code corresponding to the target event can be called to make the reporting sub-code run, so that the second terminal device obtains the data to be reported of the target event through the reporting sub-code, and reports the data to be reported of the target event to the server.
[0113] Among them, the data to be reported of the target event may include at least one of data such as the occurrence time of the target event and the name of the target event. In order to enable the server to identify which program the data reported by the second terminal device belongs to, the data to be reported may also include the identifier of the target program, where the identifier of the target program may be the id (identity document, identity identification number) of the target program, etc.
[0114] In some embodiments, the data reporting configuration information may further include the data to be reported corresponding to each target event. The first terminal device may generate a corresponding reporting sub-code for each target event based on the target event and the data to be reported for the target event. During the running of the target program on the second terminal device, when any target event is sent, the reporting sub-code corresponding to the target event is called to obtain the data to be reported for the target event, and the data to be reported for the target event is reported to the server. For example, assuming the target event is "the event of jumping from page A to page B", the data to be reported corresponding to it may include the identifier of the target program, the event name, and the event occurrence time. Then, during the running of the target program on the second terminal device, when the event of jumping from page A to page B occurs, the corresponding reporting sub-code is called to obtain the identifier of the target program, the event name of this event, the occurrence time, etc., and the obtained data is used as the data to be reported and reported to the server.
[0115] In some embodiments, the data reporting configuration information may further include the identifier information of the target program. The first terminal device may parse out the identifier information of the target program from the data reporting configuration information so that the first terminal device can identify which target program the generated reporting code belongs to. In step S222, the first terminal device may generate a reporting code based on the reporting sub-code of each target event and the identifier information of the target program. That is to say, the reporting code includes the identifier information of the target program.
[0116] In the data reporting method provided by the embodiments of the present invention, the first terminal device generates a corresponding reporting sub-code for each target event and generates a reporting code based on the reporting sub-code of each target event. During the running of the target program on the second terminal device, when any target event occurs, the reporting sub-code corresponding to the target event is called to obtain the data to be reported for the target event through the reporting sub-code, and the data to be reported for the target event is reported to the server. In this way, when data needs to be reported when any target event occurs, only the reporting sub-code corresponding to the target event needs to be called, which can reduce the data processing volume and save power consumption.
[0117] Based on the second embodiment, the third embodiment of the data reporting method of the present invention is proposed. In the embodiments of the present invention, the first terminal device may use a gradle plug-in and Java (an object-oriented programming language) to generate a reporting SDK (Software Development Kit) based on the data reporting configuration information as the reporting code.
[0118] It should be understood that Gradle is an open-source project automation build tool based on the concepts of Apache Ant and Apache Maven. Apache Ant is a tool that links together and automates steps such as software compilation, testing, and deployment, and is mostly used for software development in a Java environment. Apache Maven is a project management and build automation tool.
[0119] Among them, when generating a reporting SDK based on data reporting configuration information using the Gradle plugin and Java, step S221 includes: for each target event, the first terminal device generates a corresponding reporting method as the reporting sub-code.
[0120] It should be understood that a method is a code block that can be repeatedly called. A method includes a method name, a method return value, and a method body.
[0121] In an embodiment of the present invention, the first terminal device can use the Gradle plugin to traverse each target event. For each target event, a reporting method is generated as the reporting sub-code corresponding to the target event, that is, one target event corresponds to one reporting method. Among them, the method name of the reporting method can be flexibly set according to actual needs. For example, it can be set to "report_target event identifier", and the target event identifier can be the name of the target event, etc. The method return value of the reporting method can be the data to be reported for the target event, and among them, the method return value can be stored in the form of a HashMap (hash map). The method body of the reporting method is the specific logic of the data reporting service.
[0122] Step S222 includes: the first terminal device generates a reporting SDK based on the reporting method of each target event.
[0123] It should be understood that a runnable Java file generally includes: a package name, a class signature, and methods. Among them, the package name is a string, and the class signature includes qualifiers, modifiers, and a class name. Among them, the qualifiers include public (public) and private (private). It should be understood that public has the largest access privilege, and the access privilege of private is limited to the inside of the class. The modifiers include static and final. Static is static, and final is immutable. The class name is a string.
[0124] In an embodiment of the present invention, the reporting SDK includes the aforementioned reporting method. The package name and class signature of the reporting SDK can be flexibly set according to actual needs. For example, the package name can be "AutoReport.java", and the class signature can be "public final class AutoReport", where "AutoReport" is the class name.
[0125] It should be noted that the above steps S221 and S222 can be executed by JavaWriter.
[0126] JavaWriter is a Java writer and a branch in the square open-source project javapoet.
[0127] In the data reporting method provided by an embodiment of the present invention, the first terminal device uses a gradle plugin and Java to generate a reporting SDK based on data reporting configuration information as reporting code, thereby achieving the automatic generation of reporting code.
[0128] Based on the foregoing embodiment, a fourth embodiment of the data reporting method of the present invention is proposed. Refer to Figure 4 , Figure 4 which is a schematic flowchart of the fourth embodiment of the data reporting method of the present invention. In an embodiment of the present invention, step S23 includes:
[0129] Step S231: The first terminal device packages the reporting code into the installation package of the target program.
[0130] To enable the second terminal device to obtain the reporting code, the first terminal device can package the reporting code into the installation package of the target program. That is, the installation package of the target program includes the reporting code.
[0131] Step S232: The first terminal device sends the installation package to the server.
[0132] After the first terminal device obtains the installation package including the reporting code, it sends the installation package to the server, so that the server sends the installation package to the second terminal device. After the second terminal device installs the target program based on the installation package and during the process of running the target program, it calls the reporting code to report data to the server.
[0133] In an embodiment of the present invention, step S24 includes: The server sends the installation package of the target program to the second terminal device.
[0134] Since the installation package sent by the first terminal device includes a reporting code, after the server receives the installation package sent by the first terminal device, it sends the installation package of the target program to the second terminal device, so that after the second terminal device installs the target program based on the installation package, during the process of running the target program, it calls the reporting code to report data to the server.
[0135] In the embodiment of the present invention, after step S24 and before step S25, the data reporting method further includes:
[0136] Step S27: The second terminal device installs the target program based on the installation package of the target program.
[0137] After the second terminal device receives the installation package of the target program including the reporting code, it installs the target program based on this installation package. Since this installation package includes the reporting code, during the subsequent process of running the target program, the reporting code can be called to report data to the server.
[0138] The data reporting method provided by the embodiment of the present invention packages the reporting code into the target program to obtain the installation package of the target program. In this way, after the second terminal device installs the target program based on the installation package, during the running process of the target program, the reporting code can be called to report data to the server, so that the reported data format matches the data format of the server.
[0139] Based on the foregoing embodiments, a fifth embodiment of the data reporting method of the present invention is proposed. In the embodiment of the present invention, step S23 includes:
[0140] Step 1: The first terminal device generates an upgrade package of the target program based on the reporting code and the target program.
[0141] It should be noted that for the target program that has been released and installed, in order to change the reporting method of the target program to the reporting method provided by the embodiment of the present invention, the first terminal device can generate an upgrade package of the target program based on the reporting code and the target program.
[0142] Step 2: The first terminal device sends the upgrade package of the target program to the server.
[0143] After the first terminal device obtains the upgrade package including the reporting code, it sends the upgrade package to the server, so that the server sends the upgrade package to the second terminal device, so that after the second terminal device upgrades the target program based on the upgrade package, during the process of running the target program, it calls the reporting code to report data to the server.
[0144] In the embodiment of the present invention, step S24 includes: The server sends the upgrade package of the target program to the second terminal device.
[0145] Since the upgrade package sent by the first terminal device includes a reporting code, after the server receives the upgrade package sent by the first terminal device, it sends the upgrade package of the target program to the second terminal device, so that after the second terminal device upgrades the target program based on the upgrade package, during the process of running the target program, it calls the reporting code to report data to the server.
[0146] In an embodiment of the present invention, after step S24 and before step S25, the data reporting method further includes:
[0147] Step S28: The second terminal device upgrades the target program based on the upgrade package of the target program.
[0148] After the second terminal device receives the upgrade package of the target program including the reporting code, it upgrades the target program based on the upgrade package so that the target program can call the reporting code. In this way, during the subsequent process of running the target program, the second terminal device can call the reporting code to report data to the server.
[0149] In the data reporting method provided by the embodiment of the present invention, the first terminal device generates an upgrade package of the target program based on the reporting code. In this way, the second terminal device can upgrade the target program based on the upgrade package, so that during the subsequent process of running the target program, the reporting code can be called to report data to the server, thereby realizing the upgrade of the data reporting method of the installed target program.
[0150] Based on the foregoing embodiments, a sixth embodiment of the data reporting method of the present invention is proposed. In an embodiment of the present invention, after step S25 and before step S26, the data reporting method further includes:
[0151] Step S29: The second terminal device initializes the reporting code so that the second terminal device can call system resources for the operation of the reporting code.
[0152] It should be understood that the operation of the reporting code requires the use of system resources such as hardware resources (such as memory, etc.), services, broadcasts, etc. In order for the second terminal device to call system resources for the operation of the reporting code, the second terminal device needs to initialize the reporting code. Among them, the specific implementation manner of the initialization can be flexibly set according to actual needs.
[0153] In some embodiments, step S29 includes:
[0154] Step S291: The second terminal device creates a content provider for the target program.
[0155] It should be noted that ContentProvider is a content provider and is one of the four major components of Android. Its function is to provide a unified interface for data sharing between different applications.
[0156] After receiving the startup instruction of the target program and starting the target program, a ContentProvider of the target program can be created.
[0157] Step S292: The second terminal device initializes the reporting code based on the ContentProvider, so that the second terminal device can call system resources for the operation of the reporting code.
[0158] After creating the ContentProvider of the target program, the second terminal device initializes the reporting code based on the ContentProvider, so that the second terminal device can call system resources for the operation of the reporting code. Using the ContentProvider to complete the initialization of the reporting code eliminates the need for developers to write corresponding initialization code, reducing costs.
[0159] In some embodiments, if the system of the second terminal device is the Android system, considering that the Android system includes a runtime, only when the code is connected to the runtime can the code obtain system resources. Therefore, in step S292, the second terminal device can initialize the reporting code based on the ContentProvider to connect the reporting code to the runtime, so that the second terminal device can call system resources for the operation of the reporting code.
[0160] In the data reporting method provided by the embodiments of the present invention, the second terminal device can initialize the reporting code to connect the reporting code to the runtime, so that the second terminal device can call system resources for the operation of the reporting code. Further, the second terminal device can initialize the reporting code based on the ContentProvider, eliminating the need for developers to write corresponding initialization code and reducing costs.
[0161] Embodiment of the data reporting system:
[0162] Based on the foregoing embodiments, a data reporting system is provided, including the foregoing first terminal device, server, and second terminal device.
[0163] The server sends the data reporting configuration information of the target program to the first terminal device, where the target program is installed on the second terminal device.
[0164] The first terminal device generates a reporting code based on the data reporting configuration information and sends the reporting code to the server.
[0165] The server sends the reporting code to the second terminal device.
[0166] The second terminal device receives the start instruction of the target program to start the target program, and during the running process of the target program, calls the reporting code to report data to the server.
[0167] Embodiment of the data reporting device:
[0168] Refer to Figure 5 , Figure 5 As shown in
[0169] The first receiving module 51 is configured to receive the data reporting configuration information of the target program sent by the server, where the target program is installed on the second terminal device.
[0170] The generating module 52 is configured to generate a reporting code based on the data reporting configuration information.
[0171] The first sending module 53 is configured to send the reporting code to the server, so that the server sends the reporting code to the second terminal device, and the second terminal device calls the reporting code to report data to the server during the running process of the target program.
[0172] It should be noted that the data reporting device may also optionally include corresponding modules to implement other steps on the first terminal device side in the above data reporting method.
[0173] Refer to Figure 6 , Figure 6 As shown in
[0174] The second sending module 61 is configured to send the data reporting configuration information of the target program to the first terminal device, so that the first terminal device generates a reporting code based on the data reporting configuration information, where the target program is installed on the second terminal device.
[0175] The second receiving module 62 is configured to receive the reporting code sent by the first terminal device.
[0176] The third sending module 63 is configured to send the reporting code to the second terminal device, so that the second terminal device calls the reporting code to report data to the server during the running process of the target program.
[0177] It should be noted that the data reporting device may also optionally include corresponding modules to implement other steps on the server side in the above data reporting method.
[0178] Refer toFigure 7 , Figure 7 This is a structural block diagram of the third embodiment of the data reporting device of the present invention. Among them, the data reporting device is applied to the second terminal device, and the data reporting device includes:
[0179] A third receiving module 71, configured to receive a reporting code sent by a server, where the reporting code is generated by a first terminal device based on data reporting configuration information of a target program in the server, and the target program is installed on the second terminal device.
[0180] A start module 72, configured to receive a start instruction of the target program to start the target program.
[0181] A reporting module 73, configured to call the reporting code during the running of the target program to report data to the server.
[0182] It should be noted that the data reporting device may also optionally include corresponding modules to implement other steps on the second terminal device side in the above data reporting method.
[0183] It should be noted that in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or system. Without more limitations, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or system including that element.
[0184] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0185] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc) as described above and includes several instructions for causing a terminal device to execute the methods described in various embodiments of the present invention.
[0186] The above are only optional embodiments of the present invention, and do not limit the patent scope of the present invention. Any equivalent structural transformation made by using the content of the specification and drawings of the present invention under the inventive concept of the present invention, or direct / indirect application in other related technical fields is included in the patent protection scope of the present invention.
Claims
1. A data reporting method, characterized in that: Applied to the first terminal device, the data reporting method includes: receiving data reporting configuration information of a target program sent by a server, wherein the target program is installed on a second terminal device; Generate a reporting code based on the data reporting configuration information; the data reporting configuration information is the data reporting requirement of the target program, and the data reporting requirement includes the data to be reported; The reporting code is sent to the server, so that the server sends the reporting code to the second terminal device, so that the second terminal device calls the reporting code to report data to the server during the process of running the target program.
2. The data reporting method according to claim 1, wherein: The step of sending the reporting code to the server so that the server sends the reporting code to the second terminal device, so that the second terminal device calls the reporting code to report data to the server during the process of running the target program, includes: Packing the reporting code into the installation package of the target program; The installation package is sent to the server, so that the server sends the installation package to the second terminal device, so that after the second terminal device installs the target program based on the installation package, it calls the reporting code to report data to the server during the process of running the target program.
3. The data reporting method according to claim 1 or 2, wherein: The data reporting configuration information includes at least one target event; The step of generating a reporting code based on the data reporting configuration information includes: For each target event, generate a corresponding reporting subcode; A reporting code is generated based on the reporting sub-code of each target event.
4. A data reporting method, characterized in that: Applied to the server, the data reporting method includes: Sending data reporting configuration information of the target program to the first terminal device, so that the first terminal device generates a reporting code based on the data reporting configuration information, and the target program is installed on the second terminal device; the data reporting configuration information is the data reporting requirement of the target program, and the data reporting requirement includes the data to be reported; Receiving the reporting code sent by the first terminal device; The reporting code is sent to the second terminal device, so that the second terminal device calls the reporting code to report data to the server during the process of running the target program.
5. The data reporting method according to claim 4, wherein: The step of receiving the reporting code sent by the first terminal device includes: receiving an installation package of the target program sent by the first terminal device, where the installation package includes the reporting code; The step of sending the reporting code to the second terminal device so that the second terminal device calls the reporting code to report data to the server during the process of running the target program includes: The installation package is sent to the second terminal device, so that after the second terminal device installs the target program based on the installation package, the reporting code is called to report data to the server during the process of running the target program.
6. A data reporting method, characterized in that: Applied to the second terminal device, the data reporting method includes: receiving a reporting code sent by a server, the reporting code being generated by the first terminal device based on data reporting configuration information of a target program in the server, the target program being installed on the second terminal device; the data reporting configuration information being a data reporting requirement of the target program, the data reporting requirement including data to be reported; receiving a start instruction of the target program to start the target program; During the running of the target program, the reporting code is called to report data to the server.
7. The data reporting method according to claim 6, wherein: The step of receiving the reporting code sent by the server includes: receiving an installation package of the target program sent by the server, wherein the installation package includes the reporting code; Before the step of receiving a startup instruction of the target program to start the target program, the data reporting method further includes: Based on the installation package, the target program is installed.
8. The data reporting method according to claim 6, wherein: During the running of the target program, before calling the reporting code and reporting the data to the server, the data reporting method further includes: Create a content provider for the target program; The reporting code is initialized based on the contentprovider, so that the second terminal device can call system resources for running the reporting code.
9. The data reporting method according to any one of claims 6 to 8, characterized in that: The reporting code includes at least one reporting sub-code of a target event; The step of calling the reporting code to report data to the server during the running of the target program includes: During the running of the target program, when any target event occurs, the reporting subcode corresponding to the target event is called to obtain the data to be reported of the target event through the reporting subcode, and report the data to be reported to the server.
10. A data reporting device, characterized in that: Applied to the first terminal device, the data reporting device includes: A first receiving module is configured to receive data reporting configuration information of a target program sent by a server, wherein the target program is installed on a second terminal device; A generating module, configured to generate a reporting code based on the data reporting configuration information; the data reporting configuration information is a data reporting requirement of the target program, and the data reporting requirement includes data to be reported; The first sending module is used to send the reporting code to the server, so that the server sends the reporting code to the second terminal device, so that the second terminal device calls the reporting code to report data to the server during the process of running the target program.
11. A data reporting device, characterized in that: Applied to a server, the data reporting device includes: a second sending module, configured to send data reporting configuration information of a target program to a first terminal device, so that the first terminal device generates a reporting code based on the data reporting configuration information, wherein the target program is installed on a second terminal device; the data reporting configuration information is a data reporting requirement of the target program, and the data reporting requirement includes data to be reported; A second receiving module is used to receive the reporting code sent by the first terminal device; The third sending module is used to send the reporting code to the second terminal device, so that the second terminal device calls the reporting code to report data to the server during the process of running the target program.
12. A data reporting device, characterized in that: Applied to the second terminal device, the data reporting device includes: a third receiving module, configured to receive a reporting code sent by the server, the reporting code being generated by the first terminal device based on data reporting configuration information of a target program in the server, the target program being installed on the second terminal device; the data reporting configuration information being a data reporting requirement of the target program, the data reporting requirement including data to be reported; A startup module, configured to receive a startup instruction of the target program to start the target program; The reporting module is used to call the reporting code during the operation of the target program to report data to the server.
13. A data reporting system, characterized in that: The data reporting system includes: a first terminal device, a second terminal device and a server; The server sends data reporting configuration information of the target program to the first terminal device, and the target program is installed on the second terminal device; the data reporting configuration information is the data reporting requirement of the target program, and the data reporting requirement includes the data to be reported; The first terminal device generates a reporting code based on the data reporting configuration information and sends the reporting code to the server; The server sends the reporting code to the second terminal device; The second terminal device receives the start instruction of the target program to start the target program, and during the running of the target program, calls the reporting code to report data to the server.
14. A data reporting device, characterized in that: The data reporting device includes: a memory, a processor, and a first data reporting program, a second data reporting program, or a third data reporting program stored in the memory and running on the processor. When the first data reporting program is executed by the processor, it implements the steps of the data reporting method according to any one of claims 1 to 3. When the second data reporting program is executed by the processor, it implements the steps of the data reporting method according to any one of claims 4 or 5. When the third data reporting program is executed by the processor, it implements the steps of the data reporting method according to any one of claims 6 to 9.
15. A storage medium, characterized in that: The storage medium stores a first data reporting program, a second data reporting program, or a third data reporting program. When the first data reporting program is executed by the processor, it implements the steps of the data reporting method according to any one of claims 1 to 3. When the second data reporting program is executed by the processor, it implements the steps of the data reporting method according to any one of claims 4 or 5. When the third data reporting program is executed by the processor, it implements the steps of the data reporting method according to any one of claims 6 to 9.
Citation Information
Patent Citations
Burying point dynamic setting method and system, equipment and storage medium thereof
CN110099101A
Monitoring method, system and equipment and medium
CN110635938A
Data acquisition method and device, storage medium and processor
CN111367562A