Data reporting method and device, electronic equipment and storage medium

By loading proxy components in the business system, dynamically building data structures and implanting bytecodes for data reporting behavior, the problem of coupling data reporting and business logic in the prior art is solved, and flexible data reporting and reducing test costs are achieved.

CN119576356APending Publication Date: 2025-03-07JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311146718.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-06
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

In the prior art, there is a strong coupling between data reporting and business logic, which leads to the need to modify the business logic code when adding the reporting field and increase the testing cost. The implementation method of AOP depends on the return value structure of the business logic, which has certain limitations.

Method used

After loading the proxy component, the configuration data is obtained and the data structure is constructed, including the correspondence between the implanted point object and the data reporting behavior. Receive the bytecode of the data reporting behavior, and use the proxy component to call the expression engine to analyze the data template, determine the reported parameter value, and complete the data reporting operation.

Benefits of technology

It realizes the flexibility and applicability of data reporting, avoids modification of business logic code, reduces testing costs, and ensures the stability of the business system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119576356A_ABST
    Figure CN119576356A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data reporting method and device, electronic equipment and a computer storage medium, which are applied to a service system based on an agent component, and the method comprises the following steps: after the agent component is loaded, obtaining configuration data through the agent component, so that the agent component constructs a data structure according to the configuration data; the data structure comprises a corresponding relation between at least one implantation point object and at least one data reporting behavior; receiving a byte code of each data reporting behavior; the byte code is implanted by the proxy component according to an implantation point object corresponding to each data reporting behavior in the data structure; and completing a corresponding data reporting operation based on the byte code of each data reporting behavior.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In related technologies, when there is a need for data reporting and quantitative analysis, it is usually implemented by hard coding or aspect-oriented programming (AOP). Among them, the hard-coding implementation method is to couple the reporting code to the business logic, and integrate the method input parameters and the calculation results of each intermediate stage to meet the data reporting requirements. The AOP implementation method is to add annotations, interceptors, etc. to the method to uniformly report data based on the input parameters and return values ​​after the business logic is executed.

[0003] However, the above hard-coded implementation method requires modifying the business logic code and re-launching it when adding reporting fields; this is because the reporting code is strongly coupled to the business logic, and the previous return value may not meet the current needs. This method not only requires changing the logic code, but also requires regression testing, which increases the testing cost; in addition, although the AOP implementation method can decouple business logic, it has certain limitations due to its reliance on the return value structure of the business logic. Summary of the invention

[0004] In view of the above problems, embodiments of the present application are proposed to provide a data reporting method, device, electronic device, and computer storage medium that overcome the above problems or at least partially solve the above problems.

[0005] The technical solution of this application is implemented as follows:

[0006] The present application provides a data reporting method, which is applied to an electronic device, and the method includes:

[0007] After the proxy component is loaded, configuration data is obtained through the proxy component, so that the proxy component constructs a data structure according to the configuration data; the data structure includes a corresponding relationship between at least one implantation point object and at least one data reporting behavior;

[0008] receiving a bytecode of each data reporting behavior; the bytecode is implanted by the proxy component according to an implantation point object corresponding to each data reporting behavior in the data structure;

[0009] Based on the bytecode of each data reporting behavior, the corresponding data reporting operation is completed.

[0010] In some embodiments, the data structure further includes a data template corresponding to each data reporting behavior, and the bytecode based on each data reporting behavior to complete the corresponding data reporting operation includes:

[0011] Run the bytecode of each data reporting behavior, and call the expression engine through the proxy component to parse the data template corresponding to each data reporting behavior to obtain a corresponding reporting parameter group;

[0012] The expression engine is used to determine the parameter value of each reporting parameter in the reporting parameter group, and based on the parameter values ​​of each reporting parameter corresponding to each data reporting behavior, the corresponding data reporting operation is completed.

[0013] In some embodiments, the data structure further includes a parameter value method corresponding to each data template, and the determining of the parameter value of each reported parameter in the reported parameter group by the expression engine includes:

[0014] The parameter value method corresponding to each data template is obtained through the expression engine, so that the expression engine determines the parameter value of each reporting parameter in the reporting parameter group based on the parameter value method corresponding to each data template.

[0015] In some embodiments, the proxy component establishes a connection with a software development kit (SDK), and the corresponding data reporting operation is completed based on the parameter values ​​of each reporting parameter corresponding to each data reporting behavior, including:

