Interface call monitoring method and device, electronic equipment and storage medium
By aggregating and splitting client interface data, combined with database storage and retrieval, the problem of insufficient accuracy in interface call monitoring in existing technologies has been solved, and efficient and standardized interface monitoring data acquisition and display have been achieved.
Patent Information
- Application Number
- CN202211249874.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-12
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2042-10-12
AI Technical Summary
Existing technologies cannot effectively monitor the API calls made by client applications, resulting in insufficient accuracy in data monitoring.
By obtaining data processing instructions, the system extracts target runtime data, aggregates and splits the data based on preset dimensions, stores it in the target database, and retrieves the data according to user request instructions to generate interface monitoring data.
It improved the accuracy and efficiency of monitoring data acquisition, and achieved standardized and visual display of interface monitoring data.
Smart Images

Figure CN115576775B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data security technology, and in particular to an interface call monitoring method and apparatus, electronic device and storage medium. Background Technology
[0002] Currently, when monitoring the operation of client applications, it is often difficult to effectively monitor and process the interfaces called by the application, which affects the accuracy of data monitoring. Therefore, how to improve the accuracy of data monitoring has become an urgent technical problem to be solved. Summary of the Invention
[0003] The main objective of this application is to provide an interface call monitoring method, device, electronic device, and storage medium, aiming to improve the accuracy of data monitoring.
[0004] To achieve the above objectives, a first aspect of this application proposes an interface call monitoring method, applied to the server side, the method comprising:
[0005] Obtain data processing instructions;
[0006] The target runtime data is extracted according to the data processing instructions, wherein the target runtime data is the interface data generated by the target client during runtime;
[0007] The target operation data is aggregated based on a preset first data dimension to obtain the first monitoring indicator data.
[0008] The target operation data is split based on a preset second data dimension to obtain second monitoring indicator data.
[0009] Store the first monitoring indicator data and the second monitoring indicator data in the target database;
[0010] Obtain user request instructions;
[0011] Based on the user request command and preset query conditions, data is retrieved from the target database to obtain target interface monitoring data.
[0012] In some embodiments, extracting target runtime data according to the data processing instructions includes:
[0013] Based on the data processing instructions, initial running data is collected from the target client;
[0014] Based on preset control components, the initial operating data is processed to obtain key operating data;
[0015] The critical runtime data is stored in a preset message cache queue, which includes a message processing component;
[0016] The target running data is obtained by asynchronously processing the key running data through the message processing component.
[0017] In some embodiments, the step of aggregating the target operational data based on a preset first data dimension to obtain first monitoring indicator data includes:
[0018] The target running data is aggregated based on a preset aggregation function and the first data dimension to obtain multiple initial aggregated data.
[0019] Generate column names for each of the initial aggregated data to obtain aggregated column names;
[0020] The first monitoring metric data is obtained based on the aggregated column name and the initial aggregated data.
[0021] In some embodiments, the step of splitting the target operational data based on a preset second data dimension to obtain second monitoring indicator data includes:
[0022] Obtain preset splitting parameters, including the maximum data memory parameter;
[0023] Based on the second data dimension and the maximum data memory parameter, the target running data is split into multiple data fragments;
[0024] The splicing order of the data segments is determined based on their size.
[0025] The data segments are merged according to the splicing order to obtain the second monitoring indicator data.
[0026] In some embodiments, the step of retrieving data from the target database based on the user request instruction and preset query conditions to obtain target interface monitoring data includes:
[0027] The total number of requests is obtained by counting the number of user request commands within a preset time period.
[0028] Extract the query fields and query formula from the query conditions;
[0029] Based on the total number of requests, the query fields, and the query formula, data is retrieved from the target database to obtain the target interface monitoring data.
[0030] In some embodiments, after retrieving data from the target database according to the user request instruction and preset query conditions to obtain target interface monitoring data, the method includes:
[0031] Anomaly analysis is performed on the target interface monitoring data based on preset reference interface data to obtain analysis results;
[0032] If the analysis result indicates that there is an anomaly in the target interface monitoring data, an alarm message is generated based on the analysis result and sent to the target object.
[0033] In some embodiments, after retrieving data from the target database according to the user request instruction and preset query conditions to obtain target interface monitoring data, the method includes:
[0034] The target interface monitoring interface is obtained by laying out the target interface monitoring data based on the preset display template.
[0035] The target monitoring interface is displayed to the target object.
[0036] To achieve the above objectives, a second aspect of this application provides an interface call monitoring device applied to a server, the device comprising:
[0037] The instruction acquisition module is used to acquire data processing instructions;
[0038] The data extraction module is used to extract target runtime data according to the data processing instructions, wherein the target runtime data is interface data generated by the target client during runtime;
[0039] The data aggregation module is used to aggregate the target running data based on a preset first data dimension to obtain first monitoring indicator data;
[0040] The data splitting module is used to split the target running data based on a preset second data dimension to obtain second monitoring indicator data.
[0041] The data storage module is used to store the first monitoring indicator data and the second monitoring indicator data into the target database;
[0042] The request retrieval module is used to retrieve user request instructions;
[0043] The data retrieval module is used to retrieve data from the target database according to the user request command and preset query conditions to obtain target interface monitoring data.
[0044] To achieve the above objectives, a third aspect of the present application provides an electronic device, the electronic device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method described in the first aspect.
[0045] To achieve the above objectives, a fourth aspect of the present application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect.
[0046] The interface call monitoring method, device, electronic equipment, and storage medium proposed in this application acquire data processing instructions; extract target operational data (interface data generated by the target client during runtime) based on these instructions; aggregate the target operational data based on a preset first data dimension to obtain first monitoring indicator data; and split the target operational data based on a preset second data dimension to obtain second monitoring indicator data. This allows for convenient aggregation and splitting of target operational data across different data dimensions, thereby improving the rationality and standardization of the monitoring indicator data. Furthermore, storing the first and second monitoring indicator data in a target database ensures standardized storage of the monitoring indicator data and facilitates data extraction and retrieval. Finally, the application acquires user request instructions; retrieves data from the target database based on the user request instructions and preset query conditions to obtain target interface monitoring data. This facilitates convenient retrieval of interface monitoring data, allowing for the extraction of the required target interface monitoring data from the target database based on query conditions, improving the efficiency and accuracy of monitoring data acquisition, and thus enhancing the accuracy of data monitoring. Attached Figure Description
[0047] Figure 1 This is a flowchart of the interface call monitoring method provided in the embodiments of this application;
[0048] Figure 2 yes Figure 1 The flowchart of step S102 in the document;
[0049] Figure 3 yes Figure 1 The flowchart of step S103 in the process;
[0050] Figure 4 yes Figure 1 The flowchart of step S104 in the process;
[0051] Figure 5 yes Figure 1 The flowchart of step S107 in the process;
[0052] Figure 6 This is another flowchart of the interface call monitoring method provided in the embodiments of this application;
[0053] Figure 7 This is another flowchart of the interface call monitoring method provided in the embodiments of this application;
[0054] Figure 8 This is a schematic diagram of the interface call monitoring device provided in the embodiments of this application;
[0055] Figure 9 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0056] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0057] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0058] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0059] First, let's analyze some of the terms used in this application:
[0060] Artificial intelligence (AI) is a new branch of computer science that studies, develops, and applies theories, methods, technologies, and systems to simulate, extend, and expand human intelligence. It aims to understand the essence of intelligence and produce intelligent machines that can react in a way similar to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing, and expert systems. AI can simulate the information processes of human consciousness and thought. Furthermore, AI utilizes digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceiving the environment, acquiring knowledge, and using that knowledge to achieve optimal results.
[0061] Natural Language Processing (NLP): NLP uses computers to process, understand, and utilize human language (such as Chinese and English). NLP is a branch of artificial intelligence and an interdisciplinary field of computer science and linguistics, often referred to as computational linguistics. NLP includes syntactic analysis, semantic analysis, and discourse understanding. It is commonly used in machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, intent recognition, information extraction and filtering, text classification and clustering, sentiment analysis, and opinion mining. It involves data mining, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research, and linguistic research related to language computation.
[0062] Information Extraction (NER) is a text processing technique that extracts factual information such as entities, relationships, and events from natural language text and outputs it as structured data. Information extraction is a technique for extracting specific information from text data. Text data is composed of specific units, such as sentences, paragraphs, and chapters. Text information is composed of smaller, specific units, such as characters, words, phrases, sentences, paragraphs, or combinations of these units. Extracting noun phrases, names of people, and place names from text data is an example of text information extraction. Of course, text information extraction techniques can extract information of various types.
[0063] Third party: refers to an object outside of two interconnected subjects. A third party can be related to the two subjects or it can be something independent of the two subjects.
[0064] An interface is a general term for an entity's provision of itself to the outside world (which can be another entity). It separates internal operations from external communication methods, allowing internal modifications without affecting how other entities interact with it. The interface between humans and information machines like computers, or between humans and programs, is called a user interface. The interface between hardware components of computers and other information machines is called a hardware interface. The interface between software components of computers and other information machines is called a software interface. In computers, an interface is the shared boundary for information exchange between two independent components. This exchange can occur between computer hardware and software, external devices, or the person performing the operation, or a combination of these.
[0065] A thread is the smallest unit of computation that an operating system can schedule. It is contained within a process and is the actual unit of operation within that process. A thread refers to a single, sequential flow of control within a process. Multiple threads can run concurrently within a process, each executing different tasks in parallel. In Unix System V and SunOS, they are also called lightweight processes, but "lightweight process" more often refers to kernel threads, while user threads are simply called threads. A process can have many threads, each executing different tasks in parallel.
[0066] Hadoop is a distributed system infrastructure. Users can develop distributed programs without understanding the underlying details of distributed systems. It fully leverages the power of clusters for high-speed computing and storage. Hadoop implements a distributed file system.
[0067] Kafka is an open-source stream processing platform. It's a high-throughput, distributed publish-subscribe messaging system that can handle streaming data of all consumer actions on a website. These actions (web browsing, searching, and other user actions) are a key element of many social functions on the modern web. This data is typically handled through log processing and log aggregation due to throughput requirements. Kafka aims to unify online and offline message processing through Hadoop's parallel loading mechanism, and also to provide real-time messaging through clusters.
[0068] Events: Events represent facts that occurred in the past. Events are immutable and do not remain in one place. They always carry the state changes that have occurred from one system to another.
[0069] Streams: Event streams identify related events in system business activities.
[0070] Topics: When an event stream enters Kafka, it is persisted as a topic. In Kafka, a topic is a materialized stream of events. Topics groups group related events together and persist them. A topic in Kafka can be compared to a table in a database or a folder in a file system.
[0071] Partition: In Kafka, a topic is divided into multiple partitions. A topic in Kafka is a logical concept, and a partition is the smallest unit of storage, storing a subset of messages from a topic. Each partition is a log file, and messages are written to it in an append-only manner.
[0072] Currently, when monitoring the operation of client applications, it is often difficult to effectively monitor and process the interfaces called by the application. For example, it is impossible to personalize the display of monitoring indicators or perform data analysis, which affects the accuracy of data monitoring. Therefore, how to improve the accuracy of data monitoring has become an urgent technical problem to be solved.
[0073] Based on this, embodiments of this application provide an interface call monitoring method, an interface call monitoring device, an electronic device, and a storage medium, aiming to improve the accuracy of data monitoring.
[0074] The interface call monitoring method, interface call monitoring device, electronic device and storage medium provided in the embodiments of this application are specifically described through the following embodiments. First, the interface call monitoring method in the embodiments of this application is described.
[0075] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0076] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0077] The interface call monitoring method provided in this application relates to the field of artificial intelligence technology. This method can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application implementing the interface call monitoring method, but is not limited to the above forms.
[0078] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0079] Figure 1 This is an optional flowchart of the interface call monitoring method provided in the embodiments of this application, applied to the server side. Figure 1 The method may include, but is not limited to, steps S101 to S107.
[0080] Step S101: Obtain data processing instructions;
[0081] Step S102: Extract target runtime data according to data processing instructions, wherein the target runtime data is the interface data generated by the target client during runtime;
[0082] Step S103: Aggregate the target running data based on the preset first data dimension to obtain the first monitoring indicator data;
[0083] Step S104: Based on the preset second data dimension, the target running data is split to obtain the second monitoring indicator data;
[0084] Step S105: Store the first monitoring indicator data and the second monitoring indicator data in the target database;
[0085] Step S106: Obtain the user request instruction;
[0086] Step S107: Based on the user request command and preset query conditions, data retrieval is performed on the target database to obtain target interface monitoring data.
[0087] Steps S101 to S107 of this embodiment involve obtaining data processing instructions; extracting target runtime data (interface data generated by the target client during runtime) according to the instructions; aggregating the target runtime data based on a preset first data dimension to obtain first monitoring indicator data; and splitting the target runtime data based on a preset second data dimension to obtain second monitoring indicator data. This approach facilitates aggregation and splitting of target runtime data across different data dimensions, thereby improving the rationality and standardization of the monitoring indicator data. Furthermore, storing the first and second monitoring indicator data in a target database ensures standardized storage of the monitoring indicator data and facilitates data extraction and retrieval. Finally, obtaining user request instructions and retrieving data from the target database based on the user request instructions and preset query conditions yields target interface monitoring data. This approach facilitates easy retrieval of interface monitoring data and extracts the required target interface monitoring data from the target database based on the query conditions, improving the efficiency and accuracy of data acquisition and thus enhancing the accuracy of data monitoring.
[0088] In step S101 of some embodiments, data processing instructions can be obtained directly from the server. These instructions can be issued by the target object on the operating platform. The target object includes users, staff, etc.
[0089] It should be noted that the aforementioned server can be a third-party interface call monitoring platform. This server can collect runtime data generated by the target client's application during runtime, enabling real-time monitoring of different applications. Simultaneously, based on key business and component data analysis, it can generate interface monitoring data and generate monitoring alerts based on the interface monitoring data. This server may include a database, a display platform, and a message cache queue containing message processing components. The database is used to store the processed application runtime data, and the message cache queue is used to collect and temporarily store runtime data from different applications.
[0090] Please see Figure 2In some embodiments, step S102 may include, but is not limited to, steps S201 to S204:
[0091] Step S201: Based on the data processing instructions, collect initial running data from the target client;
[0092] Step S202: Based on the preset control components, perform data development on the initial operating data to obtain key operating data;
[0093] Step S203: Store key runtime data in a preset message cache queue, which includes a message processing component;
[0094] Step S204: The key running data is processed asynchronously by the message processing component to obtain the target running data.
[0095] In step S201 of some embodiments, according to the data processing instruction, the function code of the data acquisition module is called to collect the initial running data of the target client in a non-intrusive manner. The initial running data includes the number of worker threads in the thread pool, the number of surviving threads, the number of waiting queues, and interface performance data, etc. The target client includes different types of applications, etc. The non-intrusive manner means that the function code of the server used for data acquisition is different from the basic business code of the server, and there is no correlation between the two. This ensures that when the monitoring function is implemented based on the data acquisition function code, it will not affect the implementation of the basic business function of the server, thereby improving the functional independence of the server.
[0096] In step S202 of some embodiments, the preset control component may be a monitoring interface such as spring-boot-starter-actuator. Based on this monitoring interface, anomaly detection and content recognition can be performed on the initial running data to obtain key indicators of the target client's application, such as the application's memory information, thread information, and recycling information, thereby using the application's memory information and thread information as key running data.
[0097] In step S203 of some embodiments, key runtime data is stored in a preset message cache queue using a preset script program, etc. This message cache queue is mainly used to temporarily store the collected key runtime data. Further, the message cache queue includes a message processing component, which can be Kafka, Redis middleware, or others, without limitation.
[0098] In step S204 of some embodiments, the key operational data is classified by the message processing component to form multiple different data sets. Then, the key operational data is processed by data set deduplication and data cleaning to obtain the target operational data, which is the interface data generated by the target client during runtime.
[0099] Taking Kafka as an example of a message processing component, key runtime data can be categorized using Kafka topics. Since Kafka itself supports batch processing of messages, key runtime data can be processed quickly, improving data processing efficiency. Specifically, different topics are created based on the data type of the key runtime data. When Kafka creates a topic, multiple partitions (equivalent to multiple threads) can be allocated to concurrently process the key runtime data of the same topic to obtain the target runtime data.
[0100] Through the above steps S201 to S204, the running data of different applications of the target client can be obtained relatively easily, and the generated running data can be cached to improve the storage security of the data and avoid data loss. At the same time, the running data can be developed and processed based on the preset control components, which can improve the extraction efficiency of key data and reduce the impact of the data development process on the normal operation of the application.
[0101] Please see Figure 3 In some embodiments, step S103 may include, but is not limited to, steps S301 to S303:
[0102] Step S301: Aggregate the target running data based on the preset aggregation function and the first data dimension to obtain multiple initial aggregated data;
[0103] Step S302: Generate column names for each initial aggregated data to obtain aggregated column names;
[0104] Step S303: Obtain the first monitoring metric data based on the aggregated column name and the initial aggregated data.
[0105] In step S301 of some embodiments, the data aggregation process can rely on Spark. Spark converts the received target running data into a string. The preset aggregation function can be a select function, etc. The first data dimension can be data aggregation on the same interface metric within a certain time period, data aggregation on multiple different interface metrics at the same time, or other data dimensions, not limited to these. Using the aggregation function and the first data dimension, the target running data in string form is grouped, and then the contents of the function's independent variable in each group are aggregated to obtain multiple initial aggregated data.
[0106] In step S302 of some embodiments, the grouping key of the initial aggregated data is extracted by the group function to obtain the grouping key, and the grouping key is used as the aggregation column name of each initial aggregated data.
[0107] In step S303 of some embodiments, the aggregated column names and the corresponding initial aggregated data are combined to form the first monitoring indicator data.
[0108] Through the above steps S301 to S303, the target operation data can be aggregated and processed more easily on different data dimensions to generate the first monitoring indicator data, thereby improving the data rationality and data standardization of the monitoring indicator data.
[0109] Please see Figure 4 In some embodiments, step S104 may include, but is not limited to, steps S401 to S404:
[0110] Step S401: Obtain the preset splitting parameters, including the maximum data memory parameter;
[0111] Step S402: Based on the second data dimension and the maximum data memory parameter, the target running data is split into multiple data fragments;
[0112] Step S403: Determine the splicing order of the data segments based on their size;
[0113] Step S404: Merge the data segments according to the splicing order to obtain the second monitoring indicator data.
[0114] In step S401 of some embodiments, the splitting parameters can be preset according to actual business needs. In specific applications, the preset splitting parameters can be directly called through script programs, etc. These splitting parameters include the maximum data memory parameter. For example, the maximum data memory parameter is 4MB, which means that the memory size of the data fragments obtained by splitting the target running data should not exceed 4MB.
[0115] In step S402 of some embodiments, the second data dimension can be data splitting of the same interface metric within a certain time period, data splitting of multiple different interface metric at the same time, or other data dimensions, not limited to these. Based on the second data dimension and the maximum data memory parameter, different types of target running data are split into multiple data fragments. The memory size of these data fragments can be the same or different, but the memory size of all data fragments does not exceed the maximum data memory parameter.
[0116] In step S403 of some embodiments, the data segments are sorted in ascending order of data memory size to obtain the splicing order of the data segments.
[0117] In step S404 of some embodiments, the data segments are spliced sequentially according to the splicing order, thereby merging all the data segments together to generate the second monitoring indicator data.
[0118] Through the above steps S401 to S404, the target operation data can be easily split and processed in different data dimensions to generate second monitoring indicator data, thereby improving the data rationality and data standardization of the monitoring indicator data.
[0119] In step S105 of some embodiments, the first monitoring indicator data and the second monitoring indicator data are stored in a preset target database using a preset script program, etc. This target database is mainly used for long-term storage of the collected monitoring indicator data. This method can achieve standardized storage of monitoring indicator data and also facilitates data extraction and data retrieval.
[0120] In step S106 of some embodiments, a user request instruction can be directly obtained from the server. This user request instruction can be issued by the target user on the operating platform. This user request instruction is mainly used by the target user to query monitoring data by calling the monitoring method through the server and the interface of this embodiment, which can improve the accuracy and real-time performance of the interface-called monitoring.
[0121] Please see Figure 5 In some embodiments, step S107 may include, but is not limited to, steps S501 to S503:
[0122] Step S501: Count the number of user request commands within a preset time period to obtain the total number of requests;
[0123] Step S502: Extract the query fields and query formula from the query conditions;
[0124] Step S503: Based on the total number of requests, query fields, and query query, perform data retrieval on the target database to obtain target interface monitoring data.
[0125] In step S501 of some embodiments, the number of user request commands within a preset time period is counted based on a preset timer, statistical function or script program to obtain the total number of requests. The preset time period can be set according to actual business needs and is not limited. For example, the preset time period is 1 hour or from 9 o'clock to 12 o'clock, etc.
[0126] In step S502 of some embodiments, the query conditions are parsed using a script or query tool to obtain the query fields and query formulas. The query fields can be keywords pre-defined based on business experience, such as worker thread count, idle thread count, and memory usage. The query formulas can be constructed using simple logical functions or formulas, such as AND and OR operators. It should be noted that different query fields and query formulas are set for different interface monitoring metrics in the target database. This approach allows for the configuration of different query syntaxes to display different target interface monitoring data when the page is displayed on the display platform.
[0127] In step S503 of some embodiments, the target database is traversed based on the total number of requests m, the query fields and the query formula. The query fields and the query formula are entered, the target database is traversed m times, all the retrieved interface monitoring indicators are extracted, and these interface monitoring indicators are used as target interface monitoring data.
[0128] Through the above steps S501 to S503, data retrieval of interface monitoring data can be achieved relatively easily. The required target interface monitoring data can be extracted from the target database according to the query conditions, thereby improving the efficiency and accuracy of monitoring data acquisition.
[0129] Please see Figure 6 In some embodiments, after step S107, the interface call monitoring method further includes, but is not limited to, steps S601 to S602:
[0130] Step S601: Perform anomaly analysis on the target interface monitoring data based on preset reference interface data to obtain analysis results;
[0131] Step S602: If the analysis result indicates that there is an anomaly in the target interface monitoring data, an alarm message is generated based on the analysis result and sent to the target object.
[0132] In step S601 of some embodiments, reference interface data is obtained. This reference interface data may be stored historical interface data, including interface monitoring data acquired within a certain period of time in the past. The target interface monitoring data is compared with the reference interface data. Error calculation is performed on each monitoring indicator in the target interface monitoring data and the reference monitoring indicator in the reference interface data to obtain monitoring indicator error data. If the monitoring indicator error data is within a preset error range, it indicates that there is no anomaly in the target interface monitoring data; if the monitoring indicator error data is not within the preset error range, it indicates that there is anomaly in the target interface monitoring data. Based on the anomaly analysis, an analysis result is generated. This analysis result includes whether the target interface monitoring data is abnormal or not. When the target interface monitoring data is abnormal, corresponding anomaly data is also generated.
[0133] In step S602 of some embodiments, if the analysis result indicates that there is an anomaly in the target interface monitoring data, the server can generate alarm information, which includes the specific abnormal interface and the abnormal content. Furthermore, the server can send alarm information to the target object via email or SMS to remind the target object to check the interface and adjust the working parameters of the interface, etc. Here, the interface is the application of the target client, and the target object can be a user or staff member, etc.
[0134] For example, a request volume threshold is set for a third-party interface A (i.e., application A). The threshold is 100, with an error range of ±10. This means the reference interface data shows a request volume of 100, with an error range of 90 to 110. If the current request volume for third-party interface A is 80, it indicates an anomaly in the target interface monitoring data for third-party interface A, specifically an excessively low request volume. In this case, the server can send an alert via email or SMS to notify relevant personnel to confirm the anomaly, monitor the interface performance of third-party interface A, and adjust the request volume of third-party interface A, etc.
[0135] Through the above steps S601 to S602, it is relatively convenient to perform anomaly analysis on the target interface monitoring data, generate analysis results, determine whether there is an interface anomaly on the target client based on the analysis results, and generate alarm information based on the interface in an abnormal state to remind relevant personnel to conduct anomaly investigation and interface optimization, thereby achieving the operational security of the target client and the timeliness of anomaly handling.
[0136] Please see Figure 7 After step S107 in some embodiments, the interface call monitoring method may also include, but is not limited to, steps S701 to S702:
[0137] Step S701: Based on the preset display template, the target interface monitoring data is laid out to obtain the target monitoring interface;
[0138] Step S702: Display the target monitoring interface to the target object.
[0139] In step S701 of some embodiments, a preset display template is obtained from the layout interface template library. This display template is a UI interface, which can be used to display images, text, etc. It makes text, images, etc., visible so that the target object can observe them. The target object can be an observer, a target user, or other personnel, etc., without limitation. Specifically, different display templates can be selected according to the data type of the target interface monitoring data. The target interface monitoring data is imported into the selected display template to generate the target monitoring interface.
[0140] In step S702 of some embodiments, the target monitoring interface is displayed on the server's display platform according to the user request instruction previously issued by the target object, so that the target object can conveniently view the current monitoring data and the running status of different applications, and realize the monitoring visualization of interface calls.
[0141] Through the above steps S701 to S702, the target interface monitoring data can be easily imported into the selected display template, the target monitoring interface can be generated, and the target monitoring interface can be displayed on the server's display platform. This allows the target object to easily view the current monitoring data and the running status of different applications, realizing the visualization of the target interface monitoring data and improving monitoring performance.
[0142] The interface call monitoring method of this application embodiment obtains data processing instructions; extracts target runtime data according to the data processing instructions, wherein the target runtime data is interface data generated by the target client during runtime; aggregates the target runtime data based on a preset first data dimension to obtain first monitoring indicator data; and splits the target runtime data based on a preset second data dimension to obtain second monitoring indicator data. This method can conveniently achieve aggregation and splitting of target runtime data on different data dimensions, thereby improving the rationality and standardization of monitoring indicator data. Furthermore, storing the first and second monitoring indicator data in a target database ensures the standardization of monitoring indicator data storage and facilitates data extraction and retrieval. Finally, it obtains user request instructions; retrieves data from the target database according to the user request instructions and preset query conditions to obtain target interface monitoring data. This method can conveniently achieve data retrieval of interface monitoring data, extracting the required target interface monitoring data from the target database according to the query conditions, improving the efficiency and accuracy of monitoring data acquisition, thereby improving the accuracy of data monitoring.
[0143] Please see Figure 8 This application also provides an interface call monitoring device that can implement the above-mentioned interface call monitoring method. The device includes:
[0144] Instruction acquisition module 801 is used to acquire data processing instructions;
[0145] The data extraction module 802 is used to extract target runtime data according to data processing instructions, wherein the target runtime data is the interface data generated by the target client during runtime;
[0146] Data aggregation module 803 is used to aggregate target running data based on a preset first data dimension to obtain first monitoring indicator data;
[0147] The data splitting module 804 is used to split the target running data based on a preset second data dimension to obtain the second monitoring indicator data.
[0148] Data storage module 805 is used to store the first monitoring indicator data and the second monitoring indicator data into the target database;
[0149] The request retrieval module 806 is used to retrieve user request instructions;
[0150] The data retrieval module 807 is used to retrieve data from the target database based on user request instructions and preset query conditions to obtain target interface monitoring data.
[0151] In some embodiments, the data extraction module 802 includes:
[0152] The data acquisition unit is used to collect initial running data from the target client based on data processing instructions;
[0153] The data development unit is used to develop data from initial operating data based on preset control components to obtain key operating data.
[0154] The runtime data storage unit is used to store critical runtime data into a preset message cache queue, which includes a message processing component.
[0155] The asynchronous processing unit is used to asynchronously process key runtime data through the message processing component to obtain the target runtime data.
[0156] In some embodiments, the data aggregation module 803 includes:
[0157] The aggregation unit is used to aggregate the target running data based on a preset aggregation function and a first data dimension to obtain multiple initial aggregated data.
[0158] The column name generation unit is used to generate column names for each initial aggregated data, thus obtaining the aggregated column names;
[0159] The processing unit is used to obtain the first monitoring indicator data based on the aggregated column name and the initial aggregated data.
[0160] In some embodiments, the data splitting module 804 includes:
[0161] The parameter acquisition unit is used to acquire preset splitting parameters, including the maximum data memory parameter;
[0162] Splitting unit, used to split the target running data into multiple data fragments based on the second data dimension and the maximum data memory parameter;
[0163] The sorting unit is used to determine the splicing order of data segments based on their size.
[0164] The merging unit is used to merge data segments according to the splicing order to obtain the second monitoring indicator data.
[0165] In some embodiments, the data retrieval module 807 includes:
[0166] The statistics unit is used to count the number of user request commands within a preset time period to obtain the total number of requests;
[0167] The extraction unit is used to extract the query fields and query expressions from the query conditions.
[0168] The retrieval unit is used to retrieve data from the target database based on the total number of requests, query fields, and query formulas to obtain target interface monitoring data.
[0169] In some embodiments, the interface call monitoring device further includes:
[0170] The analysis unit is used to perform anomaly analysis on the target interface monitoring data based on preset reference interface data and obtain analysis results.
[0171] The alarm unit is used to generate alarm information based on the analysis results if the target interface monitoring data is found to be abnormal, and then send the alarm information to the target object.
[0172] In some embodiments, the interface call monitoring device further includes:
[0173] The interface layout unit is used to lay out the target interface monitoring data based on a preset display template to obtain the target monitoring interface.
[0174] The display unit is used to present the target monitoring interface to the target object.
[0175] The specific implementation of this interface call to the monitoring device is basically the same as the specific implementation of the interface call to the monitoring method described above, and will not be repeated here.
[0176] This application also provides an electronic device, which includes: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for communication between the processor and the memory. When the program is executed by the processor, it implements the aforementioned interface call monitoring method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0177] Please see Figure 9 , Figure 9 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:
[0178] The processor 901 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.
[0179] The memory 902 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and is called and executed by the processor 901 using the interface call monitoring method of the embodiments of this application.
[0180] The input / output interface 903 is used to implement information input and output;
[0181] The communication interface 904 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0182] Bus 905 transmits information between various components of the device (e.g., processor 901, memory 902, input / output interface 903, and communication interface 904);
[0183] The processor 901, memory 902, input / output interface 903, and communication interface 904 are connected to each other within the device via bus 905.
[0184] This application also provides a computer-readable storage medium that stores one or more programs, which can be executed by one or more processors to implement the above-described interface call monitoring method.
[0185] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0186] The interface call monitoring method, device, electronic device, and computer-readable storage medium provided in this application embodiment acquire data processing instructions; extract target runtime data according to the data processing instructions, wherein the target runtime data is interface data generated by the target client during runtime; aggregate the target runtime data based on a preset first data dimension to obtain first monitoring indicator data; and split the target runtime data based on a preset second data dimension to obtain second monitoring indicator data. This allows for convenient aggregation and splitting of target runtime data across different data dimensions, thereby improving the rationality and standardization of the monitoring indicator data. Furthermore, storing the first and second monitoring indicator data in a target database ensures standardized storage of the monitoring indicator data and facilitates data extraction and retrieval. Finally, the application acquires user request instructions; retrieves data from the target database according to the user request instructions and preset query conditions to obtain target interface monitoring data. This facilitates convenient retrieval of interface monitoring data, extracts the required target interface monitoring data from the target database based on query conditions, improves the efficiency and accuracy of monitoring data acquisition, and thus enhances the accuracy of data monitoring.
[0187] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0188] It will be understood by those skilled in the art that Figure 1-7 The technical solutions shown do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0189] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0190] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0191] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0192] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0193] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0194] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0195] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0196] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0197] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A method for monitoring interface calls, characterized in that, Applied to the server side, the method includes: Obtain data processing instructions; The target runtime data is extracted according to the data processing instructions, wherein the target runtime data is the interface data generated by the target client during runtime; The target operation data is aggregated based on a preset first data dimension to obtain the first monitoring indicator data. The target operation data is split based on a preset second data dimension to obtain second monitoring indicator data. Store the first monitoring indicator data and the second monitoring indicator data in the target database; Obtain user request instructions; Based on the user request command and preset query conditions, data is retrieved from the target database to obtain target interface monitoring data; The first monitoring indicator data is obtained by aggregating the target operating data based on a preset first data dimension, including: The target running data is aggregated based on a preset aggregation function and the first data dimension to obtain multiple initial aggregated data; column names are generated for each initial aggregated data to obtain aggregated column names; and the first monitoring indicator data is obtained based on the aggregated column names and the initial aggregated data. The second monitoring indicator data is obtained by splitting the target operating data based on a preset second data dimension, including: Obtain preset splitting parameters, including a maximum data memory parameter; split the target running data into multiple data segments based on the second data dimension and the maximum data memory parameter; determine the splicing order of the data segments according to their data size; merge the data segments according to the splicing order to obtain the second monitoring indicator data.
2. The interface call monitoring method according to claim 1, characterized in that, The step of extracting target runtime data according to the data processing instructions includes: Based on the data processing instructions, initial running data is collected from the target client; Based on preset control components, the initial operating data is processed to obtain key operating data; The critical runtime data is stored in a preset message cache queue, which includes a message processing component; The target running data is obtained by asynchronously processing the key running data through the message processing component.
3. The interface call monitoring method according to claim 1, characterized in that, The step of retrieving data from the target database based on the user request instruction and preset query conditions to obtain target interface monitoring data includes: The total number of requests is obtained by counting the number of user request commands within a preset time period. Extract the query fields and query formula from the query conditions; Based on the total number of requests, the query fields, and the query formula, data is retrieved from the target database to obtain the target interface monitoring data.
4. The interface call monitoring method according to any one of claims 1 to 3, characterized in that, After retrieving data from the target database based on the user request instruction and preset query conditions to obtain target interface monitoring data, the method includes: Anomaly analysis is performed on the target interface monitoring data based on preset reference interface data to obtain analysis results; If the analysis result indicates that there is an anomaly in the target interface monitoring data, an alarm message is generated based on the analysis result and sent to the target object.
5. The interface call monitoring method according to any one of claims 1 to 3, characterized in that, After retrieving data from the target database based on the user request instruction and preset query conditions to obtain target interface monitoring data, the method includes: The target interface monitoring interface is obtained by laying out the target interface monitoring data based on the preset display template. The target monitoring interface is displayed to the target object.
6. An interface call monitoring device, characterized in that, The device, applied to the server side, includes: The instruction acquisition module is used to acquire data processing instructions; The data extraction module is used to extract target runtime data according to the data processing instructions, wherein the target runtime data is interface data generated by the target client during runtime; The data aggregation module is used to aggregate the target running data based on a preset first data dimension to obtain first monitoring indicator data; The data splitting module is used to split the target running data based on a preset second data dimension to obtain second monitoring indicator data. The data storage module is used to store the first monitoring indicator data and the second monitoring indicator data into the target database; The request retrieval module is used to retrieve user request instructions; The data retrieval module is used to retrieve data from the target database according to the user request instruction and preset query conditions to obtain target interface monitoring data; The first monitoring indicator data is obtained by aggregating the target operating data based on a preset first data dimension, including: The target running data is aggregated based on a preset aggregation function and the first data dimension to obtain multiple initial aggregated data; column names are generated for each initial aggregated data to obtain aggregated column names; and the first monitoring indicator data is obtained based on the aggregated column names and the initial aggregated data. The second monitoring indicator data is obtained by splitting the target operating data based on a preset second data dimension, including: Obtain preset splitting parameters, including a maximum data memory parameter; split the target running data into multiple data segments based on the second data dimension and the maximum data memory parameter; determine the splicing order of the data segments according to their data size; merge the data segments according to the splicing order to obtain the second monitoring indicator data.
7. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the interface call monitoring method as described in any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the interface call monitoring method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Real-time monitoring method and device and electronic equipment
CN112711515A
Data processing method and system, computer and readable storage medium
CN113220715A