Interface offline review method and device, computer equipment and storage medium
By automatically collecting and integrating the usage status of multi-class data detection interfaces, the problem of the existing interface downstream process relying on manual judgment and lack of comprehensiveness is solved, and faster, comprehensive and accurate downstream review of the interface is achieved, reducing the error rate and service interruption risk.
Patent Information
- Application Number
- CN202411837340.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-05-13
AI Technical Summary
The existing interface offline process relies on manual judgment and some automation tools, and there is a risk of relying on manual review and a lack of comprehensiveness, which may lead to omissions and inability to cover all potential dependencies.
By collecting and integrating inlet gateway data, interface log data, interface call chain data and source code scanning data, the usage status of the target offline interface is automatically detected, including whether there are other application code references, whether there are interface request records and requested records within the past preset time.
It improves the speed and comprehensiveness of the review of offline interfaces, reduces the error rate, reduces the risk of misjudgment caused by human factors, ensures that the negative impact of offline interfaces on the system is minimized, and the risk of service interruption is minimized as much as possible.
Smart Images

Figure CN119988178A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of lifecycle management of application programming interfaces, and in particular to an interface offline review method, apparatus, computer equipment and storage medium. Background Art
[0002] With the widespread application of microservice architecture, Application Programming Interface (API) has become an important part of the communication between different services. The lifecycle management of API has become particularly important, including the design, release, maintenance and final offline process of API. During the offline process of API, it is necessary to ensure that there will be no negative impact on the existing system, and at the same time, the risk of service interruption needs to be minimized.
[0003] Currently, most interface offline processes rely on manual inspection and testing, with the help of some automated tools. These solutions mainly include the following steps:
[0004] 1. Manual review: Developers or operations teams review the API documentation and code to confirm that the API can be safely taken offline.
[0005] 2. Dependency check: Use automated tools to check whether the application programming interface is depended on by other services.
[0006] 3. Traffic diversion: Gradually reduce the frequency of calls to this application programming interface before going offline until it is completely stopped.
[0007] Although the above solutions can ensure the security of API offline to a certain extent, they still have at least the following problems:
[0008] 1. Reliance on human judgment: Manual review and testing are easily influenced by personal experience and may lead to omissions.
[0009] 2. Lack of comprehensiveness: Dependency checking may not cover all potential dependency situations and there is no unified view. Summary of the invention
[0010] In view of the above-mentioned deficiencies or shortcomings, the present application provides an interface offline review method, apparatus, computer equipment and storage medium. The embodiments of the present application can improve the review speed and comprehensiveness of the interface offline review and reduce the error rate.
[0011] The present application provides an interface offline review method according to a first aspect. In some embodiments, the method includes:
[0012] Collect data related to ingress gateway request monitoring analysis, source code scanning analysis, log analysis, and call chain analysis, and integrate them to obtain ingress gateway data, interface log data, interface call chain data, and source code scanning data;
[0013] Determine the usage status of the target offline interface based on the ingress gateway data, interface log data, interface call chain data, and source code scanning data; the usage status of the target offline interface includes whether other application codes reference the target offline interface, and whether there are interface request records and requested records within the past preset time period;
[0014] The review result of the target offline interface is determined according to the usage status of the target offline interface.
[0015] In some embodiments, data related to ingress gateway request monitoring analysis, source code scanning analysis, log analysis, and call chain analysis are collected and integrated to obtain ingress gateway data, interface log data, interface call chain data, and source code scanning data, including:
[0016] Use a log collection tool to collect data related to the monitoring and analysis of ingress gateway requests on a network server, and obtain ingress gateway data based on the data related to the monitoring and analysis of ingress gateway requests;
[0017] Use code scanning tools to scan and synchronize the code submitted to the code repository to obtain data related to source code scanning analysis, and integrate the data related to source code scanning analysis to obtain source code scanning data;
[0018] Query the log data of the online interface from the log system to obtain data related to log analysis, and obtain interface log data based on the data related to log analysis;
[0019] Use a call chain analysis tool to collect data related to the call chain analysis, and obtain interface call chain data based on the data integration related to the call chain analysis.
[0020] In some embodiments, determining the usage status of the target offline interface according to the ingress gateway data, the interface log data, the interface call chain data, and the source code scanning data includes:
[0021] The first detection result and the second detection result are obtained based on the ingress gateway data, the interface log data and the interface call chain data; the first detection result and the second detection result respectively indicate whether there is an interface request record and a requested record for the target offline interface within the past preset time period;
[0022] The request path and request method of the target offline interface are globally retrieved based on the source code scanning data, and a third detection result is obtained based on the retrieval result. The third detection result indicates whether other application codes reference the target offline interface.
[0023] In some embodiments, determining the review result of the target offline interface according to the usage status of the target offline interface includes:
[0024] When the first detection result and the second detection result respectively indicate that there is no interface request record and no requested record for the target offline interface within the past preset time period, and the third detection result indicates that no other application code references the target offline interface, it is determined that the review result of the target offline interface is passed;
[0025] When the first detection result indicates that there is an interface request record for the target offline interface within the past preset time period, or the second detection result indicates that there is a requested record for the target offline interface within the past preset time period, or the third detection result indicates that other application codes have referenced the target offline interface, it is determined that the review result of the target offline interface is review failure.
[0026] In some embodiments, after determining the review result of the target offline interface according to the usage status of the target offline interface, the method further includes:
[0027] When the review result of the target offline interface is failure to pass the review, a repair plan is generated according to the usage status of the target offline interface.
[0028] In some embodiments, after the review result of the target offline interface is passed, the method further includes:
[0029] Notify the user to log off the target offline interface;
[0030] During the offline process of the target offline interface, the designated indicators are monitored in real time to see if there are any abnormalities; the offline process of the target offline interface includes multiple offline stages; the designated indicators include indicators related to system performance and / or indicators related to system stability;
[0031] When an abnormality occurs in a specified indicator, a target processing strategy is determined from pre-defined processing strategies based on the indicator type of the specified indicator and the current offline stage, and the target processing strategy is executed.
[0032] In some embodiments, after completing the offline process of the target offline interface, the method further includes:
[0033] Close the target offline interface;
[0034] Update the interface document related to the target offline interface according to the interface information of the new interface corresponding to the target offline interface.
[0035] According to a second aspect, the present application provides an interface offline review device. In some embodiments, the device includes:
[0036] The data collection module is used to collect data related to ingress gateway request monitoring analysis, source code scanning analysis, log analysis, and call chain analysis, and integrate the ingress gateway data, interface log data, interface call chain data, and source code scanning data;
[0037] A status detection module is used to determine the usage status of the target offline interface based on the ingress gateway data, interface log data, interface call chain data and source code scanning data; the usage status of the target offline interface includes whether other application codes reference the target offline interface, and whether there are interface request records and requested records within the past preset time period;
[0038] The review result generating module is used to determine the review result of the target offline interface according to the usage status of the target offline interface.
[0039] According to a third aspect, the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the interface offline review method provided in any of the above embodiments are implemented.
[0040] According to a fourth aspect, the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the interface offline review method provided in any of the above embodiments are implemented.
[0041] The above-mentioned embodiments of the present application collect data related to entry gateway request monitoring analysis, source code scanning analysis, log analysis and call chain analysis in the entire system, and integrate the entry gateway data, interface log data, interface call chain data, and source code scanning data. Then, based on the integrated multiple types of data, the target offline interface, that is, the various usage conditions of the application programming interface that needs to be offline are detected, such as whether other application codes have referenced the target offline interface, whether there are interface request records and requested records within the past preset time period, and finally, the review result of the interface is determined based on the detection results of various usage conditions. The present application can automatically identify problems with the interface, and the review speed is faster. It also reduces the risk of misjudgment caused by human factors due to the reduced need for manual intervention, and improves the interface review efficiency. In addition, the present application also conducts a more comprehensive detection of various conditions of the interface by comprehensively analyzing the usage of the interface, code quality and call chain, which can effectively reduce the negative impact of the interface offline on the existing system and minimize the risk of service interruption. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A flowchart of an interface offline review method provided by the present application according to one or more embodiments;
[0043] Figure 2A functional schematic diagram of a review device provided by the present application according to one or more embodiments;
[0044] Figure 3 A structural block diagram of an interface offline review device provided by the present application according to one or more embodiments;
[0045] Figure 4 This is a diagram of the internal structure of a computer device provided by the present application according to one or more embodiments. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings. It should be clear that the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0047] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0048] In the description of the present application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances. In addition, in the description of the present application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.
[0049] In view of the shortcomings or defects of the related technologies, the present application provides an interface offline review method. In some embodiments, the method can be applied to an interface offline review device (hereinafter referred to as a review device). When an application programming interface in a system (hereinafter referred to as a system) built based on a microservice architecture needs to be offline, the device can automatically review the usage status of the application programming interface that needs to be offline. The device can be deployed in a server. In this embodiment, the method includes: Figure 1 The steps shown are described in detail below.
[0050] S110: Collect data related to ingress gateway request monitoring analysis, source code scanning analysis, log analysis, and call chain analysis, and integrate them to obtain ingress gateway data, interface log data, interface call chain data, and source code scanning data.
[0051] In some embodiments, data related to ingress gateway request monitoring analysis, source code scanning analysis, log analysis, and call chain analysis are collected and integrated to obtain ingress gateway data, interface log data, interface call chain data, and source code scanning data, including:
[0052] (1) Use a log collection tool to collect data related to the monitoring and analysis of ingress gateway requests on the network server, and obtain ingress gateway data based on the integration of the data related to the monitoring and analysis of ingress gateway requests.
[0053] Among them, the network server can be an nginx server in the system, and the nginx server is an HTTP (Hypertext Transfer Protocol) server and a reverse proxy server. The log collection tool can be selected according to the actual situation, for example, it can be a tool such as Fluentd. After collecting the data related to the monitoring and analysis of the entry gateway request, the entry gateway data is extracted from it. The entry gateway data refers to the entry data of all requests (referring to HTTP requests), and the entry data of each request includes data such as the HTTP request header, request path, request method, and request parameters.
[0054] (2) Use a code scanning tool to scan and synchronize the code submitted to the code repository to obtain data related to source code scanning analysis, and integrate the data related to source code scanning analysis to obtain source code scanning data.
[0055] Source code scanning data refers to all codes submitted to the code repository, including data such as interfaces defined by the code. The review device can scan and synchronize the code submitted to the code repository through a code scanning tool to obtain all codes submitted to the code repository. The code scanning tool is not particularly limited in this embodiment, and those skilled in the art can select it according to actual conditions, such as tools such as sourcegraph.
[0056] (3) Query the log data of the online interface from the log system to obtain data related to log analysis, and obtain interface log data based on the data related to log analysis.
[0057] The log system records the log data of each online application programming interface in the system. The review device can use the log query function of the log system to query the log data of each online interface, and integrate and process these data according to the preset processing rules to obtain the interface log data corresponding to each online interface. The interface log data corresponding to each online interface includes the request response data related to the application programming interface, and the request response data includes the HTTP request header, request path, request method and other data.
[0058] (4) Use a call chain analysis tool to collect data related to the call chain analysis, and obtain interface call chain data based on the data integration related to the call chain analysis.
[0059] The review device can use the call chain analysis tool to collect data related to the call chain analysis in the system, and extract the interface call chain data corresponding to each online interface. The interface call chain data corresponding to each online interface refers to the direct call relationship data of the application programming interface, including the call record of the application programming interface, the number of calls corresponding to the past one or more time periods, and other data.
[0060] The call chain analysis tool is not particularly limited in this embodiment, and those skilled in the art may select a tool such as zipkin according to actual conditions.
[0061] S120: Determine the usage status of the target offline interface according to the ingress gateway data, the interface log data, the interface call chain data and the source code scanning data.
[0062] The target offline interface refers to the application programming interface that needs to be offline in the system. Usually, the person in charge of the application program confirms which application programming interface needs to be offline.
[0063] For the target offline interface, the review device will perform intelligent analysis and decision-making to identify whether the interface has offline risk. This embodiment will detect multiple usage conditions of the interface. When each item passes the test, it indicates that the interface does not have offline risk. On the contrary, if at least one item fails the test, it indicates that the interface has offline risk.
[0064] The usage status of the target offline interface includes whether other application codes reference the target offline interface, and whether there are interface request records and requested records in the past preset time. Whether there are interface request records and requested records in the past preset time refers to whether there are interface request records for the target offline interface in the past preset time, and whether there are requested records for the target offline interface in the past preset time.
[0065] In some embodiments, determining the usage status of the target offline interface according to the ingress gateway data, the interface log data, the interface call chain data, and the source code scanning data includes:
[0066] (1) A first detection result and a second detection result are obtained based on the entry gateway data, the interface log data and the interface call chain data; the first detection result and the second detection result respectively indicate whether there is an interface request record and whether there is a requested record on the target offline interface within a preset time period in the past.
[0067] Among them, the review device can obtain a first detection result based on the entry gateway data, interface log data and interface call chain data, and obtain a second detection result based on the entry gateway data, interface log data and interface call chain data.
[0068] The operation of obtaining the first detection result based on the entry gateway data, the interface log data and the interface call chain data can be that the review device queries the entry gateway data, the interface log data and the interface call chain data respectively whether there are interface request records corresponding to the target offline interface in the past specified time period. If the query results are all empty, it means that there are no interface request records for the target offline interface within the past preset time period. If the query results are not all empty, that is, the corresponding data can be queried from the entry gateway data, the interface log data, or the interface call chain data, it means that there are interface request records for the target offline interface within the past preset time period.
[0069] The operation of obtaining the second detection result based on the entry gateway data, the interface log data and the interface call chain data can be that the review device queries the entry gateway data, the interface log data and the interface call chain data respectively whether there are requested records corresponding to the target offline interface in the past specified time period. If the query results are all empty, it means that there are no requested records for the target offline interface within the past preset time period. If the query results are not all empty, that is, the corresponding data can be queried from the entry gateway data, the interface log data, or the interface call chain data, it means that there are requested records for the target offline interface within the past preset time period.
[0070] (2) Based on the source code scanning data, the request path and request method of the target offline interface are globally retrieved, and a third detection result is obtained based on the retrieval result. The third detection result indicates whether other application codes reference the target offline interface.
[0071] The review device globally retrieves the request path and request method of the target offline interface from the source code scanning data, and then determines whether the target offline interface is referenced by other application codes (referring to the code of other application programs) based on the retrieved request path and request method of the target offline interface. If so, it is determined that the target offline interface has other application codes that reference the target offline interface. If not, it is determined that the target offline interface has no other application codes that reference the target offline interface.
[0072] S130: Determine the review result of the target offline interface according to the usage status of the target offline interface.
[0073] Among them, when the first detection result and the second detection result respectively indicate that there is no interface request record and no requested record for the target offline interface within the past preset time period, and the third detection result indicates that no other application code references the target offline interface, the review result of the target offline interface is determined to be passed; when the first detection result indicates that there is an interface request record for the target offline interface within the past preset time period, or the second detection result indicates that there is a requested record for the target offline interface within the past preset time period, or the third detection result indicates that other application code references the target offline interface, the review result of the target offline interface is determined to be failed.
[0074] The above-mentioned embodiments of the present application collect data related to entry gateway request monitoring analysis, source code scanning analysis, log analysis and call chain analysis in the entire system, and integrate the entry gateway data, interface log data, interface call chain data, and source code scanning data. Then, based on the integrated multiple types of data, the target offline interface, that is, the various usage conditions of the application programming interface that needs to be offline are detected, such as whether other application codes have referenced the target offline interface, whether there are interface request records and requested records within the past preset time period, and finally, the review result of the interface is determined based on the detection results of various usage conditions. The present application can automatically identify problems with the interface, and the review speed is faster. It also reduces the risk of misjudgment caused by human factors due to the reduced need for manual intervention, and improves the interface review efficiency. In addition, the present application also conducts a more comprehensive detection of various conditions of the interface by comprehensively analyzing the usage of the interface, code quality and call chain, which can effectively reduce the negative impact of the interface offline on the existing system and minimize the risk of service interruption.
[0075] In some embodiments, after determining the review result of the target offline interface according to the usage status of the target offline interface, the method further includes: when the review result of the target offline interface is failure to pass the review, generating a repair plan according to the usage status of the target offline interface.
[0076] For interfaces that fail the review, the review device can also make intelligent decisions based on actual conditions to generate corresponding repair plans for users. The repair plans can help users quickly locate and solve problems to speed up the offline review process of the interface.
[0077] The review device will specifically determine each usage condition of the target offline interface that fails to pass the test, and then determine a corresponding repair plan for each usage condition that fails to pass the test.
[0078] For example, if you want to take down an application programming interface API-a in application A, if you find that there is no request record for API-a, but when scanning and analyzing the source code, you find that an application programming interface API-b of application B calls API-a, then the review device will determine that the review result of API-a is not passed, and will give a repair plan, such as deleting the code related to API-a in API-b of application B. For another example, suppose you want to take down an API-c in application A, and you find that API-c has a related request log. Through the request log, it is determined that API-c is a direct request from the front-end application to the back-end, and it is found from the source code scanning data that the front-end code references API-c. At this time, it is determined that the review has not passed, and a repair plan is given, such as deleting the request code for requesting API-c in the front-end.
[0079] Furthermore, in addition to providing a repair solution, a detailed description of why the target offline interface failed the review can also be provided to allow users to better understand the specific situation of the interface.
[0080] In some embodiments, after the review result of the target offline interface is passed, the method further includes:
[0081] (1) Notify the user to log off the target offline interface;
[0082] (2) monitoring in real time whether a specified indicator is abnormal during the offline process of the target offline interface; the offline process of the target offline interface includes multiple offline stages; the specified indicator includes an indicator related to system performance and / or an indicator related to system stability;
[0083] (3) When an abnormality occurs in a designated indicator, a target processing strategy is determined from pre-established processing strategies based on the indicator type of the designated indicator and the current offline stage, and the target processing strategy is executed.
[0084] In addition, when an abnormality is detected in a specified indicator, an alarm message can be sent to the user so that the user can quickly understand the abnormality that occurs during the interface offline process. Through the above embodiment, the review device can automatically conduct a comprehensive and accurate review before the interface goes offline, avoid problems during the offline process, and reduce the impact of the interface offline on the system. For further information, please refer to Figure 2 ,The inspection device also has an offline monitoring function, which is described in detail below.
[0085] When the interface passes the review, the user can take the interface offline. During the interface offline process, the interface is usually offline in the development environment and test environment first. If the interface is verified to be OK after offline, then the interface is offline in the production environment, and then observed for a period of time (such as one month). If no problems occur or the problems have been solved, then the interface can be considered offline successfully.
[0086] For the target offline interface, users need to formulate a clear offline schedule for the interface in advance, including the entire offline process can be divided into several stages (which can be called offline stages) and the corresponding start date and end date of each stage. Users can also formulate corresponding processing strategies for handling exceptions for each stage. For example, after the new interface used to replace the target offline interface is deployed to the production environment, there may be performance problems or other business logic anomalies, which affect the normal operation of the business. In this case, users can formulate rollback plans, set grayscale switches and other strategies, so that when problems occur with the new interface, the old version can be quickly restored to ensure the normal operation of the production environment and reduce the adverse effects on the system.
[0087] In some embodiments, after the offline process of the target offline interface is completed, the review device will close the target offline interface, then obtain the interface information of the new interface corresponding to the target offline interface, and update the interface document related to the target offline interface according to the interface information of the new interface corresponding to the target offline interface. This ensures that these interface documents can accurately reflect the interface information of the latest version of the application programming interface.
[0088] It should be noted that, with respect to the various steps included in the interface offline review method provided in any of the above embodiments, unless otherwise specified in this document, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of these steps can include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0089] Based on the same inventive concept, the present application also provides an interface offline review device. In some embodiments, Figure 3 As shown, the interface offline review device includes the following modules:
[0090] The data collection module 110 is used to collect data related to ingress gateway request monitoring analysis, source code scanning analysis, log analysis and call chain analysis, and integrate the ingress gateway data, interface log data, interface call chain data and source code scanning data;
[0091] The status detection module 120 is used to determine the usage status of the target offline interface according to the ingress gateway data, the interface log data, the interface call chain data and the source code scanning data; the usage status of the target offline interface includes whether other application codes have referenced the target offline interface, and whether there are interface request records and requested records within the past preset time period;
[0092] The review result generating module 130 is used to determine the review result of the target offline interface according to the usage status of the target offline interface.
[0093] In some embodiments, the data collection module 110 includes:
[0094] A first data processing submodule is used to collect data related to the monitoring and analysis of ingress gateway requests on a network server using a log collection tool, and obtain ingress gateway data based on the data integration related to the monitoring and analysis of ingress gateway requests;
[0095] The second data processing submodule is used to use a code scanning tool to scan and synchronize the code submitted to the code repository to obtain data related to source code scanning analysis, and to obtain source code scanning data based on the data related to source code scanning analysis;
[0096] The third data processing submodule is used to query the log data of the online interface from the log system, obtain data related to the log analysis, and obtain the interface log data based on the data related to the log analysis;
[0097] The fourth data processing submodule is used to use the call chain analysis tool to collect data related to the call chain analysis, and obtain interface call chain data based on the data integration related to the call chain analysis.
[0098] In some embodiments, the condition detection module 120 includes:
[0099] A first detection submodule, used to obtain a first detection result based on the ingress gateway data, the interface log data and the interface call chain data, wherein the first detection result indicates whether there is an interface request record for the target offline interface within a preset time period in the past;
[0100] A second detection submodule is used to obtain a second detection result based on the ingress gateway data, the interface log data and the interface call chain data, and the second detection result indicates whether the target offline interface has been requested within a preset time period in the past;
[0101] The third detection submodule is used to globally retrieve the request path and request method of the target offline interface based on the source code scanning data, and obtain a third detection result based on the retrieval result. The third detection result indicates whether other application codes reference the target offline interface.
[0102] In some embodiments, the review result generation module 130 is specifically used to: determine that the review result of the target offline interface is passed when the first detection result and the second detection result respectively indicate that there is no interface request record and no requested record for the target offline interface within the past preset time period, and the third detection result indicates that no other application code references the target offline interface; determine that the review result of the target offline interface is failed when the first detection result indicates that there is an interface request record for the target offline interface within the past preset time period, or the second detection result indicates that there is a requested record for the target offline interface within the past preset time period, or the third detection result indicates that other application code references the target offline interface.
[0103] In some embodiments, the device further comprises a repair solution generation module. The repair solution generation module is used to generate a repair solution according to the use status of the target offline interface when the review result of the target offline interface is failure to pass the review.
[0104] In some embodiments, the apparatus further comprises:
[0105] The review result notification module is used to notify the user to perform offline operations on the target offline interface;
[0106] The offline monitoring module is used to monitor in real time whether the specified indicators are abnormal during the offline process of the target offline interface; the offline process of the target offline interface includes multiple offline stages; the specified indicators include indicators related to system performance and / or indicators related to system stability;
[0107] The exception handling module is used to determine the target processing strategy from the pre-established processing strategies based on the indicator type of the specified indicator and the current offline stage, and execute the target processing strategy when an exception occurs in the specified indicator.
[0108] In some embodiments, the apparatus further comprises:
[0109] The interface closing module is used to close the target offline interface after completing the offline process of the target offline interface;
[0110] The interface information updating module is used to update the interface document related to the target offline interface according to the interface information of the new interface corresponding to the target offline interface.
[0111] For the specific definition of the interface offline review device, please refer to the definition of the interface offline review method above, which will not be repeated here. Each module in the above-mentioned interface offline review device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0112] The present application also provides a computer device. In some embodiments, the computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the clinical efficacy characteristic enhancement method provided in any of the above embodiments can be implemented.
[0113] Furthermore, in some embodiments, the internal structure diagram of the computer device may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as entry gateway data, interface log data, interface call chain data, source code scanning data, etc. The specific stored data can also refer to the definition in the above method embodiment. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an interface offline review method is implemented.
[0114] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0115] The present application also provides a computer-readable storage medium. In some embodiments, a computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the steps of the interface offline review method provided in any of the above embodiments are implemented.
[0116] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0117] Those skilled in the art can understand that all or part of the processes in the above method embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink), DRAM (SLDRAM), memory bus (Rambus), direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0118] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0119] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. An interface offline review method, characterized in that: The method comprises: Collect data related to ingress gateway request monitoring analysis, source code scanning analysis, log analysis, and call chain analysis, and integrate them to obtain ingress gateway data, interface log data, interface call chain data, and source code scanning data; Determine the usage status of the target offline interface according to the ingress gateway data, the interface log data, the interface call chain data and the source code scanning data; the usage status of the target offline interface includes whether other application codes reference the target offline interface, and whether there are interface request records and requested records within a preset time period in the past; The review result of the target offline interface is determined according to the usage status of the target offline interface.
2. The method according to claim 1, characterized in that Collect data related to ingress gateway request monitoring analysis, source code scanning analysis, log analysis, and call chain analysis, and integrate them to obtain ingress gateway data, interface log data, interface call chain data, and source code scanning data, including: Using a log collection tool to collect data related to the monitoring and analysis of ingress gateway requests on a network server, and integrating the data related to the monitoring and analysis of ingress gateway requests to obtain ingress gateway data; Use a code scanning tool to scan and synchronize the code submitted to the code repository to obtain data related to source code scanning analysis, and integrate the data related to source code scanning analysis to obtain source code scanning data; Query the log data of the online interface from the log system to obtain data related to log analysis, and obtain interface log data based on the data related to log analysis; A call chain analysis tool is used to collect data related to the call chain analysis, and interface call chain data is obtained based on the integration of the data related to the call chain analysis.
3. The method according to claim 1, characterized in that Determining the usage status of the target offline interface according to the ingress gateway data, the interface log data, the interface call chain data, and the source code scanning data includes: A first detection result and a second detection result are obtained based on the ingress gateway data, the interface log data and the interface call chain data; the first detection result and the second detection result respectively indicate whether there is an interface request record and a requested record for the target offline interface within a preset time period in the past; The request path and request method of the target offline interface are globally retrieved based on the source code scanning data, and a third detection result is obtained based on the retrieval result, wherein the third detection result indicates whether other application codes reference the target offline interface.
4. The method according to claim 3, characterized in that Determining the review result of the target offline interface according to the usage status of the target offline interface includes: When the first detection result and the second detection result respectively indicate that there is no interface request record and no requested record for the target offline interface within the past preset time period, and the third detection result indicates that no other application code references the target offline interface, determine that the review result of the target offline interface is passed; When the first detection result indicates that there was an interface request record for the target offline interface within the past preset time period, or the second detection result indicates that there was a requested record for the target offline interface within the past preset time period, or the third detection result indicates that other application codes have referenced the target offline interface, it is determined that the review result of the target offline interface is review failure.
5. The method according to claim 3, characterized in that After determining the examination result of the target offline interface according to the usage status of the target offline interface, the method further includes: When the review result of the target offline interface is failure to pass the review, a repair plan is generated according to the usage status of the target offline interface.
6. The method according to claim 4 or 5, characterized in that After the review result of the target offline interface is passed, the method further includes: Notify the user to perform offline operation on the target offline interface; During the offline process of the target offline interface, the designated indicator is monitored in real time to see whether an abnormality occurs; the offline process of the target offline interface includes multiple offline stages; the designated indicator includes an indicator related to system performance and / or an indicator related to system stability; When an abnormality occurs in the designated indicator, a target processing strategy is determined from pre-defined processing strategies based on the indicator type of the designated indicator and the current offline stage, and the target processing strategy is executed.
7. The method according to claim 6, characterized in that After completing the offline process of the target offline interface, the method further includes: Close the target offline interface; The interface document related to the target offline interface is updated according to the interface information of the new interface corresponding to the target offline interface.
8. An interface offline review device, characterized in that: The device comprises: The data collection module is used to collect data related to ingress gateway request monitoring analysis, source code scanning analysis, log analysis, and call chain analysis, and integrate the ingress gateway data, interface log data, interface call chain data, and source code scanning data; A status detection module is used to determine the usage status of the target offline interface according to the ingress gateway data, the interface log data, the interface call chain data and the source code scanning data; the usage status of the target offline interface includes whether other application codes reference the target offline interface, and whether there are interface request records and requested records within a preset time period in the past; The review result generating module is used to determine the review result of the target offline interface according to the usage status of the target offline interface.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.