[0016] The proxy component calls the Application Programming Interface (API) of the SDK to report the parameter values ​​of each reporting parameter corresponding to each data reporting behavior, thereby completing the corresponding data reporting operation.

[0017] In some embodiments, the proxy component establishes a connection with a configuration center, and the configuration center stores the configuration data; the method further includes:

[0018] After the configuration center detects that the configuration data has changed, the changed configuration data is pushed to the proxy component, so that the proxy component updates the data structure according to the changed configuration data to obtain an updated data structure; the changed configuration data is obtained by changing the configuration data according to the data reporting requirements;

[0019] The bytecode for receiving each data reporting behavior includes:

[0020] Receive the bytecode implanted by the proxy component according to the implantation point object corresponding to each data reporting behavior in the updated data structure.

[0021] In some embodiments, when the changed configuration data includes the changed data corresponding to the implantation point, the proxy component updates the data structure according to the changed configuration data, including:

[0022] The proxy component constructs a changed implantation point object according to the change data corresponding to the implantation point;

[0023] Based on the changed implantation point object, the data structure is updated.

[0024] In some embodiments, when the changed configuration data includes changed data corresponding to the data template, the proxy component updates the data structure according to the changed configuration data, including:

[0025] The proxy component constructs a changed data template according to the changed data corresponding to the data template;

[0026] Based on the changed data template, the data structure is updated.

[0027] The embodiment of the present application also proposes a data reporting device, which is applied to a business system based on an agent component, and the device includes:

[0028] A construction module, configured to obtain configuration data through the proxy component after loading the proxy component, so that the proxy component constructs a data structure according to the configuration data; the data structure includes a corresponding relationship between at least one implantation point object and at least one data reporting behavior;

[0029] A receiving module, used for receiving the bytecode of each data reporting behavior; the bytecode is implanted by the proxy component according to the implantation point object corresponding to each data reporting behavior in the data structure;

[0030] The reporting module is used to complete the corresponding data reporting operation based on the bytecode of each data reporting behavior.

[0031] An embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the data reporting method provided by one or more of the aforementioned technical solutions when executing the program.

[0032] An embodiment of the present application provides a computer storage medium, which stores a computer program; after the computer program is executed by a processor, it can implement the data reporting method provided by one or more of the above-mentioned technical solutions.

[0033] The embodiment of the present application proposes a data reporting method, device, electronic device and computer storage medium, which is applied to a business system based on an agent component. The method includes: after loading the agent component, obtaining configuration data through the agent component, so that the agent component constructs a data structure according to the configuration data; the data structure includes a correspondence between at least one implantation point object and at least one data reporting behavior; receiving the bytecode of each data reporting behavior; the bytecode is implanted by the agent component according to the implantation point object corresponding to each data reporting behavior in the data structure; based on the bytecode of each data reporting behavior, completing the corresponding data reporting operation.

[0034] It can be seen that in the embodiment of the present application, the bytecode of each data reporting behavior in the business system is dynamically implanted through the loaded proxy component. Since the implantation of the bytecode is related to the implantation point object in the data structure, and the data structure is constructed by the proxy component according to the acquired configuration data, when there is a subsequent modification requirement related to any data reporting behavior, for example, modifying the reporting field, modifying the data template, etc., it is only necessary to make corresponding modifications to the configuration data. In this way, the proxy component will dynamically update the data structure according to the modified configuration data to implement the update of the data reporting behavior, so that the reporting parameters do not need to rely on the return value structure of the business logic, thereby improving the applicability of the business system; in addition, since the entire process does not involve the modification of the business logic code in the business system, there is no need for re-inspiration and test regression. In this way, while saving testing costs, the stability of the business system can be ensured. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a flowchart of a data reporting method in an embodiment of the present application;

[0036] Figure 2 is a schematic diagram of constructing an implant point object in an embodiment of the present application;

[0037] Figure 3 It is a flowchart of another data reporting method in an embodiment of the present application;

[0038] Figure 4 It is a schematic diagram of the structure of the data reporting device according to an embodiment of the present application;

[0039] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0040] The present application will be further described in detail below in conjunction with the accompanying drawings and Examples. It should be understood that the embodiments provided herein are only used to explain the present application and are not intended to limit the present application. In addition, the embodiments provided below are partial embodiments for implementing the present application, rather than providing all embodiments for implementing the present application. In the absence of conflict, the technical solutions recorded in the embodiments of the present application can be implemented in any combination.

