Interface call log analysis method and device, equipment, medium and product
Through the interface, the automatic interception, parsing and analysis methods of the log analysis toolkit are called, and the problem of complex deployment of existing tools and insufficient real-time analysis capabilities are solved, efficient log management and exception detection of microservices are realized, and system stability is improved. Security.
Patent Information
- Application Number
- CN202411390817.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2044-10-08
AI Technical Summary
The existing link tracking and log analysis tools are complex to deploy and configure, have limited real-time analysis capabilities, and insufficient early warning and notification functions, making it difficult to meet the efficient collaboration and troubleshooting needs under the microservice architecture.
Provides an interface call log analysis method. By installing the interface call log analysis toolkit, it intercepts and parses the interface requests of microservices, collects, stores and analyzes log data based on preset log formats and collection strategies, and supports a variety of databases and early warnings. mechanism to realize automated log analysis and abnormal detection.
Simplifies the deployment and configuration of log analysis tools, realizes automatic interception and in-depth analysis of interface service requests, supports diverse log management requirements, can identify performance bottlenecks and abnormal behaviors, improves system security and stability, and reduces The complexity of log analysis tools.
Smart Images

Figure CN118897784A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer software technology, and in particular to an interface call log analysis method, device, equipment, medium and product. Background Art
[0002] In recent years, with the widespread application of microservice architecture, the complexity of software systems has continued to increase. In this context, it is particularly important to ensure efficient collaboration and troubleshooting between microservices. However, existing link tracking and log analysis tools often have some defects, such as complex deployment and configuration processes, limited real-time analysis capabilities, and insufficient warning and notification functions. For example, although systems such as Zipkin (a distributed tracing system) provide collection and display of tracing data, they require the deployment of tracing servers separately and the configuration of corresponding tracing dependencies and codes in each service, which may be complicated for users who are new to such systems. Summary of the invention
[0003] The main purpose of this application is to provide an interface call log analysis method, device, equipment, medium and product, aiming to solve the technical problem of high complexity in deployment and configuration of log analysis tools.
[0004] To achieve the above purpose, the present application proposes an interface call log analysis method, which is applied to a microservice installed with an interface call log analysis toolkit. The interface call log analysis method includes: Based on the filter in the interface call log analysis toolkit, the service request of the interface requesting the microservice is intercepted, and the service information of the intercepted service request is parsed; Convert service information into log data based on a preset log format; Obtaining demand information input from the outside, configuring a collection strategy for log data according to the demand information, and collecting target log data in the log data according to the configured collection strategy, wherein the collection strategy includes at least one of collecting by time interval, collecting by log size, collecting by log level, collecting by request path, and collecting by user identity; Storing target log data in a preset database, determining a data set consisting of multiple target log data in the database, and performing anomaly detection on the data set, wherein the database includes at least one of a relational database and a Nosql database; If the abnormality detection result shows that an abnormality exists, the preset warning information is output.
[0005] In one embodiment, the step of collecting target log data in the log data according to the configured collection strategy includes: If the collection strategy is to collect at a time interval, determine a scheduled task corresponding to the collection strategy, and collect target log data in the log data according to the scheduled task, wherein the scheduled task includes collecting log data based on a preset time interval; If the collection strategy is to collect by log size, then detect whether the storage data volume of the log data is greater than the preset storage data volume threshold. If it is greater than the preset storage data volume threshold, collect the log data as target log data; If the collection strategy is to collect by log level, the log data that meets the preset log level will be collected as the target log data; If the collection strategy is to collect by request path, the log data that meets the preset request path will be collected as the target log data; If the collection strategy is to collect by user identity, the log data that meets the preset user identity will be collected as the target log data.
[0006] In one embodiment, the step of storing the target log data in a preset database includes: If the number of service requests within a preset time period is less than a preset threshold, the target log data is saved to a relational database; If the number of service requests within a preset time period is greater than or equal to a preset threshold, the target log data is saved to the Nosql database.
[0007] In one embodiment, the step of performing anomaly detection on a data set includes: Divide the data set into different data groups according to the interface, and take each target log data in each data group as a data object; wherein each interface corresponds to a data group; If the data object meets the preset abnormal condition, the data object is marked as an abnormal log, and the abnormal detection result is determined to be abnormal.
[0008] In one embodiment, after the step of taking each target log data in each data group as a data object, the following steps are included: For each data group, if the number of data objects within a preset time range is greater than a preset service request number threshold, it is determined that the data objects within the preset time range meet a preset abnormal condition; and / or, Determine the data object corresponding to the service request in the failed state in the data group, if the object quantity of the data object corresponding to the service request in the failed state is greater than a preset failure quantity threshold, then determine that the data object corresponding to the service request in the failed state meets the preset abnormal condition; and / or, The return parameter corresponding to each data object in the data group is determined. If there is a target return parameter containing preset specific characters in each return parameter, it is determined that the data object corresponding to the target return parameter meets the preset abnormal condition.
[0009] In one embodiment, after the step of taking each target log data in each data group as a data object, the method further includes: Obtain the identity of the requester of the data object; User behavior analysis is performed based on the identity of the requester, wherein the user behavior analysis includes determining the user group based on the identity of the requester that appears most frequently in each data group.
[0010] In addition, to achieve the above purpose, the present application also proposes an interface call log analysis device, which is arranged in a microservice in which an interface call log analysis toolkit is installed, and the interface call log analysis device includes: The log collection module intercepts the service request of the interface requesting the microservice based on the filter in the interface call log analysis toolkit, and parses the service information of the intercepted service request; Log format module, which converts service information into log data based on the preset log format; A log collection module, which obtains demand information input from the outside, configures a collection strategy for log data according to the demand information, and collects target log data in the log data according to the configured collection strategy, wherein the collection strategy includes at least one of collecting by time interval, collecting by log size, collecting by log level, collecting by request path, and collecting by user identity; The log analysis module stores the target log data in a preset database, determines a data set consisting of multiple target log data in the database, and performs anomaly detection on the data set, wherein the database includes at least one of a relational database and a Nosql database; The log warning module outputs the preset warning information if the anomaly detection result is an anomaly.
[0011] In addition, to achieve the above-mentioned purpose, the present application also proposes an interface call log analysis device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the interface call log analysis method as described above.
[0012] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the interface calling log analysis method as described above are implemented.
[0013] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the interface calling log analysis method as described above are implemented.
[0014] One or more technical solutions proposed in this application have at least the following technical effects: The present application integrates the interface call log analysis method through the interface call log analysis toolkit, so that each microservice only needs to simply install the toolkit, without additional configuration or cumbersome operation, to automatically intercept and deeply analyze the interface service request. Specifically, the microservice with the toolkit installed can intercept all service requests pointing to the interface of the microservice through the filter, and parse the service information in these service requests, so as to achieve comprehensive capture and detailed analysis of the service request content. Then, the microservice will convert the service information into log data according to the preset log format. Obtain the demand information input from the outside, configure the collection strategy for the log data according to the demand information, and collect the target log data in the log data according to the configured collection strategy, wherein the collection strategy includes collecting by time interval, collecting by log size, collecting by log level, collecting by request path and collecting by user identity. At least one of the collection strategies configured according to the demand information meets the diverse log management needs, so that the system can efficiently filter out valuable log data for specific business scenarios or needs. The target log data is stored in a preset database, including at least one of a relational database and a Nosql database, which can adapt to the needs of different business scenarios. Furthermore, the system supports retrieving and aggregating target log data from the database to form a comprehensive data set. By conducting in-depth analysis of these data sets, the system can identify potential performance bottlenecks and abnormal behaviors, and send preset warning information to users accordingly. This process not only helps developers quickly locate problems and optimize service performance, but also greatly improves the security and stability of the system. In summary, this application greatly reduces the complexity of log analysis tool deployment and configuration through an integrated interface call log analysis toolkit, and realizes the automated collection, formatting, storage and analysis of log data. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0017] Figure 1 This is a flow chart of the first embodiment of the method for analyzing the interface calling logs of this application; Figure 2 This is a flow chart of the second embodiment of the interface call log analysis method of this application; Figure 3 This is a schematic diagram of the scenario in which the application interface calls the log analysis method; Figure 4 This is a schematic diagram of the module structure of the interface call log analysis device according to an embodiment of the present application; Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the interface call log analysis method in the embodiment of the present application.
[0018] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0019] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0020] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0021] Due to some limitations of current log analysis tools, they usually require the deployment of a separate tracking server and the configuration of corresponding tracking dependencies and codes in each service. For users who are new to such tools, the deployment and configuration process may be relatively complicated. In addition, the main function currently provided is the collection and display of tracking data, but the real-time analysis and monitoring capabilities are relatively weak. Although real-time tracking data can be viewed, advanced real-time analysis functions are lacking. The warning and notification functions are also relatively limited, mainly relying on user-defined rules and scripts, and lacking a built-in, out-of-the-box warning and notification system, which may require users to perform additional development and configuration. At the same time, some log analysis tools only use a single database for log storage, which reduces the adaptability of log analysis tools and cannot meet the needs of different business scenarios.
[0022] The interface call log analysis method provided in this embodiment simplifies the deployment process. Each microservice only needs to install the interface call log analysis toolkit that integrates the interface call log analysis method. No other redundant operations are required, and there is no need to deploy a separate tracking service like Zipkin (an open source distributed real-time data tracking system). This method has high configuration flexibility and supports configuration files to set log collection parameters, such as whether to enable log collection, log format, log sending method, etc. This embodiment supports a variety of relational databases and NoSQL (a general term for non-relational databases) databases, which can adapt to the needs of different business scenarios, so that users can choose a suitable database for log storage according to actual conditions. This embodiment provides a wealth of collection strategies, including collection by time interval, collection by log size, collection by log level, etc. Users can set logs to be collected once a minute according to business needs, or collect when the log size exceeds a specific threshold to improve the efficiency of log collection. In addition, this embodiment provides a variety of warning strategies, including real-time monitoring and warning of online problems. For example, specific keywords or logs of a specific level can be set as warning objects, and warning notifications are sent when conditions are met to handle online problems in a timely manner. Some user-specific behaviors can also be collected, and developers can configure them according to their own business dimensions. For example, after a certain interface is requested a certain number of times by a certain user within a certain period of time, a notification is sent to the company's intelligent platform to facilitate subsequent business analysis. This embodiment is mainly aimed at link tracking of the interface. We can do some intelligent analysis through the interface log; in the design of the log warning and collection strategy architecture, we have fully considered various business scenarios, and we have basically supported the scenarios required in research and development; the intelligent analysis module is more practical for some consumer-oriented systems.
[0023] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a terminal system, etc. The following takes a microservice system with an interface call log analysis toolkit installed as an example to illustrate this embodiment and the following embodiments.
[0024] Based on this, this embodiment provides an interface call log analysis method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the interface call log analysis method of this application.
[0025] In this embodiment, it is applied to a microservice that has an interface call log analysis toolkit installed.
[0026] The interface call log analysis toolkit refers to a software package that integrates the interface call log analysis method. It is deployed in a microservice environment and is used to automatically intercept, parse, collect, store and analyze the log data of interface calls. Microservices only need to install the toolkit to record and analyze the microservice interface call link log without any other unnecessary operations.
[0027] The interface call log analysis method includes steps S10 to S50: Step S10, intercepting the service request of the interface requesting the microservice based on the filter in the interface call log analysis toolkit, and parsing the service information of the intercepted service request; It should be noted that the interface is a bridge for interaction between different components in a software system, and defines the communication methods and rules between components. In the microservice architecture, a service request refers to a request initiated by one microservice to another microservice or an external system, which usually contains information such as the request method, path, and parameters. Service information is extracted from the service request and is used to describe the request itself and its context, including the request information and response information of the request. The request information may include the request time, requester identity, request parameters, etc., and the response information may include the response time, responder identity, response content, etc. The filters in the interface call log analysis toolkit can intercept these requests and responses and process them before the service request reaches the target resource or returns from the target resource.
[0028] The interface call log analysis toolkit has a built-in service request filter that can automatically intercept all service requests and responses without manually configuring the tracking code or deploying a separate tracking server. When a microservice system with the toolkit installed receives external or internal service requests, the system first intercepts these service requests and extracts key service information from the intercepted service requests, such as request time, request method, request path, request parameters, etc.
[0029] In addition, based on specific business needs and preset configurations, other relevant information may also be extracted, such as user authentication information in the request header, client IP address, request source, etc., to facilitate more comprehensive log analysis and security audits.
[0030] Step S20, converting the service information into log data based on a preset log format; It should be noted that the format of service information is not necessarily uniform, so the original service information needs to be organized in a certain format to facilitate subsequent storage, query and analysis.
[0031] The parsed service information is sorted and converted according to a preset format (such as JSON, a widely used lightweight data exchange format) to form log entries that are easy to store and query, and the converted log entries are used as log data.
[0032] Step S30, obtaining demand information input from the outside, configuring a collection strategy for the log data according to the demand information, and collecting target log data in the log data according to the configured collection strategy, wherein the collection strategy includes at least one of collecting by time interval, collecting by log size, collecting by log level, collecting by request path, and collecting by user identity; It should be noted that the collection strategy refers to the rules for collecting log data based on specific conditions (such as time interval, log size, log level, request path, user identity, etc.).
[0033] Obtain the log collection requirement information from the user or system configuration, and configure the corresponding collection strategy based on the requirement information. The specific application of the collection strategy may include collecting at time intervals, such as daily, hourly, and other fixed time intervals; collecting by log size, collecting when the log file reaches a certain size (such as 100MB); collecting by log level, only collecting logs of a specific level (such as ERROR, WARN); collecting by request path, only collecting logs of a specific API path; collecting by user identity, filtering logs according to the user identity of the requester (such as user ID, role). According to the configured collection strategy, filter the target log data that meets the collection strategy from the log data for collection.
[0034] Furthermore, users can input collection strategies through a visual interface or configuration file. For example, after logging into the system, users can fill in or select the required collection strategy parameters through the options and input boxes on the visual interface. The system receives and parses these inputs and generates the corresponding collection strategy; or users edit a configuration file and write the required collection strategy parameters into the file. Then, the user uploads the configuration file to the system or places it in a directory specified by the system. The system reads the configuration file, parses the content therein, and generates a collection strategy. Thus, the system selects the target log data that meets the collection strategy from the log data according to the configured collection strategy for collection.
[0035] Step S40, storing the target log data in a preset database, determining a data set consisting of a plurality of target log data in the database, and performing anomaly detection on the data set, wherein the database includes at least one of a relational database and a Nosql database; It should be noted that a database is a software system used to store and manage data, including relational databases (such as MySQL) and NoSQL databases. A relational database is a database system that uses tables to store and organize data. Data is stored in the form of rows and columns and supports complex queries and transaction processing. NoSQL (Not Only SQL) databases are a general term for a class of non-relational databases that do not follow the table structure, data relationships (such as foreign key constraints), and SQL query language rules of traditional relational databases. The original intention of the design of NoSQL databases was to solve the problems of diversity and high concurrent access to large-scale data sets. These characteristics make them perform well in processing big data, high availability, and distributed systems. Anomaly detection refers to the analysis of stored data sets to identify data that does not conform to normal patterns or expectations.
[0036] The collected target log data is stored in the preset database. In the database, multiple target log data are combined into a data set. Then the data set is analyzed. If the data set is small and the analysis task is relatively simple, it can be analyzed directly in the database using the database query language and built-in analysis functions. If the data set is large or complex data analysis and visualization are required, the data can be extracted and analyzed in an external environment (such as using programming languages such as Python and R and their data analysis libraries). Analyze whether there is abnormal data, such as abnormally long response time, high request failure rate, etc.
[0037] Step S50: If the abnormality detection result is that an abnormality exists, a preset warning message is output.
[0038] It should be noted that early warning information refers to the notification or alarm sent to relevant personnel when the system detects an abnormal situation so that timely measures can be taken to solve the problem.
[0039] According to the results of anomaly detection, determine whether there are anomalies, such as: performance anomalies (abnormally long response time or decreased processing speed), error rate anomalies (high request failure rate or increased internal system errors), resource usage anomalies (too high memory usage or insufficient disk space). If there are anomalies, an early warning message is generated according to the preset early warning template. The early warning template can contain the following elements: anomaly type, occurrence time, scope of impact, severity, and recommended measures. Then send the early warning information to relevant personnel through email, SMS, instant messaging, etc. If there are no anomalies, you can continue to monitor and perform subsequent processing according to the configured policies (such as regular reporting, log archiving, etc.). In some cases, the system may record the current state as a normal baseline for future anomaly detection comparison. In addition, for a long period of stable state without anomalies, the system may trigger some optimization or cleanup tasks, such as compressing old logs, releasing unused resources, etc., to maintain the best performance of the system.
[0040] For example, suppose there is an e-commerce microservice system that includes a microservice for processing orders. In order to monitor the performance and stability of the order processing interface, we deploy an interface call log analysis toolkit. When the order processing interface receives a request to create an order, the interface call log analysis toolkit first intercepts the request and extracts key information from the request, such as request time (2023-04-01 12:00:00), request method (POST), request path ( / orders), and request parameters ({userId: 123, productId: 456, quantity: 2}). This information is formatted into a JSON-formatted log entry: {"time": "2023-04-01 12:00:00", "method": "POST", "path": " / orders", "params": {"userId": 123, "productId": 456, "quantity":2}}. According to the preset collection strategy (such as collecting once a day), the formatted log data is saved in the database. The order processing interface log data for the past week was retrieved from the database to form a data set. After statistical analysis of the data set, it was found that the interface response time increased significantly during a certain period of time, and the average response time increased from 100ms to 300ms. Based on the analysis results, an early warning message was sent to the system administrator: "Attention! The response time of the order processing interface increased significantly during the XX period of time, which may affect the user experience. Please check and optimize it." This embodiment integrates the interface call log analysis method through the interface call log analysis toolkit, so that each microservice only needs to simply install the toolkit, without additional configuration or cumbersome operation, to automatically intercept and deeply analyze the interface service request. Specifically, the microservice installed with the toolkit can intercept all service requests pointing to the interface of the microservice through the filter, and parse the service information in these service requests, so as to achieve comprehensive capture and detailed analysis of the service request content. Then, the microservice will convert the service information into log data according to the preset log format. Obtain the demand information input from the outside, configure the collection strategy for the log data according to the demand information, and collect the target log data in the log data according to the configured collection strategy, wherein the collection strategy includes collecting by time interval, collecting by log size, collecting by log level, collecting by request path and collecting by user identity. At least one of the collection strategies configured according to the demand information meets the diverse log management requirements, so that the system can efficiently filter out valuable log data for specific business scenarios or requirements. The target log data is stored in a preset database, including at least one of a relational database and a Nosql database, which can adapt to the needs of different business scenarios. Furthermore, the system supports retrieving and aggregating target log data from the database to form a comprehensive data set. By conducting in-depth analysis of these data sets, the system can identify potential performance bottlenecks and abnormal behaviors, and send preset warning information to users accordingly. This process not only helps developers quickly locate problems and optimize service performance, but also greatly improves the security and stability of the system. In summary, this embodiment greatly reduces the complexity of log analysis tool deployment and configuration through an integrated interface call log analysis toolkit, and realizes the automated collection, formatting, storage and analysis of log data.
[0041] In a feasible implementation manner, the step of storing the target log data in a preset database in step S40 may include steps T10 to T20: Step T10, if the number of service requests within a preset time period is less than a preset threshold, the target log data is saved to a relational database; It should be noted that, in this embodiment, various popular relational databases and nosql databases can be supported to save logs. The preset threshold is a predefined numerical limit used to determine whether a certain condition is met. In this embodiment, the preset threshold is used to determine whether the number of service requests has reached a certain level, thereby determining the storage location of the log data.
[0042] The number of service requests received per unit time by the microservice in the past is used to manually determine whether it is small enough. If it is small enough, for example, only 10 requests are received in one minute, then only a relational database needs to be used for subsequent log storage, which is less costly.
[0043] Step T20: If the number of service requests within a preset time period is greater than or equal to a preset threshold, the target log data is saved to the Nosql database.
[0044] The number of service requests received by the microservice per unit time in the past is used to manually determine whether it is large enough. If it is large enough, for example, 10,000 requests are received in one minute, then a Nosql database needs to be used for subsequent log storage to cope with the storage requirements of high concurrency and massive data.
[0045] Furthermore, the judgment of whether the number of service requests is less than the preset threshold can be realized by writing code logic. The code will monitor or count the number of service requests and compare it with the preset threshold to make a decision. First, the system needs to count the number of service requests received within a period of time. This number can be obtained through a counter, the backlog of the message queue, or other mechanisms. The number of service requests obtained by counting is compared with the preset threshold to determine the storage location of the log data. If the number of service requests is less than the preset threshold: the system believes that the current request volume is small and may not need the high concurrency and scalability advantages provided by the NoSQL database. Therefore, the log data is saved to a relational database in order to take advantage of the relational database in transaction processing, complex queries, etc. The system believes that the current request volume is large and may require a NoSQL database to cope with the storage requirements of high concurrency and massive data. Therefore, the log data is saved to a NoSQL database to better handle large-scale data and high concurrent access.
[0046] This embodiment significantly improves the flexibility and efficiency of log processing by selecting a data storage solution. The storage location of log data is determined based on the service request volume. When the request volume is small, the low cost and high consistency of the relational database are utilized to effectively reduce the storage cost; when the request volume is large, a NoSQL database is used to cope with the challenges of high concurrency and massive data, ensuring the integrity of the log data and the stability of the system. This data storage strategy based on autonomous selection of request volume not only improves resource utilization efficiency, but also enhances the scalability and responsiveness of the system, bringing significant beneficial effects to log management under the microservice architecture.
[0047] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above introduction, and will not be repeated in the following. Figure 2 , Figure 2 This is a flow chart of the second embodiment of the interface call log analysis method of the present application. The step of collecting target log data in the log data according to the configured collection strategy in step S30 also includes steps A10 to A50: Step A10, if the collection strategy is to collect at a time interval, determine a scheduled task corresponding to the collection strategy, and collect target log data in the log data according to the scheduled task, wherein the scheduled task includes collecting log data based on a preset time interval; It should be noted that collection by time interval is a collection strategy, which refers to collecting log data according to preset time intervals (such as every hour, every day, etc.). Scheduled tasks are tasks preset in the system or program and automatically executed according to specific times or conditions. In this embodiment, scheduled tasks are used to collect log data based on time intervals. The target log data is the specific log data that is selected and prepared for collection according to the collection strategy. The preset time interval is a time period set in advance in the collection strategy by time interval to determine the frequency of collecting log data.
[0048] Determine the collection strategy as collection at time intervals, find the scheduled task corresponding to the strategy, and automatically perform the log data collection operation according to the preset time interval in the scheduled task.
[0049] Step A20, if the collection strategy is to collect by log size, then detect whether the storage data volume of the log data is greater than a preset storage data volume threshold, and if it is greater than the preset storage data volume threshold, collect the log data as target log data; It should be noted that collection by log size is a collection strategy, which means that when the storage volume of log data reaches or exceeds a preset threshold, the collection of log data is triggered. The preset storage volume threshold is the storage volume limit used to determine whether to collect log data in the collection strategy by log size.
[0050] Determine the collection strategy as collection by log size, regularly detect the storage data volume of log data, and trigger the log data collection operation if the storage data volume is greater than the preset storage data volume threshold.
[0051] Step A30: if the collection strategy is to collect by log level, log data that meets the preset log level is collected as target log data; It should be noted that collection by log level is a collection strategy that only collects log data with a specific log level. Log level is usually used to indicate the importance and urgency of log information. The preset level refers to the log level (such as INFO, WARNING, ERROR, etc.) specified in the collection by log level strategy.
[0052] Determine the collection strategy as collection by log level, traverse the log data, check the level of each log, and collect all log data that meets the preset level.
[0053] Step A40: if the collection strategy is to collect by request path, the log data satisfying the preset request path is collected as the target log data; It should be noted that collection by request path is a collection strategy that only collects log data related to a specific request path. This helps analyze logs of specific functions or modules. The preset path is the request path for which logs need to be collected in the collection by request path strategy.
[0054] For each log, its request path field needs to be checked. The request path of the log is compared with all preset request paths to see if there is a match. If the request path of the log matches a preset request path, the log data is collected for subsequent processing.
[0055] Step A50: If the collection strategy is to collect by user identity, the log data satisfying the preset user identity is collected as the target log data.
[0056] It should be noted that collection by user identity is a collection strategy that only collects log data of a specific user identity. This helps track and analyze the operation behavior of a specific user. The preset identity is the user identity for which logs need to be collected in the collection strategy by user identity.
[0057] Determine the collection strategy as collection by user identity, check the user identity in the log data, and collect all log data with the preset identity.
[0058] Furthermore, there can be multiple preset collection strategies at the same time. For example, if the preset collection strategy is to collect by request path (preset request path: / users / info) and collect by log level (preset level: ERROR), then a log with a log request path of / users / info and a log level of ERROR will be collected. In addition, when there are too many logs in a short period of time, a virtual space can be opened for temporary storage. When the log size in the virtual space exceeds the preset storage size, it can be taken out to match the preset collection strategy and saved to the database. It can also be timed to take logs from the virtual space for operation.
[0059] This embodiment can significantly improve the efficiency and accuracy of log management through the above-mentioned diversified log collection strategies. Through flexible configuration, the system can automatically and accurately screen and collect target log data according to conditions such as time interval, log size, log level, request path or user identity. This not only helps to quickly locate problems and analyze system performance, but also effectively reduces the storage of unnecessary logs and reduces storage costs. At the same time, when the amount of logs surges, virtual space is used for temporary storage, and then batch processing is carried out in conjunction with the preset collection strategy, which ensures the continuity and efficiency of log processing and provides strong support for the stable operation of the system.
[0060] Based on the first or second embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the first or second embodiment can be referred to the above description, and will not be described in detail later. The step of saving the log data to the database in step S40 also includes steps B10 to B20: Step B10, dividing the data set into different data groups according to the interface, and taking each target log data in each data group as a data object; wherein each interface corresponds to one data group; It should be noted that a dataset is a collection of related data, which can be structured or unstructured, for analysis, processing or storage. A data group is a subset of a dataset divided according to an interface. A data object refers to each target log data in a data group, which is processed or analyzed separately.
[0061] First, the data set is divided into multiple different data groups according to different interfaces. Each interface corresponds to a unique data group to ensure that the data logic is clear and easy to manage. In each data group, each target log data is extracted as a data object. These data objects will serve as the basic unit for subsequent analysis or processing.
[0062] Step B20: If the data object meets the preset abnormal condition, the data object is marked as an abnormal log, and the abnormality detection result is determined to be abnormal.
[0063] It should be noted that the preset abnormal conditions are a set of rules or conditions defined in advance to determine whether a data object is abnormal. When the attributes or values of a data object match these conditions, the data object is considered abnormal. Exception logs are data objects marked as abnormal, which may contain errors, abnormal behaviors, or data that does not meet expectations. The anomaly detection result is the conclusion drawn after anomaly detection on the data set, indicating whether there is abnormal data in the data set.
[0064] Traverse the data objects in each data group and apply the preset abnormal conditions for judgment. If a certain attribute or value of the data object meets the abnormal condition, the data object is marked as an abnormal log. After completing the abnormality detection of all data objects, determine the abnormality detection result based on the number of data objects marked as abnormal logs or other relevant factors. If there is a data object marked as abnormal, the abnormality detection result is that there is an abnormality; otherwise, the result is that there is no abnormality.
[0065] Through this embodiment, the system can efficiently subdivide large-scale data sets into multiple data groups according to interfaces, realizing refined management and analysis of data. The data objects in each data group are independent units, which facilitates subsequent in-depth analysis and processing. At the same time, the introduction of preset abnormal conditions enables the system to automatically identify and mark abnormal logs, quickly locate potential problems, and improve the accuracy and efficiency of abnormal detection. This process not only optimizes the log processing process, but also enhances the stability and reliability of the system, providing strong support for users.
[0066] Based on any one of the first to third embodiments of the present application, in the fourth embodiment of the present application, the same or similar content as any one of the first to third embodiments can refer to the above introduction, and will not be repeated later. After the step of taking each target log data in each data group as a data object in step B10, steps C10 to C30 are also included: Step C10: for each data group, if the number of data objects within the preset time range is greater than the preset service request number threshold, it is determined that the data objects within the preset time range meet the preset abnormal condition; It should be noted that the preset time range is a predefined time interval used for data analysis or screening. Data objects within this time range will be given special attention or processing. The preset service request quantity threshold is a pre-set value used to determine whether the number of service requests within a specific time range is abnormal. If the actual number exceeds this threshold, it is considered to be abnormal.
[0067] For each data group, a preset time range is first determined, and the number of data objects within the time range is counted. The statistical result is compared with the preset service request quantity threshold. If the number is greater than the threshold, it is determined that the data objects within the time range meet the preset abnormal condition.
[0068] Step C20, determining the data objects corresponding to the service request in the failed state in the data group, if the number of the data objects corresponding to the service request in the failed state is greater than a preset failure number threshold, determining that the data objects corresponding to the service request in the failed state meet the preset abnormal condition; It should be noted that a failed service request refers to a service request that has not been successfully completed, usually due to system errors, network problems, or insufficient resources. The preset failure number threshold is a pre-set value used to determine whether the number of service requests in a failed state in a data group is abnormal. If the actual number exceeds this threshold, it is considered to be abnormal.
[0069] Traverse each data object in the data group and identify the data object corresponding to the service request in the failed state. Count the number of these data objects and compare the statistical result with the preset failure number threshold. If the number is greater than the threshold, it is determined that the data object corresponding to the service request in the failed state meets the preset abnormal condition.
[0070] Step C30, determining the return parameter corresponding to each data object in the data group, if there is a target return parameter containing preset specific characters in each return parameter, determining that the data object corresponding to the target return parameter meets the preset abnormal condition.
[0071] It should be noted that the return parameter is the data or information returned by the service provider to the requester after the service request is completed. These parameters usually contain information about the service execution result or status. Preset specific characters are used to identify or filter data with specific meanings or attributes in data processing. If these characters are included in the return parameters, it may indicate that the data object meets certain abnormal conditions. Target return parameters are those parameters in the return parameters that contain preset specific characters. The data objects corresponding to these parameters may meet the preset abnormal conditions.
[0072] Traverse each data object in the data group and obtain its corresponding return parameter. Check whether each return parameter contains the preset specific characters. If a return parameter containing the specific characters is found (i.e., the target return parameter), it is determined that the data object corresponding to the return parameter meets the preset exception condition.
[0073] Of course, the abnormal situations are not limited to the above ones, and users can also add abnormal situation detection through configuration. At the same time, the system can also perform performance analysis, such as evaluating interface performance based on indicators such as interface call time and response status code.
[0074] This embodiment significantly improves the speed of problem discovery and response by detecting anomalies in data groups in multiple dimensions. The detection of the number of data objects within a preset time range, the monitoring of the number of failed service requests, and the screening of specific return parameters together build a comprehensive and flexible anomaly detection framework. This not only helps users quickly locate potential problems, but also timely analyzes service performance and interface stability, providing strong support for system optimization. In addition, users can customize anomaly detection rules, which further enhances the flexibility and adaptability of the system and ensures stable operation of the system.
[0075] In a feasible implementation manner, after the step of taking each target log data in each data group as a data object in step B10, steps D10 to D20 are also included: Step D10, obtaining the identity of the requester of the data object; It should be noted that the requester identity refers to the identity of the entity that initiates a data request or performs an operation. In logs or service request records, the requester identity is usually used to identify which user or system component initiated the request.
[0076] Extract the requester identity information of each data object (such as log records, service request records) from the data set. Ensure the accuracy and completeness of the requester identity information for subsequent analysis.
[0077] Step D20 , performing user behavior analysis based on the requester identity, wherein the user behavior analysis includes determining the user group based on the requester identity that appears most frequently in each data group.
[0078] It should be noted that user analysis is a data analysis method that aims to gain an in-depth understanding of user behavior, preferences, needs and other information by collecting and processing user data, so as to provide a basis for product optimization, market strategy formulation, etc. A user group is a collection of users with common characteristics or behavior patterns. In user analysis, user groups are usually divided according to certain attributes of users (such as age, gender, region, interests, etc.) or behaviors (such as purchasing habits, frequency of use, etc.). In this embodiment, the division is mainly based on the frequency of use of the analysis interface.
[0079] The extracted requester identity information is classified and organized for statistical analysis. The number of occurrences of each requester identity in each data group is counted to understand the level of activity of different users or user groups in the data group. Based on the requester identity with the most occurrences in each data group, the main user group of the data group is determined. This helps to identify which users or user groups are the main contributors or users of the data group.
[0080] Furthermore, we can take advantage of the link tracking of interfaces and perform some intelligent analysis through interface logs. For example, through machine learning or data mining algorithms, we can extract valuable information from massive logs to provide support for business optimization.
[0081] This embodiment accurately obtains and analyzes the identity of the requester of the data object, and then identifies the main user groups and their behavior patterns. This not only provides a strong basis for product optimization and market strategy formulation, but also enhances the depth and breadth of user analysis. Combined with link tracking and intelligent analysis technology, the system can deeply mine valuable information in the interface log, provide more accurate data support for business decision-making, and further improve business efficiency and user satisfaction.
[0082] It should be noted that, under the condition that the technology is feasible and the logic is clear, the above embodiments can be combined in pairs or in multiple combinations.
[0083] For example, refer to Figure 3 , Figure 3 This is a flow chart of the interface call log analysis method of this application. Assume that there is a large e-commerce platform whose microservice architecture includes multiple core services such as order service, inventory service, and payment service. The interface call links between these services are complex. In order to ensure the stability of the system and user experience, the platform decides to use this application to record and analyze the interface call link log. The platform first initializes the system, that is, introduces the toolkit provided by the present invention into each microservice. After the toolkit captures each service request, it extracts key information (such as request path, request parameters, response status code, response content, etc.) and formats it. Then, according to the platform business scale and data volume, Elasticsearch (a highly scalable distributed full-text retrieval engine) is selected as the log storage database to ensure efficient log retrieval and analysis capabilities. After saving, the system can visualize the log, and users or developers can intuitively see the stored log data. It is also possible to intuitively see the call link, call time and response status of each service through the interface query method. In order to further optimize the user experience and improve business efficiency, the platform also introduces the intelligent analysis of this application. By collecting and analyzing user access logs, we can identify frequently purchased products and user groups, providing strong support for subsequent personalized recommendations and promotional activities. More importantly, intelligent analysis can identify abnormal situations by analyzing log data, such as interface call failures and long response times. If an abnormal situation is identified by intelligent analysis, it will notify the early warning monitoring to send optimization suggestions to the user. If there is no abnormal situation, the log analysis ends.
[0084] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the interface call log analysis method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0085] This application also provides an interface call log analysis device, please refer to Figure 4 , which is set in the microservice where the interface call log analysis toolkit is installed, and the interface call log analysis device includes: The log collection module 10 intercepts the service request of the interface requesting the microservice based on the filter in the interface call log analysis toolkit, and parses the service information of the intercepted service request; A log format module 20 converts the service information into log data based on a preset log format; The log collection module 30 obtains demand information input from the outside, configures a collection strategy for the log data according to the demand information, and collects target log data in the log data according to the configured collection strategy, wherein the collection strategy includes at least one of collecting by time interval, collecting by log size, collecting by log level, collecting by request path, and collecting by user identity; The log analysis module 40 stores the target log data in a preset database, determines a data set consisting of a plurality of target log data in the database, and performs anomaly detection on the data set, wherein the database includes at least one of a relational database and a Nosql database; The log warning module 50 outputs a preset warning message if the abnormality detection result is that an abnormality exists.
[0086] The interface call log analysis device provided by the present application adopts the interface call log analysis method in the above embodiment, which can solve the technical problem of high complexity in the deployment and configuration of log analysis tools. Compared with the prior art, the beneficial effects of the interface call log analysis device provided by the present application are the same as the beneficial effects of the interface call log analysis method provided by the above embodiment, and other technical features in the interface call log analysis device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0087] The present application provides an interface call log analysis device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the interface call log analysis method in the above-mentioned embodiment one.
[0088] Reference below Figure 5, which shows a schematic diagram of the structure of an interface call log analysis device suitable for implementing the embodiment of the present application. The interface call log analysis device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The interface call log analysis device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0089] like Figure 5 As shown, the interface call log analysis device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the interface call log analysis device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the interface call log analysis device to communicate wirelessly or wired with other devices to exchange data. Although the interface call log analysis device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.
[0090] In particular, according to the embodiments disclosed in the present application, 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 application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0091] The interface call log analysis device provided by the present application adopts the interface call log analysis method in the above embodiment, which can solve the technical problem of high complexity in the deployment and configuration of log analysis tools. Compared with the prior art, the beneficial effects of the interface call log analysis device provided by the present application are the same as the beneficial effects of the interface call log analysis method provided by the above embodiment, and the other technical features in the interface call log analysis device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0092] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0093] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0094] The present application provides a storage medium, which is a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the interface call log analysis method in the above-mentioned embodiment.
[0095] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, 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: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0096] The computer-readable storage medium may be included in the interface call log analysis device; or may exist independently without being assembled into the interface call log analysis device.
[0097] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the interface calling the log analysis device, the interface calls the log analysis device: The preset data synchronization tool is packaged into an image through the container platform, and the container instance corresponding to the image is created through the container orchestration platform cluster. The container instance is the smallest deployment computing unit in the container orchestration platform. If the actual business requirements input from the outside are obtained, a description file corresponding to the actual business requirements is generated, and the description information in the description file is stored in the mapping file of the container orchestration platform to obtain a target mapping file; Generate a configuration file based on the target mapping file, and run the data synchronization task corresponding to the configuration file in the container instance; When the data synchronization task is running, obtaining a performance indicator of the container instance, and comparing the performance indicator with a first preset threshold and a second preset threshold respectively, wherein the first preset threshold is greater than the second preset threshold; If the performance indicator is greater than the first preset threshold, the container instance is expanded; If the performance indicator is less than the second preset threshold, the container instance is scaled down.
[0098] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0099] 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 application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the 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 square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / 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.
[0100] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0101] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned interface call log analysis method, and can solve the technical problem of high complexity in the deployment and configuration of log analysis tools. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the interface call log analysis method provided by the above-mentioned embodiment, and will not be elaborated here.
[0102] The present application also provides a computer program product, including a computer program, which implements the steps of the interface calling log analysis method as described above when the computer program is executed by a processor.
[0103] The computer program product provided by this application can solve the technical problem of high complexity in the deployment and configuration of log analysis tools. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the interface call log analysis method provided by the above embodiment, which will not be repeated here.
[0104] The above are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.
Claims
1. An interface call log analysis method, characterized in that: Applied to a microservice that has an interface call log analysis toolkit installed, the interface call log analysis method includes: Intercept the service request of the interface of the microservice based on the filter in the interface call log analysis toolkit, and parse the service information of the intercepted service request; Converting the service information into log data based on a preset log format; Obtaining demand information input from the outside, configuring a collection strategy for the log data according to the demand information, and collecting target log data in the log data according to the configured collection strategy, wherein the collection strategy includes at least one of collecting by time interval, collecting by log size, collecting by log level, collecting by request path, and collecting by user identity; The target log data is stored in a preset database, and a data set consisting of a plurality of target log data in the database is determined, and anomaly detection is performed on the data set, wherein the database includes at least one of a relational database and a Nosql database; If the abnormality detection result shows that an abnormality exists, the preset warning information is output.
2. The interface call log analysis method according to claim 1, characterized in that: The step of collecting target log data in the log data according to the configured collection strategy includes: If the collection strategy is to collect at a time interval, determine a scheduled task corresponding to the collection strategy, and collect target log data in the log data according to the scheduled task, wherein the scheduled task includes collecting log data based on a preset time interval; If the collection strategy is to collect by log size, then detecting whether the storage data volume of the log data is greater than a preset storage data volume threshold, and if it is greater than the preset storage data volume threshold, collecting the log data as target log data; If the collection strategy is to collect by log level, the log data that meets the preset log level is collected as the target log data; If the collection strategy is to collect by request path, the log data satisfying the preset request path is collected as target log data; If the collection strategy is to collect by user identity, the log data that meets the preset user identity will be collected as target log data.
3. The interface call log analysis method according to claim 1, characterized in that: The step of storing the target log data in a preset database comprises: If the number of the service requests within a preset time period is less than a preset threshold, the target log data is saved to a relational database; If the number of the service requests within a preset time period is greater than or equal to a preset threshold, the target log data is saved to a Nosql database.
4. The interface call log analysis method according to claim 1, characterized in that: The step of performing anomaly detection on the data set comprises: Divide the data set into different data groups according to the interface, and use each target log data in each data group as a data object; wherein each interface corresponds to one data group; If the data object meets the preset abnormal condition, the data object is marked as an abnormal log, and the abnormality detection result is determined to be abnormal.
5. The interface call log analysis method according to claim 4, characterized in that: After the step of taking each target log data in each data group as a data object, the method further includes: For each data group, if the number of data objects within a preset time range is greater than a preset service request number threshold, it is determined that the data objects within the preset time range meet a preset abnormal condition; and / or, Determining the data objects corresponding to the service request in the failed state in the data group, if the number of the data objects corresponding to the service request in the failed state is greater than a preset failure number threshold, determining that the data objects corresponding to the service request in the failed state meet a preset abnormal condition; and / or, Determine the return parameter corresponding to each data object in the data group, and if there is a target return parameter containing preset specific characters in each of the return parameters, determine that the data object corresponding to the target return parameter meets the preset abnormal condition.
6. The interface call log analysis method according to claim 4, characterized in that: After the step of taking each target log data in each data group as a data object, the method further includes: obtaining the identity of the requester of the data object; A user behavior analysis is performed according to the requester identity, wherein the user behavior analysis includes determining a user group according to the requester identity that appears most frequently in each data group.
7. An interface call log analysis device, characterized in that: The microservice is configured to install an interface call log analysis toolkit, and the interface call log analysis device includes: A log collection module, which intercepts the service request of the interface requesting the microservice based on the filter in the interface call log analysis toolkit, and parses the service information of the intercepted service request; A log format module, which converts the service information into log data based on a preset log format; a log collection module, which obtains demand information inputted from the outside, configures a collection strategy for the log data according to the demand information, and collects target log data in the log data according to the configured collection strategy, wherein the collection strategy includes at least one of collecting by time interval, collecting by log size, collecting by log level, collecting by request path, and collecting by user identity; A log analysis module stores the target log data in a preset database, determines a data set consisting of a plurality of target log data in the database, and performs anomaly detection on the data set, wherein the database includes at least one of a relational database and a Nosql database; The log warning module outputs the preset warning information if the anomaly detection result is an anomaly.
8. An interface call log analysis device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the interface call log analysis method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the interface call log analysis method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the interface call log analysis method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Method, device and equipment for collecting logs and readable storage medium
CN109491881A
Log management method and device
CN113094348A
Interface abnormal behavior monitoring method, system and device and storage medium
CN114969738A
Log recording method and device, computer equipment and computer readable storage medium
CN116431443A
Log management method and device, electronic equipment and storage medium
CN116841975A
Cited By
Log processing method and device based on ternary management system
CN119621695A
Systems and methods for log tracing and monitoring specific data in distributed service systems
TWI929772B
