Method, device, apparatus and computer readable medium for monitoring data
Through tangent-oriented programming, configuring business logic in the application, collecting and encrypting http request operation data, the problem of high intrusion in logging in the existing technology is solved, and log monitoring without code modification is realized, and system stability is improved.
Patent Information
- Application Number
- CN202411905656.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-08
AI Technical Summary
In the prior art, the logging method requires a large number of modifications to the application's code, resulting in high intrusion and poor system stability.
Through Aspect-Oriented Programming (AOP), business logic is configured within the tangential programming of the tangential programming, monitoring objects are determined, and http request operation data is collected, encrypted and added to the properties of the http request, and then service monitoring data is decrypted in the filtering layer to build monitoring log records.
It realizes log monitoring without modifying the original code, avoids high intrusion of logging and improves system stability.
Smart Images

Figure CN119782089A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of big data technology, and in particular to a method, device, equipment and computer-readable medium for monitoring data. Background Art
[0002] With the rapid development of information technology, software systems are increasingly used in various industries, and log monitoring, as one of the important means to ensure the stable and efficient operation of software systems, has received widespread attention. In the software development process, log records can not only quickly locate problems and optimize performance, but also provide real-time system status information to support troubleshooting and system maintenance.
[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art: the logging method often requires a lot of modifications to the application code, resulting in high intrusiveness of logging and poor system stability. Summary of the invention
[0004] In view of this, embodiments of the present invention provide a method, apparatus, device, and computer-readable medium for monitoring data, which can avoid the high intrusiveness of log records and improve system stability.
[0005] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for monitoring data is provided, comprising:
[0006] The filter initiates a monitoring data request, and in response to the monitoring data request, configures business logic within the aspect of aspect-oriented programming to determine the monitoring object. When the method in the monitoring object is called, the aspect collects the http request operation data of the monitoring object.
[0007] The http request operation data collected by the section is encrypted by the business logic and added to the attributes of the http request, so that the http request operation data is obtained from the attributes of the http request;
[0008] After the http request reaches the filtering layer, the filtering layer uses the business logic to decrypt the http request operation data from the attributes of the http request according to business requirements to obtain business monitoring data, and constructs a monitoring log record based on the business monitoring data and the monitoring data format.
[0009] The filter initiates a monitoring data request, configures business logic within the aspect-oriented programming aspect in response to the monitoring data request to determine a monitoring object, a method in the monitoring object is called, and the aspect collects http request operation data of the monitoring object, including:
[0010] The filter initiates a monitoring data request, and constructs the aspect-oriented programming aspect between the control layer and the outbound client service code in response to the monitoring data request;
[0011] Within the aspect of aspect-oriented programming, business logic is configured based on the monitoring parameters of the monitoring data request to determine the monitoring object, and the method in the monitoring object is obtained through annotation configuration. The method in the monitoring object is called, and the aspect collects the http request operation data of the monitoring object.
[0012] The filter initiates a monitoring data request, and in response to the monitoring data request, constructs the aspect-oriented programming aspect between the control layer and the outbound client service code, including:
[0013] The filter initiates a monitoring data request, constructs the aspect-oriented programming aspect between the control layer and the outbound client service code in response to the monitoring data request, and configures a cut point in the aspect-oriented programming aspect;
[0014] The configuring of business logic based on the monitoring parameters of the monitoring data request within the aspect-oriented programming to determine the monitoring object includes:
[0015] At the pointcut in the aspect of the aspect-oriented programming, business logic is configured based on monitoring parameters of the monitoring data request to determine a monitoring object.
[0016] The step of encrypting the http request operation data collected by the section by using the business logic and adding the data to the attributes of the http request so that the filter obtains the http request operation data from the attributes of the http request includes:
[0017] Obtaining the object of the http request in the surround notification of the slice, encrypting the http request operation data collected by the slice by using the business logic through the object of the http request, and then adding it to the attributes of the http request;
[0018] So that the filter obtains the http request operation data from the attributes of the http request through the object of the http request.
[0019] After the http request reaches the filtering layer, the filtering layer uses the business logic to decrypt the http request operation data from the attributes of the http request according to business requirements to obtain business monitoring data, and constructs a monitoring log record based on the business monitoring data and the monitoring data format, including:
[0020] After the http request reaches the filtering layer, the filter of the filtering layer intercepts the http request, and the http request includes method processing results, method processing information and business information;
[0021] In the filtering layer, according to business requirements, the business logic is used to decrypt the http request operation data from the attributes of the http request to obtain business monitoring data, and a monitoring log record is constructed based on the business monitoring data and the monitoring data format. The business monitoring data includes method processing results, method processing information and business information.
[0022] The method processing information includes key function entry and key function exit; the method processing result includes: error location and exception processing location;
[0023] The constructing of monitoring log records based on the business monitoring data and the monitoring data format includes:
[0024] Establishing result data of the monitoring log record based on the processing result of the method and the result format in the monitoring data format;
[0025] According to the key function entry, the key function exit, the error location and the exception handling location, and according to the path data format in the monitoring data format, the tracking path data in the monitoring log record is constructed.
[0026] The http request operation data of the monitored object includes: http request start time point, http request parameters, http request header and http request end time point;
[0027] The step of decrypting the http request operation data from the attributes of the http request using the business logic to obtain the business monitoring data for the http request in the filtering layer according to the business requirements includes:
[0028] In the filtering layer, searching the http request operation data in the attributes of the http request according to the business requirements for the http request, and decrypting the http request operation data using the business logic;
[0029] The searched and decrypted http request start time point, http request parameters, http request header and http request end time point are used as the business monitoring data.
[0030] According to a second aspect of an embodiment of the present invention, there is provided a device for monitoring data, including:
[0031] A monitoring module is used for initiating a monitoring data request by a filter, and in response to the monitoring data request, configuring business logic inside a facet of facet-oriented programming to determine a monitoring object. When a method in the monitoring object is called, the facet collects http request operation data of the monitoring object.
[0032] An adding module, used for encrypting the http request operation data collected by the section by using the business logic and adding it to the attributes of the http request, so that the http request operation data can be obtained from the attributes of the http request;
[0033] The log module is used for decrypting the http request operation data from the attributes of the http request according to business needs in the filtering layer after the http request reaches the filtering layer, and obtaining business monitoring data, and constructing a monitoring log record based on the business monitoring data and the monitoring data format.
[0034] According to a third aspect of an embodiment of the present invention, there is provided an electronic device for monitoring data, comprising:
[0035] one or more processors;
[0036] a storage device for storing one or more programs,
[0037] When the one or more programs are executed by the one or more processors, the one or more processors implement the above method.
[0038] According to a fourth aspect of an embodiment of the present invention, there is provided a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the method as described above is implemented.
[0039] According to a fifth aspect of an embodiment of the present invention, a computer program product is provided, including a computer program, and when the program is executed by a processor, the method as described above provided by an embodiment of the present invention is implemented.
[0040] One embodiment of the above invention has the following advantages or beneficial effects: the filter initiates a monitoring data request, and in response to the monitoring data request, the business logic is configured inside the aspect of aspect-oriented programming to determine the monitoring object, and the method in the monitoring object is called, then the aspect collects the http request operation data of the monitoring object; the http request operation data collected by the aspect is encrypted by the business logic and added to the attributes of the http request, so that the http request operation data is obtained from the attributes of the http request; after the http request reaches the filtering layer, the business logic is used to decrypt the http request operation data from the attributes of the http request according to business requirements in the filtering layer to obtain business monitoring data, and a monitoring log record is constructed based on the business monitoring data and the monitoring data format. The monitoring log does not need to modify the original code, which can avoid the high intrusiveness of the log record and improve the system stability.
[0041] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0043] Figure 1 is a schematic diagram of the main flow of a method for monitoring data according to an embodiment of the present invention;
[0044] Figure 2 It is a schematic diagram of a process for collecting http request operation data of a monitoring object according to an embodiment of the present invention;
[0045] Figure 3 It is a schematic diagram of a process for collecting http request operation data of a monitoring object according to a configuration cut-off point according to an embodiment of the present invention;
[0046] Figure 4 is a flow chart of adding http request operation data to the attributes of an http request according to an embodiment of the present invention;
[0047] Figure 5 It is a schematic diagram of the process of obtaining business monitoring data and constructing monitoring log records according to an embodiment of the present invention;
[0048] Figure 6 It is a schematic diagram of a process of constructing a monitoring log record based on business monitoring data and monitoring data format according to an embodiment of the present invention;
[0049] Figure 7 It is a schematic diagram of a process of constructing monitoring log records based on http requests according to an embodiment of the present invention;
[0050] Figure 8 is a schematic diagram of the main structure of a device for monitoring data according to an embodiment of the present invention;
[0051] Fig. 9 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0052] Fig.10 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0053] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description. The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0054] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0055] In the current complex and ever-changing network environment, real-time monitoring and recording of application logs has become an important means to ensure system stability and security. However, traditional logging methods often require modification of application code, which not only increases development costs but may also lead to system instability.
[0056] In current software development and operation and maintenance practices, although there are a variety of technologies for interface monitoring and logging, there are still some significant shortcomings in the implementation process.
[0057] Highly intrusive: Logging directly in business logic will cause the code to be tightly coupled with logging, which is not conducive to code maintenance and expansion.
[0058] Complex configuration: The configuration of the logging framework is usually complex.
[0059] Poor flexibility: For different monitoring tools or log format requirements, a large amount of logging code may need to be reconfigured and developed.
[0060] In summary, the logging method often requires a lot of modifications to the application code, which makes the logging highly invasive and leads to poor system stability.
[0061] In order to solve the problem of poor system stability, the following technical solution in the embodiment of the present invention can be adopted.
[0062] See also Figure 1 , Figure 1 The main flow chart of the method for monitoring data according to an embodiment of the present invention is to configure the business logic through the aspect to determine the monitoring object, so as to send the operation data to the filtering layer through the http request and then construct the monitoring log record. Figure 1 As shown in 100, the following steps are specifically included:
[0063] S101. The filter initiates a monitoring data request. In response to the monitoring data request, the business logic is configured inside the aspect of aspect-oriented programming to determine the monitoring object. When the method in the monitoring object is called, the aspect collects the http request operation data of the monitoring object.
[0064] In the embodiment of the present invention, the monitoring of the monitoring object is implemented through aspect-oriented programming (AOP).
[0065] The filter initiates a monitoring data request to AOP, and in response to the monitoring data request, configures business logic within the aspect of aspect-oriented programming to determine the monitoring object.
[0066] In the embodiment of the present invention, in the banking system, business logic refers to the process of processing banking operations. Business logic ensures the correctness, compliance and security of banking services. As an example, business logic includes deposit logic, withdrawal logic and transfer logic.
[0067] The monitoring object is the target for which the monitoring log needs to be established. As an example, the monitoring object includes methods. The monitoring object is determined based on the business logic. As an example, the monitoring object of the storage logic includes methods related to deposit accounts. The monitoring objects of the transfer logic include: methods related to transfer-out accounts and methods related to transfer-in accounts. After the method in the monitoring object is called, the aspect in AOP can be used to collect the http request operation data of the monitoring object.
[0068] See also Figure 2 That is 200, Figure 2 This is a flow chart of collecting http request operation data of a monitoring object according to an embodiment of the present invention. Specifically, it includes the following steps:
[0069] S201. The filter initiates a monitoring data request, and in response to the monitoring data request, constructs an aspect-oriented programming aspect between the control layer and the outbound client service code.
[0070] If the filter initiates a monitoring data request, it means that an AOP aspect needs to be established to implement monitoring of the monitored object.
[0071] The filter initiates a monitoring data request, and in response to the monitoring data request, constructs an AOP aspect between the control layer and the outbound client service code. The constructed AOP aspect realizes the recording of non-intrusive operation data for the monitoring object.
[0072] S202. Within the aspect of aspect-oriented programming, configure business logic based on monitoring parameters of monitoring data requests to determine the monitoring object, and obtain methods in the monitoring object through annotation configuration. The methods in the monitoring object are called, and the aspect collects http request operation data of the monitoring object.
[0073] In the AOP aspect, you can configure business logic based on the monitoring parameters of the monitoring data request to determine the monitoring object, and obtain the methods in the monitoring object through annotation configuration. As an example, the @Around annotation is used to specify the methods and / or package paths that need to be monitored.
[0074] When the method and / or package path in the monitored object is called, the aspect automatically collects the http request operation data of the monitored object.
[0075] In one embodiment of the present invention, the http request operation data of the monitored object includes: http request start time point, http request parameters, http request header and http request end time point. The http request operation data can play an important role in performance monitoring, troubleshooting and log auditing.
[0076] exist Figure 2 In the embodiment, the http request operation data of the monitored object is obtained by building an AOP aspect to realize monitoring data.
[0077] See also Figure 3 That is 300, Figure 3 This is a flow chart of configuring a cut-off point to collect http request operation data of a monitoring object according to an embodiment of the present invention. Specifically, it includes the following steps:
[0078] S301. The filter initiates a monitoring data request, builds an aspect-oriented programming between the control layer and the outbound client service code in response to the monitoring data request, and configures a cut point in the aspect-oriented programming aspect.
[0079] The filter initiates a monitoring data request, and in response to the monitoring data request, an AOP aspect is constructed between the control layer and the outbound client business code. The pointcut can be configured in the aspect. As an example, the pointcut is set by configuring the specified annotation RequestMapping. Specifically, the RequestMapping annotation under the com.fin.rest package is set as the pointcut for the http request.
[0080] S302: At a pointcut in an aspect of aspect-oriented programming, configure business logic based on monitoring parameters of a monitoring data request to determine a monitoring object.
[0081] After the cut point is determined, you can configure the business logic in the cut point inside the AOP aspect based on the monitoring parameters of the monitoring data request to determine the monitoring object.
[0082] exist Figure 3 In the embodiment, the business logic is configured through the cut-point to determine the monitoring object. Since there is no need to modify the original business logic code, it is only necessary to implement monitoring at the cut-point to ensure the integrity of the original business logic code.
[0083] S102: encrypt the http request operation data collected by the slice using business logic and add it to the attributes of the http request, so that the http request operation data is obtained from the attributes of the http request.
[0084] In an embodiment of the present invention, in order to facilitate the acquisition of http request operation data, the http request operation data collected by the section can be encrypted by business logic and added to the attributes of the http request. In this way, when the http request is acquired, the http request operation data can be directly acquired from the attributes of the http request.
[0085] In an embodiment of the present invention, the http request operation data added to the attributes of the http request needs to be encrypted using the business logic. As an example, the http request operation data is encrypted using corresponding encryption algorithms for different business logics. That is, different business logics use different encryption algorithms. For example, the encryption algorithm of the deposit logic includes the Advanced Encryption Standard (AES); the encryption algorithm of the withdrawal logic includes the Data Encryption Standard (DES); the encryption algorithm of the transfer logic includes SM4.
[0086] See also Figure 4 That is 400, Figure 4 The present invention is a flowchart of adding http request operation data to the attributes of an http request according to an embodiment of the present invention. Specifically, the following steps are included:
[0087] S401. Obtain an http request object in the surround notification of the slice, encrypt the http request operation data collected by the slice using business logic through the http request object, and add it to the attributes of the http request.
[0088] In an embodiment of the present invention, the http request operation data needs to be sent to a filter for further processing.
[0089] In the aspect surround advice, get the RequestAttributes object of the current http request through RequestContextHolder.getRequestAttributes(), and then get the HttpServletRequest object.
[0090] Through the setAttribute(String name, Object value) method of the HttpServletRequest object, the http request operation data collected by the aspect is encrypted using business logic and added to the attributes of the http request.
[0091] S402: The filter obtains the http request operation data from the attributes of the http request through the object of the http request.
[0092] In an embodiment of the present invention, when an http request reaches the filtering layer, the filter obtains the http request operation data from the attributes of the http request through the object of the http request. As an example, the http request operation data is obtained from the attributes of the http request by using the getAttribute(String name) method of the HttpServletRequest object.
[0093] exist Figure 4 In the embodiment, the http request operation data can be passed to the filter through the http request to ensure the integrity and consistency of the http request operation data.
[0094] S103, after the http request reaches the filtering layer, the filtering layer uses business logic to decrypt the http request operation data from the attributes of the http request according to business requirements to obtain business monitoring data, and constructs a monitoring log record based on the business monitoring data and the monitoring data format.
[0095] In an embodiment of the present invention, after the http request reaches the filtering layer, the http request can be obtained in the filtering layer. According to the business requirements, the http request operation data is decrypted from the attributes of the http request using business logic to obtain business monitoring data. Based on the business monitoring data, a monitoring log record is constructed according to the monitoring data format.
[0096] In the embodiment of the present invention, the algorithm corresponding to the business logic is used to decrypt the http request operation data to obtain the business monitoring data. The security of the http request operation data is ensured by the business logic to meet the security requirements of the banking business.
[0097] See also Figure 5 That is 500, Figure 5 This is a flow chart of obtaining business monitoring data and constructing monitoring log records according to an embodiment of the present invention. Specifically, it includes the following steps:
[0098] S501. After an http request reaches a filtering layer, a filter at the filtering layer intercepts the http request. The http request includes a method processing result, method processing information, and business information.
[0099] After the http request reaches the filtering layer, the http request is intercepted by the filter of the filtering layer. The http request includes method processing results, method processing information and business information. As an example, the business information includes business identification information.
[0100] S502. In the filtering layer, according to business requirements, the business logic is used to decrypt the http request operation data from the attributes of the http request to obtain business monitoring data, and a monitoring log record is constructed based on the business monitoring data and the monitoring data format. The business monitoring data includes method processing results, method processing information and business information.
[0101] In the filtering layer, according to the business requirements, the business logic is used to decrypt the http request operation data from the attributes of the http request to obtain the business monitoring data. As an example, the business requirements include monitoring business parameters.
[0102] After obtaining the business monitoring data, you can build a monitoring log record based on the business monitoring data and the monitoring data format. The business monitoring data includes method processing results, method processing information, and business information.
[0103] exist Figure 5 In the embodiment, the business monitoring data is obtained through http request, and the business monitoring data can fully reflect the processing status of the method in the monitoring object, and then construct the monitoring log record.
[0104] See also Figure 6That is 600, Figure 6 This is a flow chart of constructing monitoring log records based on business monitoring data and monitoring data format according to an embodiment of the present invention. Specifically, it includes the following steps:
[0105] S601. Create result data of monitoring log records based on the method processing result and the result format in the monitoring data format.
[0106] In one embodiment of the present invention, the method processing result includes: an error location and an exception processing location. Based on the error location and the exception processing location in the method processing result, the result data of the monitoring log record can be established in accordance with the result format in the monitoring data format. As an example, based on the error location and the exception processing location, the result data of the monitoring log record is established in accordance with the result format in the monitoring data format, and the error location and the exception processing location are identified in the result data of the monitoring log record.
[0107] S602. Construct the tracking path data in the monitoring log record according to the key function entry, key function exit, error location and exception handling location and the path data format in the monitoring data format.
[0108] In one embodiment of the present invention, the method processing information includes a key function entry and a key function exit.
[0109] In order to meet the format requirements of log monitoring, the path data format in the monitoring data format can be preset. Then, according to the key function entry, key function exit, error location and exception handling location, the tracking path data in the monitoring log record is constructed according to the path data format in the monitoring data format.
[0110] exist Figure 6 In the embodiment, the monitoring log record can be constructed by the filtering layer without modifying the business code, thereby achieving non-intrusiveness to the business code.
[0111] In one embodiment of the present invention, Figure 1 The steps in the above are applied to Spring Boot. In this case, the monitoring data format is set by SpringBoot. As an example, the monitoring data format is set by using Logback or Log4j log framework. The monitoring data format includes the result format and the path data format.
[0112] See also Figure 7 That is 700, Figure 7 This is a flow chart of constructing monitoring log records based on http requests according to an embodiment of the present invention. Specifically, it includes the following steps:
[0113] S701. In the filtering layer, search for http request operation data in the attributes of the http request according to business requirements, and decrypt the http request operation data using business logic.
[0114] In the filtering layer, a filter can be used to search the http request operation data in the attributes of the http request according to business requirements. Then, the business logic is used to decrypt the http request operation data.
[0115] S702: Use the decrypted http request start time point, http request parameters, http request header and http request end time point as the business monitoring data.
[0116] In one embodiment of the present invention, the http request operation data of the monitored object includes: http request start time point, http request parameters, http request header and http request end time point.
[0117] The filter receives the http request operation data of the monitored object, and uses the decrypted http request start time, http request parameters, http request header and http request end time as business monitoring data. Then, the searched data is used to construct a monitoring log record according to the monitoring data format.
[0118] exist Figure 7 In an embodiment, monitoring log records are constructed based on business monitoring data.
[0119] In the above-mentioned embodiment of the present invention, the filter initiates a monitoring data request, and in response to the monitoring data request, the business logic is configured inside the aspect of aspect-oriented programming to determine the monitoring object. When the method in the monitoring object is called, the aspect collects the http request operation data of the monitoring object; the http request operation data collected by the aspect is encrypted by the business logic and added to the attributes of the http request, so that the http request operation data is obtained from the attributes of the http request; after the http request reaches the filtering layer, the business logic is used to decrypt the http request operation data from the attributes of the http request according to business requirements in the filtering layer to obtain business monitoring data, and a monitoring log record is constructed based on the business monitoring data and the monitoring data format. The monitoring log does not need to modify the original code, which can avoid the high intrusiveness of the log record and improve the system stability.
[0120] That is, without affecting the original functions and performance, optimize the way to obtain log records. Low-intrusion does not require a lot of modification to the original code. Without changing the original business logic, real-time monitoring and recording of logs can be achieved, thereby improving the stability of the system.
[0121] See also Figure 8 , Figure 8 is a schematic diagram of the main structure of a device for monitoring data according to an embodiment of the present invention. The device for monitoring data can implement a method for monitoring data, such as Figure 8 As shown in 800, the device for monitoring data specifically includes:
[0122] Monitoring module 801, used for initiating monitoring data request by filter, configuring business logic inside aspect of aspect-oriented programming to determine monitoring object in response to the monitoring data request, when the method in the monitoring object is called, the aspect collects http request operation data of the monitoring object;
[0123] An adding module 802 is used to encrypt the http request operation data collected by the section using the business logic and add it to the attributes of the http request, so that the http request operation data is obtained from the attributes of the http request;
[0124] The log module 803 is used for decrypting the http request operation data from the attributes of the http request according to business needs in the filtering layer after the http request reaches the filtering layer, and obtaining business monitoring data, and constructing a monitoring log record based on the business monitoring data and the monitoring data format.
[0125] In one embodiment of the present invention, the monitoring module 801 is specifically used for the filter to initiate a monitoring data request, and in response to the monitoring data request, to construct the aspect-oriented programming aspect between the control layer and the outbound client service code;
[0126] Within the aspect of aspect-oriented programming, business logic is configured based on the monitoring parameters of the monitoring data request to determine the monitoring object, and the method in the monitoring object is obtained through annotation configuration. The method in the monitoring object is called, and the aspect collects the http request operation data of the monitoring object.
[0127] In one embodiment of the present invention, the monitoring module 801 is specifically used for the filter to initiate a monitoring data request, to construct the aspect-oriented programming aspect between the control layer and the outbound client service code in response to the monitoring data request, and to configure a cut point in the aspect-oriented programming aspect;
[0128] The configuring of business logic based on the monitoring parameters of the monitoring data request within the aspect-oriented programming to determine the monitoring object includes:
[0129] At the pointcut in the aspect of the aspect-oriented programming, business logic is configured based on monitoring parameters of the monitoring data request to determine a monitoring object.
[0130] In one embodiment of the present invention, the adding module 802 is specifically used to obtain the object of the http request in the surrounding notification of the section, and encrypt the http request operation data collected by the section by using the business logic through the http request object and add it to the attributes of the http request;
[0131] So that the filter obtains the http request operation data from the attributes of the http request through the object of the http request.
[0132] In one embodiment of the present invention, the log module 803 is specifically used for intercepting the http request by the filter of the filtering layer after the http request reaches the filtering layer, and the http request includes the method processing result, method processing information and business information;
[0133] In the filtering layer, according to business requirements, the business logic is used to decrypt the http request operation data from the attributes of the http request to obtain business monitoring data, and a monitoring log record is constructed based on the business monitoring data and the monitoring data format. The business monitoring data includes method processing results, method processing information and business information.
[0134] In one embodiment of the present invention, the log module 803 is specifically used for the method processing information including key function entry and key function exit; the method processing result includes: error location and exception processing location;
[0135] Establishing result data of the monitoring log record based on the processing result of the method and the result format in the monitoring data format;
[0136] According to the key function entry, the key function exit, the error location and the exception handling location, and according to the path data format in the monitoring data format, the tracking path data in the monitoring log record is constructed.
[0137] In one embodiment of the present invention, the http request operation data of the monitored object includes: http request start time point, http request parameters, http request header and http request end time point;
[0138] The log module 803 is specifically used to search the attributes of the http request according to the business requirements in the filtering layer for the http request and use the business logic to decrypt the http request operation data;
[0139] The decrypted http request start time point, http request parameters, http request header and http request end time point are used as the business monitoring data.
[0140] Fig. 9 An exemplary system architecture 900 is shown to which the method for monitoring data or the apparatus for monitoring data according to the embodiments of the present invention may be applied.
[0141] like Fig. 9 As shown, system architecture 900 may include terminal devices 901, 902, 903, network 904 and server 905. Network 904 is used to provide a medium for communication links between terminal devices 901, 902, 903 and server 905. Network 904 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0142] The user can use the terminal devices 901, 902, 903 to interact with the server 905 through the network 904 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 901, 902, 903, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).
[0143] The terminal devices 901 , 902 , and 903 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.
[0144] The server 905 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 901, 902, and 903. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only an example) to the terminal device.
[0145] It should be noted that the method for monitoring data provided in the embodiment of the present invention is generally executed by the server 905 , and accordingly, the device for monitoring data is generally set in the server 905 .
[0146] It should be understood that Fig. 9 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0147] A computer program product according to an embodiment of the present invention includes a computer program, and when the program is executed by a processor, the method for monitoring data provided by the embodiment of the present invention is implemented.
[0148] Reference below Fig.10 , which shows a schematic diagram of the structure of a computer system 1000 of a terminal device suitable for implementing an embodiment of the present invention. Fig.10 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0149] like Fig.10 As shown, the computer system 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage part 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the system 1000 are also stored. The CPU 1001, the ROM 1002, and the RAM 1003 are connected to each other through a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0150] The following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage section 1008 as needed.
[0151] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1009, and / or installed from the removable medium 1011. When the computer program is executed by the central processing unit (CPU) 1001, the above-mentioned functions defined in the system of the present invention are executed.
[0152] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0153] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0154] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be set in a processor, for example, may be described as: a processor includes a monitoring module 801, an adding module 802 and a logging module 803. The names of these modules do not constitute a limitation on the module itself in some cases, for example, the monitoring module may also be described as "used for the filter to initiate a monitoring data request, and in response to the monitoring data request, configure the business logic inside the aspect of aspect-oriented programming to determine the monitoring object, and the method in the monitoring object is called, then the aspect collects the http request operation data of the monitoring object".
[0155] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:
[0156] The filter initiates a monitoring data request, and in response to the monitoring data request, configures business logic within the aspect of aspect-oriented programming to determine the monitoring object. When the method in the monitoring object is called, the aspect collects the http request operation data of the monitoring object.
[0157] The http request operation data collected by the section is encrypted by the business logic and added to the attributes of the http request, so that the http request operation data is obtained from the attributes of the http request;
[0158] After the http request reaches the filtering layer, the filtering layer uses the business logic to decrypt the http request operation data from the attributes of the http request according to business requirements to obtain business monitoring data, and constructs a monitoring log record based on the business monitoring data and the monitoring data format.
[0159] According to the technical solution of the embodiment of the present invention, the filter initiates a monitoring data request, and in response to the monitoring data request, the business logic is configured inside the aspect of aspect-oriented programming to determine the monitoring object. When the method in the monitoring object is called, the aspect collects the http request operation data of the monitoring object; the http request operation data collected by the aspect is encrypted by the business logic and added to the attributes of the http request, so that the http request operation data is obtained from the attributes of the http request; after the http request reaches the filtering layer, the business logic is used to decrypt the http request operation data from the attributes of the http request according to business requirements in the filtering layer to obtain business monitoring data, and a monitoring log record is constructed based on the business monitoring data and the monitoring data format. The monitoring log does not need to modify the original code, which can avoid the high intrusiveness of the log record and improve the system stability.
[0160] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
[0161] It should be noted that in the technical solution of the present invention, the collection, analysis, use, transmission, storage and other aspects of user personal information involved are in compliance with the provisions of relevant laws and regulations, are used for legal and reasonable purposes, are not shared, leaked or sold outside of these legal uses, and are subject to supervision and management by regulatory authorities. Necessary measures should be taken for user personal information to prevent illegal access to such personal information data, ensure that persons who have access to personal information data comply with the provisions of relevant laws and regulations, and ensure the security of user personal information. Once these user personal information data are no longer needed, the risks should be minimized by limiting or even prohibiting data collection and / or deleting data.
[0162] When applicable, including in certain relevant applications, protect user privacy by de-identifying data, such as by removing specific identifiers (e.g., date of birth, etc.) when applicable, controlling the amount or specificity of data stored (e.g., collecting location data at a city level rather than at a specific address level), controlling how data is stored, and / or other de-identification methods.
Claims
1. A method for monitoring data, characterized in that: include: The filter initiates a monitoring data request, and in response to the monitoring data request, configures business logic within the aspect of aspect-oriented programming to determine the monitoring object. When the method in the monitoring object is called, the aspect collects the http request operation data of the monitoring object. The http request operation data collected by the section is encrypted by the business logic and added to the attributes of the http request, so that the http request operation data is obtained from the attributes of the http request; After the http request reaches the filtering layer, the filtering layer uses the business logic to decrypt the http request operation data from the attributes of the http request according to business requirements to obtain business monitoring data, and constructs a monitoring log record based on the business monitoring data and the monitoring data format.
2. The method for monitoring data according to claim 1, characterized in that: The filter initiates a monitoring data request, configures business logic within the aspect-oriented programming aspect in response to the monitoring data request to determine a monitoring object, a method in the monitoring object is called, and the aspect collects http request operation data of the monitoring object, including: The filter initiates a monitoring data request, and constructs the aspect-oriented programming aspect between the control layer and the outbound client service code in response to the monitoring data request; Within the aspect of aspect-oriented programming, business logic is configured based on the monitoring parameters of the monitoring data request to determine the monitoring object, and the method in the monitoring object is obtained through annotation configuration. The method in the monitoring object is called, and the aspect collects the http request operation data of the monitoring object.
3. The method for monitoring data according to claim 2, characterized in that: The filter initiates a monitoring data request, and in response to the monitoring data request, constructs the aspect-oriented programming aspect between the control layer and the outbound client service code, including: The filter initiates a monitoring data request, constructs the aspect-oriented programming aspect between the control layer and the outbound client service code in response to the monitoring data request, and configures a cut point in the aspect-oriented programming aspect; The configuring of business logic based on the monitoring parameters of the monitoring data request within the aspect-oriented programming to determine the monitoring object includes: At the pointcut in the aspect of the aspect-oriented programming, business logic is configured based on monitoring parameters of the monitoring data request to determine a monitoring object.
4. The method for monitoring data according to claim 1, characterized in that: The step of encrypting the http request operation data collected by the section by using the business logic and adding the data to the attributes of the http request so that the filter obtains the http request operation data from the attributes of the http request includes: Obtaining the object of the http request in the surround notification of the slice, encrypting the http request operation data collected by the slice by using the business logic through the object of the http request, and then adding it to the attributes of the http request; So that the filter obtains the http request operation data from the attributes of the http request through the object of the http request.
5. The method for monitoring data according to claim 1, characterized in that: After the http request reaches the filtering layer, the filtering layer uses the business logic to decrypt the http request operation data from the attributes of the http request according to business requirements to obtain business monitoring data, and constructs a monitoring log record based on the business monitoring data and the monitoring data format, including: After the http request reaches the filtering layer, the filter of the filtering layer intercepts the http request, and the http request includes method processing results, method processing information and business information; In the filtering layer, according to business requirements, the business logic is used to decrypt the http request operation data from the attributes of the http request to obtain business monitoring data, and a monitoring log record is constructed based on the business monitoring data and the monitoring data format. The business monitoring data includes method processing results, method processing information and business information.
6. The method for monitoring data according to claim 5, characterized in that: The method processes information including key function entry and key function exit; The processing results of the method include: error location and exception processing location; The constructing of monitoring log records based on the business monitoring data and the monitoring data format includes: Establishing result data of the monitoring log record based on the processing result of the method and the result format in the monitoring data format; According to the key function entry, the key function exit, the error location and the exception handling location, and according to the path data format in the monitoring data format, the tracking path data in the monitoring log record is constructed.
7. The method for monitoring data according to claim 1, characterized in that: The http request operation data of the monitored object includes: http request start time point, http request parameters, http request header and http request end time point; The step of decrypting the http request operation data from the attributes of the http request using the business logic to obtain the business monitoring data for the http request in the filtering layer according to the business requirements includes: In the filtering layer, searching the http request operation data in the attributes of the http request according to the business requirements for the http request, and decrypting the http request operation data using the business logic; The decrypted http request start time point, http request parameters, http request header and http request end time point are used as the business monitoring data.
8. A device for monitoring data, characterized in that: include: A monitoring module is used for initiating a monitoring data request by a filter, and in response to the monitoring data request, configuring business logic inside a facet of facet-oriented programming to determine a monitoring object. When a method in the monitoring object is called, the facet collects http request operation data of the monitoring object. An adding module, used for encrypting the http request operation data collected by the section by using the business logic and adding it to the attributes of the http request, so that the http request operation data can be obtained from the attributes of the http request; The log module is used for decrypting the http request operation data from the attributes of the http request according to business needs in the filtering layer after the http request reaches the filtering layer, and obtaining business monitoring data, and constructing a monitoring log record based on the business monitoring data and the monitoring data format.
9. An electronic device for monitoring data, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
11. A computer program product, comprising a computer program, 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.