[0041] It should be noted that, in the embodiments of the present application, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a method or apparatus including a series of elements includes not only the elements explicitly recorded, but also includes other elements not explicitly listed, or also includes elements inherent to the implementation of the method or apparatus. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other related elements (such as steps in a method or units in a device, for example, a unit may be a portion of a circuit, a portion of a processor, a portion of a program or software, etc.) in the method or apparatus including the element.

[0042] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, I and / or J can represent the three situations that I exists alone, I and J exist at the same time, and J exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of I, J, and R can represent including any one or more elements selected from the set consisting of I, J, and R.

[0043] For example, the data reporting method provided in the embodiment of the present application includes a series of steps, but the data reporting method provided in the embodiment of the present application is not limited to the recorded steps. Similarly, the data reporting device provided in the embodiment of the present application includes a series of modules, but the data reporting device provided in the embodiment of the present application is not limited to including the modules explicitly recorded, and may also include modules required to obtain relevant task data or perform processing based on task data.

[0044] The embodiments of the present application can be applied to a computer system composed of a terminal device and a server, and can operate with many other general or special computing system environments or configurations. Here, the terminal device can be a thin client, a thick client, a handheld or laptop device, a microprocessor-based system, a set-top box, a programmable consumer electronic product, a network personal computer, a small computer system, etc., and the server can be a small computer system, a large computer system, and a distributed cloud computing technology environment including any of the above systems, etc.

[0045] Electronic devices such as terminal devices and servers can implement corresponding functions through the execution of program modules. Generally, program modules can include routines, programs, target programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in a distributed cloud computing environment, in which tasks are performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.

[0046] In the related technologies, the implementation methods of hard coding or AOP still have the following disadvantages: First, it is impossible to respond to temporary data needs in a timely manner; specifically, when the business party wants to make decisions on the next plan through some data analysis, if there are currently missing points or incomplete data reporting, it is difficult to provide data support, and they can only schedule releases based on demand and perform test regression, which increases testing costs. Secondly, since the business system needs to be connected to the SDK, when the underlying data structure changes or the SDK version changes, the business system needs to be updated and modified, resulting in large changes and increased testing costs. Although the AOP implementation method can decouple the main business logic, it can only be partially universal due to its reliance on the return value structure of the main business logic, and it is difficult to meet some personalized needs.

[0047] In view of the above technical problems, the following embodiments are proposed.

[0048] In some embodiments of the present application, the data reporting method can be implemented using a processor in a data reporting device, and the above-mentioned processor can be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, and a microprocessor.

[0049] Figure 1 is a flow chart of a data reporting method in an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:

[0050] Step 100: After the proxy component is loaded, configuration data is obtained through the proxy component, so that the proxy component constructs a data structure according to the configuration data.

[0051] In an embodiment of the present application, the data reporting method can be applied to a business system based on an agent component. The business system can be understood as a front-end application (Application, App) of the business system, hereinafter referred to as the system. The system is connected to the agent component, which integrates the data to be reported through the agent component to complete the data reporting operation; here, the agent component can be a JavaAgent; illustratively, the data to be reported can be reported to the data center for subsequent display and quantitative analysis and other processing operations.

[0052] Exemplarily, the proxy component can be a JavaAgent, or it can be other related components that can complete the data reporting operation; the following is an exemplary explanation using JavaAgent as an example; wherein the JavaAgent as a whole can include three components, namely, an implantation point, a behavior, and an environment. Here, the implantation point is equivalent to the implantation position, which refers to the position in the business logic where the bytecode (also called code) that executes the data reporting behavior is inserted. Behavior refers to the operation to be performed after the code is implanted, and the data reporting behavior is one of the operations. The environment stores some constants or objects of the business system operating environment. For example, the startup parameters of the Java Virtual Machine (JVM), the system parameter configuration in the configuration center, the business application configuration file, and the spring context (context), etc., are used to obtain and calculate the reported data.

[0053] In an embodiment of the present application, the business system will load JavaAgent before it is fully started. After loading JavaAgent, JavaAgent will initialize the bytecode tool (ByteBuddy) and obtain configuration data from the configuration center; here, JavaAgent establishes a connection with the configuration center, and the configuration center stores the configuration data; exemplarily, the configuration center can be understood as an operation background, which can provide an operating platform for relevant personnel, such as programmers, and obtain configuration data that meets data reporting requirements based on the operations of relevant personnel; exemplarily, the configuration data can include data related to at least one implantation point configuration and data related to at least one behavior configuration, etc.; here, behavior refers to data reporting behavior.

