Data processing method, data processing apparatus, electronic device, and storage medium
Patent Information
- Application Number
- CN202210214108.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-04
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2042-03-04
AI Technical Summary
[0003]在实现本公开构思的过程中,发明人发现相关技术中通常采用读取日志文件的方式来获取用户行为数据,这种方式至少存在采集到的数据冗余、不利于统计分析的技术问题
[0016]根据本公开的实施例,基于切面编程的思想,在目标系统运行捕获目标系统调用的目标方法,截获目标方法上的自定义注解,并在自定义注解与预设元注解匹配的情况下,从目标方法的目标参数中过滤得到目标数据。通过上述技术手段,可以在脱离日志文件的基础上采集用户行为数据,所以至少部分地解决了相关技术中存在的采集到的数据冗余、不利于统计分析的技术问题,有效提升了用户行为数据的采集效率,简化了采集流程,降低了学习成本。
Smart Images

Figure CN114579405B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data technology, and more specifically, to a data processing method, apparatus, electronic device, readable storage medium, and computer program product. Background Technology
[0002] With the development of information technology, the statistical analysis of user behavior data is playing an increasingly important role in assisting corporate decision-making.
[0003] In realizing the concept disclosed herein, the inventors discovered that related technologies typically use the method of reading log files to obtain user behavior data. This method has technical problems such as data redundancy and difficulty in statistical analysis. Summary of the Invention
[0004] In view of the above, this disclosure provides a data processing method, apparatus, electronic device, readable storage medium, and computer program product.
[0005] One aspect of this disclosure provides a data processing method, comprising: obtaining a target method called by a target system at runtime; parsing the target method to determine a custom annotation of the target method; determining target parameters of the target method if the custom annotation matches a preset meta-annotation; and filtering the target parameters of the target method according to preset configuration information to obtain target data.
[0006] According to embodiments of this disclosure, the custom annotation includes a meta-annotation portion and a target parameter definition portion, wherein the parameter definition portion includes multiple target parameter fields; the method further includes: determining whether the meta-annotation portion of the custom annotation of the target method matches the preset meta-annotation; wherein, determining the target parameter of the target method when the custom annotation of the target method matches the preset meta-annotation includes: obtaining the target parameter from multiple parameters of the target method based on the multiple target parameter fields in the parameter definition portion when the meta-annotation portion of the custom annotation of the target method matches the preset meta-annotation.
[0007] According to embodiments of this disclosure, the method further includes: releasing the target method when the meta-annotation portion in the custom annotation of the target method does not match the preset meta-annotation.
[0008] According to embodiments of this disclosure, the preset configuration information includes a preset data type; wherein, the filtering of the target parameters of the target method according to the preset configuration information to obtain target data includes: for each target parameter of the target method, matching the data type of the target parameter with the preset data type; and determining that the target data contains the target parameter when the data type of the target parameter matches the preset data type.
[0009] According to embodiments of this disclosure, the aforementioned preset meta-annotations include meta-annotations that declare the scope of use of the modified annotation to be at the method level, meta-annotations that declare the lifecycle of the modified annotation to include the runtime phase, and meta-annotations that declare the modified annotation to be extractable into the document by a document extraction tool.
[0010] According to embodiments of this disclosure, the preset configuration information includes a preset data consumption method; the method further includes: storing message data generated based on the target data into a message queue through a sub-thread of the target system; and consuming the message data in the message queue according to the preset data consumption method.
[0011] According to embodiments of this disclosure, consuming message data in the message queue according to the preset data consumption method includes: when the preset data consumption method is a first preset consumption mode, asynchronously storing the message data in the message queue to a preset storage medium so that the service user can asynchronously consume the message data; when the preset data consumption method is a second preset consumption mode, encrypting the message data in the message queue and storing the encrypted message data in the database of the hosting server so that the hosting party associated with the hosting server can asynchronously consume the message data.
[0012] Another aspect of this disclosure provides a data processing apparatus, including an acquisition module, a first processing module, a second processing module, and a filtering module. The acquisition module is used to acquire a target method called during the runtime of a target system; the first processing module is used to determine the target method and acquire custom annotations for the target method; the second processing module is used to determine the target parameters of the target method if the custom annotations match preset meta-annotations; and the filtering module is used to filter the target parameters of the target method according to preset configuration information to obtain target data.
[0013] Another aspect of this disclosure provides an electronic device, including: one or more processors; and a memory for storing one or more instructions, wherein when the one or more instructions are executed by the one or more processors, the one or more processors cause the one or more processors to perform the method as described above.
[0014] Another aspect of this disclosure provides a computer-readable storage medium storing computer-executable instructions that, when executed, are used to implement the method described above.
[0015] Another aspect of this disclosure provides a computer program product including computer-executable instructions that, when executed, are used to implement the method described above.
[0016] According to embodiments of this disclosure, based on the concept of aspect-oriented programming, the target system captures the target method called by the target system during its execution, intercepts custom annotations on the target method, and, when the custom annotations match preset meta-annotations, filters the target data from the target parameters of the target method. Through the above technical means, user behavior data can be collected without log files, thus at least partially solving the technical problems of data redundancy and difficulty in statistical analysis existing in related technologies. This effectively improves the efficiency of user behavior data collection, simplifies the collection process, and reduces the learning cost. Attached Figure Description
[0017] The above and other objects, features and advantages of this disclosure will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0018] Figure 1 This illustration shows a diagram of user behavior data collected using log collection and analysis tools.
[0019] Figure 2 An exemplary system architecture to which data processing methods can be applied according to embodiments of this disclosure is illustrated.
[0020] Figure 3 A flowchart illustrating a data processing method according to an embodiment of the present disclosure is shown schematically.
[0021] Figure 4 A schematic diagram of the target data processing flow according to an embodiment of the present disclosure is shown.
[0022] Figure 5 A flowchart illustrating a data processing method according to another embodiment of the present disclosure is shown.
[0023] Figure 6 A block diagram of a data processing apparatus according to an embodiment of the present disclosure is shown schematically.
[0024] Figure 7 A block diagram of an electronic device suitable for implementing a data processing method according to an embodiment of the present disclosure is shown schematically. Detailed Implementation
[0025] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.
[0026] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0027] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0028] When using expressions such as "at least one of A, B, and C," the expression should generally be interpreted in accordance with the meaning commonly understood by a person skilled in the art (e.g., "a system having at least one of A, B, and C" should include, but is not limited to, systems having A alone, having B alone, having C alone, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.). Similarly, when using expressions such as "at least one of A, B, or C," the expression should generally be interpreted in accordance with the meaning commonly understood by a person skilled in the art (e.g., "a system having at least one of A, B, or C" should include, but is not limited to, systems having A alone, having B alone, having C alone, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.).
[0029] In the technical solution disclosed herein, the acquisition, storage, and application of user personal information comply with the provisions of relevant laws and regulations, necessary confidentiality measures have been taken, and there is no violation of public order and good morals.
[0030] In related technologies, the collection of user behavior data can be divided into front-end collection and back-end collection. Back-end collection is generally achieved by directly or indirectly reading information from log files. Developers can access the server's log files via Linux command lines and use `tail -f + filename` to view the corresponding system information printed in real time after user actions, or use the `grep` pipe command to view historical log information for specific time periods or based on specific keywords. Collecting data from log files via command lines is inefficient, requires developers to have a certain level of command knowledge, and the process is relatively cumbersome.
[0031] Figure 1 This illustration shows a diagram of user behavior data collected using log collection and analysis tools.
[0032] like Figure 1 As shown, developers can also use the log collection and analysis tool ELK to collect user behavior data. ELK consists of Elasticsearch, Logstash, and Kibana. Elasticsearch is a distributed search and analysis engine that can be used for full-text search, structured search, and analysis; Logstash acts as a pipeline with real-time data transmission capabilities, transmitting data from the input to the output; and Kibana is an open-source analysis and visualization platform.
[0033] When a user accesses any of the applications, such as Application 1 or Application 2, the corresponding business logic is triggered. The imported log package writes the request parameters or the results returned by the business logic to the log file. Logstash can read the corresponding information from the log file, build the corresponding index information in Elasticsearch, and finally query and display the corresponding log information through the visualization tool Kibana.
[0034] However, using log collection and analysis tools requires a certain learning curve, and deploying such tools consumes significant server resources.
[0035] Furthermore, regardless of whether log collection and analysis tools are used, the method of collecting user operation traces by directly or indirectly reading the system configuration log files inevitably leads to the inclusion of other system-related redundant information in the collected data, such as system operation information and other auxiliary log information printed by developers. This data information can significantly impact and inconvenience developers when troubleshooting or analyzing user behavior data. Due to the large volume of data and the dispersion of core data, it is not conducive to quickly locating problems, nor is it conducive to performing database-like statistical analysis by reading data stored in file format, and thus failing to derive intuitive data for system optimization.
[0036] In view of this, embodiments of the present disclosure provide a method for collecting user behavior data to solve the problems of overly cumbersome data query and analysis, data redundancy, and difficulty in directly analyzing user behavior habits through log files in related technologies. It provides a visual operation page, simplifies the process and reduces learning costs, improves efficiency, and increases system reliability.
[0037] Specifically, embodiments of this disclosure provide a data processing method, a data processing apparatus, an electronic device, a readable storage medium, and a computer program product. The method includes obtaining a target method invoked during the runtime of a target system; parsing the target method to determine its custom annotations; determining target parameters of the target method if the custom annotations match preset meta-annotations; and filtering the target parameters of the target method according to preset configuration information to obtain target data.
[0038] Figure 2 An exemplary system architecture to which data processing methods can be applied according to embodiments of this disclosure is illustrated schematically. It should be noted that... Figure 2 The examples shown are merely examples of system architectures that can be applied to the embodiments of this disclosure, in order to help those skilled in the art understand the technical content of this disclosure, but do not mean that the embodiments of this disclosure cannot be used in other devices, systems, environments or scenarios.
[0039] like Figure 2 As shown, the system architecture 200 according to this embodiment may include terminal devices 201, 202, and 203, a network 204, and a server 205.
[0040] Terminal devices 201, 202, and 203 can be various electronic devices with displays and input devices, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0041] Various client applications can be installed on terminal devices 201, 202, and 203, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software.
[0042] Network 204 is a medium used to provide a communication link between terminal devices 201, 202, 203 and server 205. Network 204 may include various connection types, such as wired and / or wireless communication links.
[0043] Server 205 can be a server that provides various services and can provide computing resources to service users or hosts in the embodiments of this disclosure.
[0044] It should be noted that the data processing method provided in this embodiment can generally be executed by server 205. Correspondingly, the data processing device provided in this embodiment can generally be located in server 205. The data processing method provided in this embodiment can also be executed by a server or server cluster that is different from server 205 and capable of communicating with terminal devices 201, 202, 203 and / or server 205. Correspondingly, the data processing device provided in this embodiment can also be located in a server or server cluster that is different from server 205 and capable of communicating with terminal devices 201, 202, 203 and / or server 205. Alternatively, the data processing method provided in this embodiment can also be executed by terminal devices 201, 202, or 203, or by other terminal devices different from terminal devices 201, 202, or 203. Correspondingly, the data processing device provided in this embodiment can also be located in terminal devices 201, 202, or 203, or in other terminal devices different from terminal devices 201, 202, or 203.
[0045] For example, when a client application is running on any one of terminal devices 201, 202, or 203 (e.g., terminal device 201, but not limited thereto), terminal device 201 can execute the data processing method provided in the embodiments of this disclosure locally to capture user behavior data; or, the data processing method provided in the embodiments of this disclosure can be executed by other terminal devices, servers, or server clusters that are able to establish a communication connection with terminal device 201 through network 204 to capture user behavior data.
[0046] It should be understood that Figure 2 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0047] Figure 3A flowchart illustrating a data processing method according to an embodiment of the present disclosure is shown schematically.
[0048] like Figure 3 As shown, the method includes operations S301 to S304.
[0049] In operation S301, obtain the target method called by the target system at runtime.
[0050] In operation S302, the target method is parsed to determine the custom annotations of the target method.
[0051] In operation S303, when the custom annotation matches the preset meta-annotation, the target parameters of the target method are determined.
[0052] In operation S304, the target parameters of the target method are filtered according to the preset configuration information to obtain the target data.
[0053] According to embodiments of this disclosure, the target method can be captured using any testing tool, such as Ranorex Studio, LEAPWORK, etc.
[0054] According to embodiments of this disclosure, custom annotations for the target method can be obtained through reflection. Reflection refers to the ability, during program execution, to construct an object of any class, understand the class to which any object belongs, understand the member variables and methods of any class, and invoke the attributes and methods of any object. These custom annotations can be written by developers during the development phase of the target system, or they can be supplemented by developers to existing annotations in the target method before user behavior data collection; no limitation is imposed here.
[0055] According to embodiments of this disclosure, the source code and annotation portions of a method can be distributed in different files, and modifications to the annotations of the method can be made without any intrusion into the method itself.
[0056] According to embodiments of this disclosure, preset meta-annotations can be configured according to business requirements. For example, a preset meta-annotation can be set to be valid at runtime and have a scope of method. When a custom annotation of a target method matches the preset meta-annotation, the target method can be determined to have a pointcut based on aspect-oriented programming. The target parameters in the target method can be obtained at runtime through static or dynamic proxy. As another example, a preset meta-annotation can be set to have a scope of class, so that the custom annotations of a class consisting of multiple methods can match the preset meta-annotation.
[0057] According to embodiments of this disclosure, preset configuration information can be set according to business requirements. For example, the preset configuration information can be set to the data type of the target data to be any one or more of integer, floating-point, byte, and boolean types.
[0058] According to embodiments of this disclosure, based on the concept of aspect-oriented programming, the target system captures the target method called by the target system during its execution, intercepts custom annotations on the target method, and filters target data from the target parameters of the target method when the custom annotations match preset meta-annotations. Through the above technical means, user behavior data can be collected without log files, thus at least partially solving the technical problems of data redundancy and difficulty in statistical analysis existing in related technologies. This effectively improves the efficiency of user behavior data collection, simplifies the collection process, and reduces the learning cost.
[0059] The following is for reference. Figures 4-5 In conjunction with specific embodiments, Figure 3 The method shown will be further explained.
[0060] According to embodiments of this disclosure, custom annotations for a method may include a meta-annotation portion and a parameter definition portion.
[0061] For example, the target method contains a custom annotation named Anno, defined using the annotation definition statement `public@interface Anno{}`. The function body of the annotation definition statement is the parameter definition section of the custom annotation. The parameter definition section can define data types as integers, floating-point numbers, bytes, or booleans, such as `int a()`, `string b()`, etc. The annotation definition statement is preceded by the meta-annotation section, which includes `@Target`, `@Retention`, and `@Documented`. `@Target` declares where the annotated element can be used; for example, `@Target(ElementType.CLASS)` indicates that the annotation can be used on a class. Specifically, if `@Target` is not used in the annotation, it can be used anywhere. `@Retention` declares the stages at which the annotation can be retained, including the source code stage, the compilation stage, and the runtime stage; for example, `@Retention(RetentionPolicy.SOURCE)` indicates that the annotation is only retained in the source code stage. `@Documented` declares whether the annotated element can be extracted into the document by a document extraction tool.
[0062] According to embodiments of this disclosure, a custom annotation generally includes a parameter definition section. When a parameter definition section is included, the custom annotation can be used as a special class. The source code of a method may contain assignment statements for the custom annotation. When the method containing the custom annotation is called, the system can assign values to the parameters defined in the custom annotation.
[0063] According to embodiments of this disclosure, the structure of a preset meta-annotation can be the same as the structure of the meta-annotation portion of a custom annotation. The meta-annotations included in the preset meta-annotation can be configured according to specific business scenarios. For example, the scope of the annotation can be set to the method level to ensure that all acquired data originates from method parameters; the lifecycle of the annotation can also be set to include the runtime phase, allowing the annotation to be obtained through reflection; the annotation can also be configured to be extracted into a document by a document extraction tool, so that the parameters of the method containing the annotation can be extracted into a specified document during the runtime phase.
[0064] According to embodiments of this disclosure, after obtaining the target method, the match between the custom annotation and the preset meta-annotation can be determined by checking whether the custom annotation matches the meta-annotation portion of the target method. Taking the preset meta-annotation in the above example as an example, the parameter definition portion may include multiple target parameter fields. If the meta-annotation portion of the custom annotation matches the preset meta-annotation, the name of the target parameter can be determined from the multiple target parameter fields in the parameter definition portion of the custom annotation. Thus, after the parameters of the target method are extracted into the document, the required target parameter can be determined from the multiple parameters in the document. Conversely, if the meta-annotation portion of the custom annotation does not match the preset meta-annotation, for example, if @Documented is not declared in the meta-annotation portion, the parameters of the target method cannot be extracted into the document. In this case, the processing of the target method can be terminated, and the target method can be released.
[0065] According to embodiments of this disclosure, target parameters obtained from the target method can be filtered based on preset configuration information.
[0066] For example, the preset configuration information can configure the data type of the target data, i.e., the preset data type. The specific preset data type can be any combination of one or more of integer, floating-point, byte, and boolean types. For each target parameter of the target method, the data type of the target parameter can be matched with the preset data type. If the data type of the target parameter matches the preset data type, it can be determined that the target data contains that target parameter.
[0067] For example, the preset configuration information can specify the required target data length, i.e., the preset data length. Specifically, the preset data length can be less than 4 bits. For each target parameter of the target method, the data length of the target parameter can be obtained. If the data length of the target parameter is less than the preset data length, it can be determined that the target data contains that target parameter. Configuring the data length can filter out erroneous data caused by bit errors, out-of-range errors, etc.
[0068] Figure 4 A schematic diagram of the target data processing flow according to an embodiment of the present disclosure is shown.
[0069] like Figure 4 As shown, the preset configuration information can also configure the preset consumption method of the acquired target data. According to different preset consumption methods, the target data can be stored in different storage media so that different consumers can consume it in different ways.
[0070] According to the embodiments of this disclosure, the acquired target data can be packaged into a message data 401. The message data 401 can be passed into the message queue 404 through the sub-thread 403 in the thread pool 402, and the message data 401 in the message queue 404 can be consumed according to different preset consumption methods configured in the preset configuration message.
[0071] According to embodiments of this disclosure, when the preset data consumption mode is the first preset consumption mode, the system can sequentially consume message data 401 in message queue 404 to store the message data 401 in a preset storage medium 405 specified by the service user; the preset storage medium 405 can be any type of database or any type of storage device. Afterwards, the service user can subscribe to messages and asynchronously consume message data 401 in the preset storage medium 405. This method achieves physical isolation of the target data.
[0072] According to embodiments of this disclosure, when the preset data consumption mode is the first preset consumption mode, the system can sequentially consume message data 401 in message queue 404 to store message data 401 in the managed database 406 of the managed server. The managed database 406 can be any type of database, such as Elasticsearch or MySQL. Through this method, the service user can grant the consumption permission of message data 401 to the hosting provider associated with the managed database 406, allowing the hosting provider to asynchronously consume message data 401.
[0073] According to embodiments of this disclosure, before storing message data 401 in the database of the hosting server, message data 401 can be authenticated to determine whether it is sensitive data. Furthermore, if message data 401 is determined to be sensitive data, it can be encrypted, and the encrypted message data can be stored in the hosting database 406.
[0074] According to embodiments of this disclosure, data encryption methods can include various encryption techniques such as symmetric encryption and asymmetric encryption. For example, message data 401 can be symmetrically encrypted based on a private key, and the hosting provider can manage the private key. When a service user needs to consume message data 401, they can retrieve the encrypted message data from the hosting server's database 406 and obtain the private key from the hosting provider to decrypt the encrypted message data for asynchronous consumption. This method achieves logical isolation of message data and ensures data security.
[0075] Figure 5 A flowchart illustrating a data processing method according to another embodiment of the present disclosure is shown.
[0076] like Figure 5 As shown, the method includes operations S501 to S511.
[0077] It should be noted that, unless it is explicitly stated that there is a sequential order of execution between different operations, or that there is a sequential order of execution between different operations in terms of technical implementation, the execution order between multiple operations may not be significant, and multiple operations may be executed simultaneously.
[0078] In operation S501, capture the target method.
[0079] In operation S502, it is determined whether the custom annotation of the target method matches the preset meta-annotation. If it is determined that the custom annotation of the target method does not match the preset meta-annotation, operation S503 is executed; if the custom annotation of the target method matches the preset meta-annotation, operation S504 is executed.
[0080] In operation S503, release the target method.
[0081] In operation S504, the target parameters of the target method are parsed to obtain the target data.
[0082] When operating the S505, a sub-thread stores the message data generated based on the target data into the message queue.
[0083] In operation S506, determine the preset data consumption mode. If the preset data consumption mode is determined to be the first preset consumption mode, execute operation S507; if the preset data consumption mode is determined to be the second preset consumption mode, execute operation S508.
[0084] In operation S507, message data in the message queue is consumed to store the target data into a preset storage medium.
[0085] When operating the S508, consume message data from the message queue to obtain the target data.
[0086] In operation S509, determine whether the target data is sensitive data. If the target data is determined to be sensitive data, execute operation S510; if the target data is determined to be non-sensitive data, execute operation S511.
[0087] In operation S510, the target data is encrypted. After completing operation S510, operation S511 is executed.
[0088] When operating S511, the target data is stored in the managed database.
[0089] According to embodiments of this disclosure, users can choose the meta-annotation service provided in these embodiments to entrust the collected data to a hosting provider for management. In this way, the data collector can collect and analyze user behavior data without any code development, achieving zero-code, zero-intrusion behavior data collection. On the other hand, users can also customize the data output interface, autonomously consume the acquired user behavior data, and store it in a relational database, non-relational database, or storage device for subsequent statistical analysis, error troubleshooting, and other tasks. This method effectively simplifies the workflow of behavior data collection, frees up developers' time spent focusing on system logs, and allows for rapid problem location when issues arise, thus improving work efficiency.
[0090] Figure 6 A block diagram of a data processing apparatus according to an embodiment of the present disclosure is shown schematically.
[0091] like Figure 6 As shown, the data processing device 600 includes an acquisition module 610, a first processing module 620, a second processing module 630, and a filtering module 640.
[0092] The acquisition module 610 is used to acquire the target method called by the target system at runtime.
[0093] The first processing module 620 is used to parse the target method to determine the custom annotations of the target method.
[0094] The second processing module 630 is used to determine the target parameters of the target method when the custom annotation matches the preset meta-annotation.
[0095] The filtering module 640 is used to filter the target parameters of the target method according to the preset configuration information to obtain the target data.
[0096] According to embodiments of this disclosure, based on the concept of aspect-oriented programming, the target system captures the target method called by the target system during its execution, intercepts custom annotations on the target method, and filters target data from the target parameters of the target method when the custom annotations match preset meta-annotations. Through the above technical means, user behavior data can be collected without log files, thus at least partially solving the technical problems of data redundancy and difficulty in statistical analysis existing in related technologies. This effectively improves the efficiency of user behavior data collection, simplifies the collection process, and reduces the learning cost.
[0097] According to embodiments of this disclosure, a custom annotation includes a meta-annotation portion and a parameter definition portion, wherein the parameter definition portion includes multiple target parameter fields.
[0098] According to embodiments of this disclosure, the device further includes a determining module.
[0099] The determination module is used to determine whether the meta-annotation part in the custom annotation of the target method matches the preset meta-annotation.
[0100] According to an embodiment of this disclosure, the second processing module 630 is further configured to determine the target parameter of the target method from multiple parameters of the target method based on the names of multiple target parameter fields in the parameter definition section when the meta-annotation part in the custom annotation of the target method matches a preset meta-annotation.
[0101] According to an embodiment of this disclosure, the second processing module 630 is further configured to release the target method if the meta-annotation portion in the custom annotation of the target method does not match the preset meta-annotation.
[0102] According to embodiments of this disclosure, the preset configuration information includes preset data types.
[0103] According to embodiments of the present disclosure, the filtering module 640 includes a first filtering unit and a second filtering unit.
[0104] The first filtering unit is used to match the data type of each target parameter of the target method with a preset data type.
[0105] The second filtering unit is used to determine whether the target data contains the target parameter if the data type of the target parameter matches the preset data type.
[0106] According to embodiments of this disclosure, the preset meta-annotations include meta-annotations that declare the scope of use of the modified annotations to be at the method level, meta-annotations that declare the lifecycle of the modified annotations to include the runtime phase, and meta-annotations that declare the modified annotations to be extracted into the document by a document extraction tool.
[0107] According to embodiments of this disclosure, the preset configuration information includes a preset data consumption method.
[0108] According to embodiments of this disclosure, the device further includes a third processing module and a consumption module.
[0109] The third processing module is used to store message data generated based on target data into a message queue through a sub-thread of the target system.
[0110] The consumption module is used to consume message data in the message queue according to the preset data consumption method.
[0111] According to embodiments of this disclosure, the consumption module includes a first consumption unit and a second consumption unit.
[0112] The first consumption unit is used to asynchronously store message data in the message queue to a preset storage medium when the preset data consumption mode is the first preset consumption mode, so that the service user can asynchronously consume the message data.
[0113] The second consumption unit is used to encrypt message data in the message queue and store the encrypted message data in the database of the hosting server when the preset data consumption mode is the second preset consumption mode, so that the hosting party associated with the hosting server can asynchronously consume the message data.
[0114] Any one or more of the modules, submodules, units, and subunits according to embodiments of the present disclosure, or at least part of the functions of any one or more of them, can be implemented in one module. Any one or more of the modules, submodules, units, and subunits according to embodiments of the present disclosure can be implemented by dividing them into multiple modules. Any one or more of the modules, submodules, units, and subunits according to embodiments of the present disclosure can be at least partially implemented as hardware circuitry, such as Field Programmable Gate Arrays (FPGAs), Programmable Logic Arrays (PLAs), Systems-on-Chip, Systems-on-Substrate, Systems-on-Package, Application-Specific Integrated Circuits (ASICs), or implemented in hardware or firmware by any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, one or more of the modules, submodules, units, and subunits according to embodiments of the present disclosure can be at least partially implemented as computer program modules, which, when run, can perform corresponding functions.
[0115] For example, any plurality of the acquisition module 610, the first processing module 620, the second processing module 630, and the filtering module 640 can be combined into one module / unit / subunit, or any one of these modules / units / subunits can be split into multiple modules / units / subunits. Alternatively, at least part of the functionality of one or more of these modules / units / subunits can be combined with at least part of the functionality of other modules / units / subunits and implemented in one module / unit / subunit. According to embodiments of the present disclosure, at least one of the acquisition module 610, the first processing module 620, the second processing module 630, and the filtering module 640 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging the circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, at least one of the acquisition module 610, the first processing module 620, the second processing module 630, and the filtering module 640 may be implemented at least partially as a computer program module, which can perform corresponding functions when the computer program module is run.
[0116] It should be noted that the data processing device part in the embodiments of this disclosure corresponds to the data processing method part in the embodiments of this disclosure. The specific description of the data processing device part is referred to in the data processing method part, and will not be repeated here.
[0117] Figure 7A block diagram of an electronic device suitable for implementing a data processing method according to an embodiment of the present disclosure is shown schematically. Figure 7 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0118] like Figure 7 As shown, a computer electronic device 700 according to an embodiment of the present disclosure includes a processor 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage portion 708 into a random access memory (RAM) 703. The processor 701 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 701 may also include onboard memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0119] RAM 703 stores various programs and data required for the operation of electronic device 700. Processor 701, ROM 702, and RAM 703 are interconnected via bus 704. Processor 701 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 702 and / or RAM 703. It should be noted that the programs may also be stored in one or more memories other than ROM 702 and RAM 703. Processor 701 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.
[0120] According to embodiments of this disclosure, the electronic device 700 may further include an input / output (I / O) interface 705, which is also connected to a bus 704. The electronic device 700 may also include one or more of the following components connected to the I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.
[0121] According to embodiments of this disclosure, the method flow according to embodiments of this disclosure can be implemented as a computer software program. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable storage medium, the computer program containing program code for performing the methods shown in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711. When the computer program is executed by processor 701, it performs the functions defined in the system of embodiments of this disclosure. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0122] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.
[0123] According to embodiments of this disclosure, the computer-readable storage medium can be a non-volatile computer-readable storage medium. Examples include, but are not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0124] For example, according to embodiments of this disclosure, a computer-readable storage medium may include one or more memories other than the ROM 702 and / or RAM 703 described above.
[0125] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods provided in the embodiments of this disclosure. When the computer program product is run on an electronic device, the program code is used to enable the electronic device to implement the data processing methods provided in the embodiments of this disclosure.
[0126] When the computer program is executed by the processor 701, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0127] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 709, and / or installed from a removable medium 711. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0128] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0129] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions. Those skilled in the art will understand that the features recited in the various embodiments and / or claims of this disclosure can be combined and / or combined in various ways, even if such combinations or combinations are not expressly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure may be combined and / or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.
[0130] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.
Claims
1. A data processing method, comprising: Obtain the target method called during the runtime of the target system; The target method is parsed using reflection to determine its custom annotations. The custom annotations and source code of the target method are distributed in different files so that modifications to the custom annotations of the target method are non-intrusive to the target method. The custom annotations include a meta-annotation part and a parameter definition part, and the parameter definition part includes multiple target parameter fields. Determine whether the meta-annotation portion in the custom annotation of the target method matches the preset meta-annotation; If the meta-annotation portion of the custom annotation in the target method matches a preset meta-annotation, the target parameter is obtained from multiple parameters of the target method based on multiple target parameter fields in the parameter definition portion; and The target parameters of the target method are filtered according to the preset configuration information to obtain the target data.
2. The method according to claim 1, further comprising: If the meta-annotation portion of the custom annotation in the target method does not match the preset meta-annotation, the target method is released.
3. The method according to claim 1, wherein, The preset configuration information includes preset data types; The step of filtering the target parameters of the target method according to preset configuration information to obtain target data includes: For each target parameter of the target method, the data type of the target parameter is matched with the preset data type; and If the data type of the target parameter matches the preset data type, it is determined that the target data contains the target parameter.
4. The method according to claim 1, wherein, The preset meta-annotations include meta-annotations that declare the scope of use of the modified annotations as method-level, meta-annotations that declare the lifecycle of the modified annotations as runtime-level, and meta-annotations that declare the modified annotations as being extractable into the document by document extraction tools.
5. The method according to claim 1, wherein, The preset configuration information includes a preset data consumption method; The method further includes: The message data generated based on the target data is stored in a message queue through a sub-thread of the target system; and The message data in the message queue is consumed according to the preset data consumption method.
6. The method according to claim 5, in, The step of consuming message data in the message queue according to the preset data consumption method includes: When the preset data consumption method is the first preset consumption mode, the message data in the message queue is asynchronously stored in the preset storage medium so that the service user can consume the message data asynchronously; When the preset data consumption mode is the second preset consumption mode, the message data in the message queue is encrypted and the encrypted message data is stored in the database of the hosting server so that the hosting party associated with the hosting server can consume the message data asynchronously.
7. A data processing apparatus, comprising: The acquisition module is used to obtain the target methods called during the runtime of the target system. The first processing module is used to parse the target method through reflection to determine the custom annotations of the target method. The custom annotations and source code of the target method are distributed in different files so that modifications to the custom annotations of the target method are non-intrusive to the target method. The custom annotations include a meta-annotation part and a parameter definition part. The parameter definition part includes multiple target parameter fields. The second processing module is used to determine whether the meta-annotation portion of the custom annotation in the target method matches a preset meta-annotation; if the meta-annotation portion of the custom annotation in the target method matches the preset meta-annotation, it retrieves the target parameter from multiple parameters of the target method based on multiple target parameter fields in the parameter definition portion; and The filtering module is used to filter the target parameters of the target method according to preset configuration information to obtain target data.
8. An electronic device, comprising: One or more processors; Memory, used to store one or more instructions. When the one or more instructions are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method of any one of claims 1 to 6.
9. A computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the method of any one of claims 1 to 6.
10. A computer program product comprising computer-executable instructions, which, when executed, are used to implement the method of any one of claims 1 to 6.
Citation Information
Patent Citations
Buried point reporting method and device, medium and electronic device
CN110489180A
System data acquisition method and device, computer equipment and storage medium
CN113094236A