[0054] Exemplarily, the data related to the implantation point configuration may include the name of the business method to be implanted and the parameter list of the business method, etc.; the data related to the behavior configuration may include the various reporting fields, data modules and parameter value methods corresponding to the data reporting behavior, etc.

[0055] Furthermore, after JavaAgent obtains the configuration data from the configuration center, it can construct a data structure based on the configuration data; in addition to including at least one implantation point object, at least one data reporting behavior, and the correspondence between at least one implantation point object and at least one data reporting behavior, the data structure can also include a data template corresponding to each data reporting behavior and a parameter value method corresponding to each data template; here, the correspondence indicates what kind of behavior the bytecode of this implantation point object needs to execute. Figure 2 , methodName is the name of the business method to be implanted, and arguments is the parameter list of the business method. JavaAgent can construct the location of the business method, that is, the implantation point object, through the method name and parameter list.

[0056] Step 101: Receive the bytecode of each data reporting behavior.

[0057] Exemplarily, the bytecode of each data reporting behavior can be pre-written by relevant personnel and stored in the configuration center; after JavaAgent builds the data structure, JavaAgent can obtain the bytecode of each data reporting behavior from the configuration center through the initialized bytecode tool; then, according to the implantation point object corresponding to each data reporting behavior included in the data structure, the bytecode of each data reporting behavior is implanted into the business system, and at this time, the business system can receive the bytecode of each data reporting behavior.

[0058] In one embodiment, the bytecode of each data reporting behavior is implanted into a designated location of the business system. The designated location may be the exit of a designated business method, that is, JavaAgent implants the entry function of each data reporting behavior into the exit of a designated business method of the business system according to the implantation point object corresponding to each data reporting behavior; here, the exit of the business method is equivalent to a unified entry of the data reporting behavior, which is used to receive the bytecode of each data reporting behavior implanted by JavaAgent; the bytecode of each data reporting behavior will be encapsulated in the entry function for execution. Exemplarily, assuming that bizMehthod is the name of the designated business method, and System.out.println("abc") is the business logic of the designated business method; usually, the downstream code of the business logic corresponds to the exit of the designated business method.

[0059] Step 101: Based on the bytecode of each data reporting behavior, complete the corresponding data reporting operation.

[0060] In some embodiments, completing the corresponding data reporting operation based on the bytecode of each data reporting behavior may include: running the bytecode of each data reporting behavior, and calling the expression engine through the proxy component to parse the data template corresponding to each data reporting behavior to obtain the corresponding reporting parameter group; determining the parameter value of each reporting parameter in the reporting parameter group through the expression engine, and completing the corresponding data reporting operation based on the parameter values ​​of each reporting parameter corresponding to each data reporting behavior.

[0061] In one embodiment, after the business system receives the bytecode of each data reporting behavior implanted by the JavaAgent, if the business system is in a running state, the bytecode of each implanted data reporting behavior will be run.

[0062] Exemplarily, since the data structure includes a data template corresponding to each data reporting behavior, in the process of running the bytecode of each data reporting behavior, the data template corresponding to each data reporting behavior can be parsed by the expression engine to obtain the corresponding reporting parameter group; here, the reporting parameter value includes at least one reporting parameter that needs to be reported, and each reporting parameter corresponds to a field.

[0063] In some embodiments, determining the parameter value of each reported parameter in a reported parameter group through an expression engine may include: obtaining the parameter value method corresponding to each data template through the expression engine, so that the expression engine determines the parameter value of each reported parameter in the reported parameter group based on the parameter value method corresponding to each data template.

[0064] Here, the parameter value selection method can be represented by an expression; wherein the expression can be composed of one or more fields, operators, or functions, which is not limited in the embodiments of the present application.

[0065] Exemplarily, the expression engine can obtain corresponding data from channels such as the environment or spring context, or obtain corresponding data from channels such as the environment or spring context and convert it according to the parameter value selection method corresponding to each data template obtained, so as to determine the parameter value of each reported parameter in the reported parameter group.

[0066] For example, assuming that the reporting parameter group includes three reporting parameters: activity identification (Identification, Id), activity name and activity budget, which can be represented as act.id, act.name and act.price respectively, if the parameter value methods corresponding to these three reporting parameters are: act.id = ${env.id}, act.name = ${env.name}, act.price = #{${env.price}*100}; where ${env.id} is the field corresponding to act.id, ${env.name} is ac The field corresponding to t.name, #{${env.price}*100} is the field corresponding to act.price; when determining the parameter values ​​of act.id and act.name, the expression engine will parse the two fields ${env.id} and ${env.name} and obtain the corresponding data from the environment as the parameter values ​​of the two reported parameters; when determining the parameter value of act.price, the expression engine will parse the field ${env.price}, obtain the value corresponding to the field from the environment, and multiply the value by 100 as the parameter value of act.price.

[0067] In some embodiments, based on the parameter values ​​of each reporting parameter corresponding to each data reporting behavior, completing the corresponding data reporting operation can include: calling the API interface of the SDK through the proxy component, reporting the parameter values ​​of each reporting parameter corresponding to each data reporting behavior, and completing the corresponding data reporting operation.

[0068] In an embodiment of the present application, the proxy component, i.e., JavaAgent, will establish a connection with the SDK in advance. After JavaAgent obtains the parameter values ​​of each reporting parameter corresponding to each data reporting behavior, it can report the parameter values ​​of each reporting parameter corresponding to each data reporting behavior to the data center by calling the API interface of the SDK, thereby completing the corresponding data reporting operation.

[0069] It should be noted that when the SDK version changes due to upgrade or other reasons, the JavaAgent can be upgraded accordingly; in this way, when the business system needs to report data later, it is only necessary to reconnect the upgraded JavaAgent to the business system without modifying any business code in the business system; in this way, a certain amount of testing costs can be saved.

[0070] An embodiment of the present application proposes a data reporting method, which includes: after loading the proxy component, obtaining configuration data through the proxy component, so that the proxy component constructs a data structure according to the configuration data; the data structure includes a correspondence between at least one implantation point object and at least one data reporting behavior; receiving the bytecode of each data reporting behavior; the bytecode is implanted by the proxy component according to the implantation point object corresponding to each data reporting behavior in the data structure; based on the bytecode of each data reporting behavior, completing the corresponding data reporting operation.

[0071] It can be seen that in the embodiment of the present application, the bytecode of each data reporting behavior in the business system is dynamically implanted through the loaded proxy component. Since the implantation of the bytecode is related to the implantation point object in the data structure, and the data structure is constructed by the proxy component according to the acquired configuration data, when there is a subsequent modification requirement related to any data reporting behavior, for example, modifying the reporting field, modifying the data template, etc., it is only necessary to make corresponding modifications to the configuration data. In this way, the proxy component will dynamically update the data structure according to the modified configuration data to implement the update of the data reporting behavior, so that the reporting parameters do not need to rely on the return value structure of the business logic, thereby improving the applicability of the business system; in addition, since the entire process does not involve the modification of the business logic code in the business system, there is no need for re-inspiration and test regression. In this way, while saving testing costs, the stability of the business system can be ensured.

[0072] In some embodiments, the above method may further include: after the configuration center detects that the configuration data has changed, pushing the changed configuration data to the proxy component, so that the proxy component updates the data structure according to the changed configuration data to obtain an updated data structure.

[0073] Exemplarily, when JavaAgent obtains the updated data structure, JavaAgent will implant the bytecode of each data reporting behavior into the business system according to the implantation point object corresponding to each data reporting behavior included in the updated data structure, so that the business system completes the corresponding data reporting operation based on the bytecode of each data reporting behavior.

[0074] In one embodiment, the changed configuration data can be obtained by relevant personnel changing the configuration data according to data reporting requirements; here, the changed configuration data includes but is not limited to at least one of the following: change data corresponding to the implantation point, change data corresponding to the data template.

[0075] Exemplarily, when there is a need to increase the data reporting needs of data embedding points, relevant personnel can change the implantation points included in the configuration data in the configuration center to obtain change data corresponding to the implantation points; the change data may include the added implantation points and the data template and parameter value method of the data reporting behavior corresponding to the implantation points.

[0076] Exemplarily, when there is a need to modify the data reporting of the data template, relevant personnel can change the data template of the data reporting behavior included in the configuration data in the configuration center to obtain the change data corresponding to the data template; the change data may include added or decreased parameters and the value taking method of the added parameters, etc.

[0077] It can be understood that the configuration center can obtain the corresponding changed configuration data based on the configuration data and at least one of the change data corresponding to the implantation point and the change data corresponding to the data template, and push the changed configuration data to the JavaAgent.

[0078] Exemplarily, in the case where the changed configuration data includes the changed data corresponding to the implant point, when the JavaAgent receives the changed configuration data, it can construct the changed implant point object according to the changed data corresponding to the implant point; based on the changed implant point object, the data structure is updated to obtain an updated data structure. Here, the updated data structure can include the changed implant point object and the data reporting behavior corresponding to the changed implant point object.

[0079] Exemplarily, in the case where the changed configuration data includes the changed data corresponding to the data template, when the JavaAgent receives the changed configuration data, it can construct the changed data template according to the changed data corresponding to the data template; based on the changed data template, the data structure is updated to obtain an updated data structure. Here, the updated data structure can include the changed data template, and the data reporting behavior corresponding to the changed data template and the implantation point object.

[0080] Furthermore, when JavaAgent obtains the updated data structure, JavaAgent will implant the bytecode of each data reporting behavior into the business system according to the implantation point object corresponding to each data reporting behavior included in the updated data structure; the corresponding implementation process is similar to the above embodiment and will not be repeated here.

[0081] It can be seen that in the embodiment of the present application, when the data reporting demand changes, the configuration data is changed accordingly in the configuration center, and the changed configuration data is pushed to the JavaAgent, so that the JavaAgent can respond to the data reporting demand in a timely manner; the business system realizes the dynamic effectiveness of the reporting function based on the data structure updated by the JavaAgent. The whole process is independent of the business logic of the business and does not require re-initiating the version and testing regression.

[0082] In order to better reflect the purpose of the present application, further examples are given based on the above embodiments of the present application.

[0083] Figure 3 is a flow chart of another data reporting method in an embodiment of the present application, such as Figure 3 As shown, the method comprises the following steps:

[0084] Step 200: The business system starts loading JavaAgent.

[0085] Step 201: JavaAgent initializes the bytecode tool.

[0086] Step 202: JavaAgent obtains configuration data from the configuration center.

[0087] Step 203: JavaAgent constructs a data structure according to the configuration data.

[0088] Step 204: JavaAgent implants the bytecode of each data reporting behavior into the business system.

[0089] Exemplarily, steps 200 to 204 are implemented during the startup loading phase of the business system.

[0090] Step 205: The business system runs the bytecode of each data reporting behavior.

[0091] Step 206: JavaAgent calls the expression engine to parse the data template corresponding to each data reporting behavior, and determines the parameter value of each reporting parameter in the reporting parameter group obtained by the parsing.

[0092] Step 207: JavaAgent reports the parameter values ​​of each reporting parameter corresponding to each data reporting behavior to the data center, completing the corresponding data reporting operation.

[0093] Exemplarily, steps 205 to 207 are implemented during the business operation phase of the business system.

[0094] Step 208: The configuration center pushes the changed configuration data to the JavaAgent, where the changed configuration data includes the changed data corresponding to the data template.

[0095] Step 209: JavaAgent constructs a changed data template according to the changed configuration data.

[0096] Exemplarily, step 208 and step 209 correspond to the case where the data module is changed.

[0097] Step 210: The configuration center pushes the changed configuration data to the JavaAgent, where the changed configuration data includes the changed data corresponding to the implantation point.

[0098] Step 211: JavaAgent constructs the changed implantation point object according to the changed configuration data.

[0099] Step 212: JavaAgent updates the data structure based on the changed implantation point object, and implants the bytecode of the data reporting behavior into the business system according to the data reporting behavior corresponding to the changed implantation point object in the updated data structure.

[0100] Exemplarily, step 210 and step 212 correspond to the case where the implantation point is changed; it should be noted that there is no limitation on the execution order between the steps corresponding to the data module change and the steps corresponding to the implantation point change, which can be determined according to business needs.

[0101] It can be seen that in the embodiment of the present application, the business system can access the data reporting capability by starting to attach JavaAgent; specifically, the reported data is integrated through JavaAgent, and the bytecode of each data reporting behavior is implanted into the business logic; the entire data reporting process is completely decoupled from the business system, and when there is a need to change data, the changed data can be pushed through the configuration center to make the data reporting function take effect in real time, and the changes in data reporting needs can be responded to in a timely manner by parsing the data template.

[0102] Figure 4 Schematic diagram of the structure of the data reporting device in the embodiment of the present application. Figure 4 As shown, the device includes: a construction module 300, a receiving module 301 and a reporting module 302, wherein:

[0103] A construction module 300 is used to obtain configuration data through the proxy component after loading the proxy component, so that the proxy component constructs a data structure according to the configuration data; the data structure includes a corresponding relationship between at least one implantation point object and at least one data reporting behavior;

[0104] The receiving module 301 is used to receive the bytecode of each data reporting behavior; the bytecode is implanted by the proxy component according to the implantation point object corresponding to each data reporting behavior in the data structure;

[0105] The reporting module 302 is used to complete the corresponding data reporting operation based on the bytecode of each data reporting behavior.

[0106] In some embodiments, the data structure further includes a data template corresponding to each data reporting behavior, and the reporting module 302 is further used to:

[0107] Run the bytecode of each data reporting behavior, and call the expression engine through the proxy component to parse the data template corresponding to each data reporting behavior to obtain a corresponding reporting parameter group;

[0108] The expression engine is used to determine the parameter value of each reporting parameter in the reporting parameter group, and based on the parameter values ​​of each reporting parameter corresponding to each data reporting behavior, the corresponding data reporting operation is completed.

[0109] In some embodiments, the data structure further includes a parameter value method corresponding to each data template, and the reporting module 302 is further used to:

[0110] The parameter value method corresponding to each data template is obtained through the expression engine, so that the expression engine determines the parameter value of each reporting parameter in the reporting parameter group based on the parameter value method corresponding to each data template.

[0111] In some embodiments, the proxy component establishes a connection with the SDK, and the reporting module 302 is further used to:

[0112] The proxy component calls the API interface of the SDK to report the parameter values ​​of each reporting parameter corresponding to each data reporting behavior, thereby completing the corresponding data reporting operation.

[0113] In some embodiments, the proxy component establishes a connection with a configuration center, and the configuration center stores the configuration data; the device further includes a change module, and the change module is used to:

[0114] After the configuration center detects that the configuration data has changed, the changed configuration data is pushed to the proxy component, so that the proxy component updates the data structure according to the changed configuration data to obtain an updated data structure; the changed configuration data is obtained by changing the configuration data according to the data reporting requirements;

[0115] The receiving module 301 is further used for:

[0116] Receive the bytecode implanted by the proxy component according to the implantation point object corresponding to each data reporting behavior in the updated data structure.

[0117] In some embodiments, when the changed configuration data includes change data corresponding to the implantation point, the change module is further used to:

[0118] The proxy component constructs a changed implantation point object according to the change data corresponding to the implantation point;

[0119] Based on the changed implantation point object, the data structure is updated.

[0120] In some embodiments, when the changed configuration data includes changed data corresponding to the data template, the changing module is further used to:

[0121] The proxy component constructs a changed data template according to the changed data corresponding to the data template;

[0122] Based on the changed data template, the data structure is updated.

[0123] In practical applications, the above-mentioned building module 300, receiving module 301, reporting module 302 and change module can all be implemented by a processor located in an electronic device, and the processor can be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor.

[0124] In addition, each functional module in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or software functional modules.

[0125] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent commodity, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or the part that contributes to the relevant technology or the whole or part of the technical solution can be embodied in the form of a software commodity. The computer software commodity is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method of this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc. Various media that can store program codes.

[0126] Specifically, a computer program instruction corresponding to a data reporting method in this embodiment can be stored on a storage medium such as a CD, a hard disk, or a USB flash drive. When the computer program instruction corresponding to a data reporting method in the storage medium is read or executed by an electronic device, any one of the data reporting methods in the aforementioned embodiments is implemented.

[0127] Based on the same technical concept as the above embodiments, see Figure 5 , which shows an electronic device 400 provided in an embodiment of the present application, which may include: a memory 401 and a processor 402; wherein,

[0128] Memory 401, used for storing computer programs and data;

[0129] The processor 402 is used to execute the computer program stored in the memory to implement any one of the data reporting methods in the foregoing embodiments.

[0130] In practical applications, the memory 401 may be a volatile memory, such as RAM; or a non-volatile memory, such as ROM, flash memory, hard disk drive (HDD) or solid-state drive (SSD); or a combination of the above types of memory, and provide instructions and data to the processor 402.

[0131] The processor 402 may be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor. It is understandable that for different electronic devices, the electronic device used to implement the processor function may also be other, which is not specifically limited in the embodiments of the present application.

[0132] In some embodiments, the functions or modules included in the device provided in the embodiments of the present application can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments. For the sake of brevity, it will not be repeated here.

[0133] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0134] The methods disclosed in the various method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0135] The features disclosed in the various commodity embodiments provided in this application can be arbitrarily combined without conflict to obtain new commodity embodiments.

[0136] The features disclosed in the various method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0137] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of hardware embodiments, software embodiments, or embodiments in combination with software and hardware. Moreover, the present application may adopt the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program codes.

[0138] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0139] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0140] The above are only preferred embodiments of the present application and are not intended to limit the protection scope of the present application.

Claims

1. A data reporting method, characterized in that: Applied to a business system based on an agent component, the method comprises: After the proxy component is loaded, configuration data is obtained through the proxy component, so that the proxy component constructs a data structure according to the configuration data; the data structure includes a corresponding relationship between at least one implantation point object and at least one data reporting behavior; receiving a bytecode of each data reporting behavior; the bytecode is implanted by the proxy component according to an implantation point object corresponding to each data reporting behavior in the data structure; Based on the bytecode of each data reporting behavior, the corresponding data reporting operation is completed.

2. The method according to claim 1, characterized in that The data structure also includes a data template corresponding to each data reporting behavior, and the bytecode based on each data reporting behavior completes the corresponding data reporting operation, including: Run the bytecode of each data reporting behavior, and call the expression engine through the proxy component to parse the data template corresponding to each data reporting behavior to obtain a corresponding reporting parameter group; The expression engine is used to determine the parameter value of each reporting parameter in the reporting parameter group, and based on the parameter values ​​of each reporting parameter corresponding to each data reporting behavior, the corresponding data reporting operation is completed.

3. The method according to claim 2, characterized in that The data structure also includes a parameter value method corresponding to each data template, and the parameter value of each reported parameter in the reported parameter group is determined by the expression engine, including: The parameter value method corresponding to each data template is obtained through the expression engine, so that the expression engine determines the parameter value of each reporting parameter in the reporting parameter group based on the parameter value method corresponding to each data template.

4. The method according to claim 2 or 3, characterized in that: The proxy component establishes a connection with the software development kit, and the corresponding data reporting operation is completed based on the parameter values ​​of each reporting parameter corresponding to each data reporting behavior, including: The proxy component calls the application programming interface of the software development kit to report the parameter values ​​of each reporting parameter corresponding to each data reporting behavior, thereby completing the corresponding data reporting operation.

5. The method according to claim 1, characterized in that The proxy component establishes a connection with a configuration center, and the configuration center stores the configuration data; the method further includes: After the configuration center detects that the configuration data has changed, the changed configuration data is pushed to the proxy component, so that the proxy component updates the data structure according to the changed configuration data to obtain an updated data structure; the changed configuration data is obtained by changing the configuration data according to the data reporting requirements; The bytecode for receiving each data reporting behavior includes: Receive the bytecode implanted by the proxy component according to the implantation point object corresponding to each data reporting behavior in the updated data structure.

6. The method according to claim 5, characterized in that In a case where the changed configuration data includes the changed data corresponding to the implantation point, the proxy component updates the data structure according to the changed configuration data, including: The proxy component constructs a changed implantation point object according to the change data corresponding to the implantation point; Based on the changed implantation point object, the data structure is updated.

7. The method according to claim 5, characterized in that In a case where the changed configuration data includes changed data corresponding to the data template, the proxy component updates the data structure according to the changed configuration data, including: The proxy component constructs a changed data template according to the changed data corresponding to the data template; Based on the changed data template, the data structure is updated.

8. A data reporting device, characterized in that: Applied to a business system based on an agent component, the device comprises: A construction module, configured to obtain configuration data through the proxy component after loading the proxy component, so that the proxy component constructs a data structure according to the configuration data; the data structure includes a corresponding relationship between at least one implantation point object and at least one data reporting behavior; A receiving module, used for receiving the bytecode of each data reporting behavior; the bytecode is implanted by the proxy component according to the implantation point object corresponding to each data reporting behavior in the data structure; The reporting module is used to complete the corresponding data reporting operation based on the bytecode of each data reporting behavior.

9. An electronic device, characterized in that: The electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the method according to any one of claims 1 to 7 when executing the program.

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