Interface detection method

By constructing a method call graph and utilizing preset auxiliary identification code information, the problem of inaccurate positioning of artificial intelligence API interfaces in existing technologies is solved, achieving efficient and accurate interface detection in complex microservice architectures, and improving security and compliance.

CN121300849APending Publication Date: 2026-01-09ZHEJIANG E COMMERCE BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511453266.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-11
Publication Date
2026-01-09

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately and efficiently locate AI API interfaces, especially in complex microservice architectures and cross-application call scenarios, leading to security and compliance risks.

Method used

By constructing a method call graph, determining the AI ​​service method nodes based on preset auxiliary identification code information, and accurately locating the target interface nodes according to the call relationship, efficient identification of AI service interfaces is achieved.

Benefits of technology

It enables efficient and accurate location of AI service interfaces across different applications, avoiding security risks and compliance issues caused by inaccurate identification, and improving the accuracy and efficiency of interface detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121300849A_ABST
    Figure CN121300849A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an interface detection method. According to the scheme, the method calling graph is constructed according to calling relations among service nodes, and the service nodes comprise method nodes and interface nodes; determining artificial intelligence service method nodes in the method nodes based on preset auxiliary identification code information; and determining a target interface node in the method calling graph by using the calling relationship between the artificial intelligence service method node and each service node, and determining a service interface corresponding to the target interface node as an artificial intelligence service interface.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] One or more embodiments of the present specification relate to the technical field of computer technology, and in particular to an interface detection method. One or more embodiments of the present specification also relate to an interface detection apparatus, a computing device, a computer-readable storage medium, and a computer program product. BACKGROUND

[0002] With the continuous development of computer technology, artificial intelligence (AI) technology is also booming. In the process of providing artificial intelligence API services in the form of an application programming interface (API), the functions of an artificial intelligence API interface (hereinafter referred to as an AI interface) are usually embodied in the mutual calling between multiple applications, with the characteristics of flexibility and complexity of calling.

[0003] In related technologies, structured information of an application is usually extracted, and based on the extracted structured information, it is determined whether the current application is an application that provides AI services. However, it is difficult to locate the artificial intelligence API interface in the application that provides AI services using the related technology. Moreover, due to the characteristics of flexibility and complexity of calling between different applications, the artificial intelligence API interface cannot be accurately and efficiently located using the related technology, and therefore how to accurately locate the artificial intelligence API interface becomes a problem to be solved. SUMMARY

[0004] Therefore, one or more embodiments of the present specification provide an interface detection method, apparatus, device, and computer-readable medium to solve the problem of inaccurate positioning of existing interface detection methods.

[0005] According to a first aspect of one or more embodiments of the present specification, an interface detection method is provided, comprising: constructing a method call graph, wherein the method call graph comprises service nodes and calling relationships between the service nodes, and the service nodes comprise method nodes and interface nodes; determining an artificial intelligence service method node in each method node based on preset auxiliary identification code information; determining a target interface node in the method call graph according to the artificial intelligence service method node and the calling relationships between the service nodes; determining that a service interface corresponding to the target interface node is an artificial intelligence service interface.

[0006] According to a second aspect of one or more embodiments of the present specification, an interface detection apparatus is provided, comprising: The constructing unit is configured to construct a method call graph, wherein the method call graph comprises service nodes and call relationships between the service nodes, and the service nodes comprise method nodes and interface nodes. The determining unit is configured to determine an artificial intelligence service method node in each method node based on preset auxiliary identification code information. According to the artificial intelligence service method node and the call relationships between the service nodes, a target interface node is determined in the method call graph. The service interface corresponding to the target interface node is determined as an artificial intelligence service interface.

[0007] According to a third aspect of one or more embodiments of the present specification, a computing device is provided, comprising: a memory and a processor; The memory is configured to store computer programs / instructions, and the processor is configured to execute the computer programs / instructions, which realize the steps of the above method when executed by the processor.

[0008] According to a fourth aspect of one or more embodiments of the present specification, a computer readable storage medium is provided, which stores computer programs / instructions, which realize the steps of the above method when executed by the processor.

[0009] According to a fifth aspect of one or more embodiments of the present specification, a computer program product is provided, comprising computer programs / instructions, which realize the steps of the above method when executed by the processor.

[0010] According to one or more embodiments of the present specification, the following beneficial effects can be achieved: By constructing a method call graph comprising method nodes, interface nodes and call relationships, and locating an artificial intelligence service method node in combination with preset auxiliary identification code information. On this basis, according to the call relationships between the service nodes, an artificial intelligence service interface is determined, and then the artificial intelligence service interface is accurately located. In addition, by constructing the method call graph, the artificial intelligence service interface is determined without analyzing the application, so that even if the artificial intelligence service interface is called between different applications, the artificial intelligence service method node can be determined, and the artificial intelligence service interface can be accurately detected according to the call relationships between the service nodes, so as to accurately locate the artificial intelligence service interface. BRIEF DESCRIPTION OF DRAWINGS

[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present specification or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, the accompanying drawings in the following description only represent some embodiments of the present specification, and for those skilled in the art, other drawings can also be obtained without creative labor.

[0012] Figure 1 The overall scheme flow diagram of an interface detection method provided by the embodiments of the present specification is shown in the figure. Figure 2 The schematic diagram of a method call graph provided by the embodiments of the present specification is shown in the figure. Figure 3 The structural schematic diagram of an interface detection device provided by the embodiments of the present specification is shown in the figure. Figure 4 The architecture diagram of an interface detection system provided by the embodiments of the present specification is shown in the figure. Figure 5 The structural block diagram of a computing device provided by an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0013] In order for those skilled in the art to better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present specification. Obviously, the described embodiments only represent some of the embodiments of the present specification, not all of the embodiments. Based on the embodiments in the present specification, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the present specification.

[0014] The present specification uses specific words to describe the embodiments of the present specification. As "one embodiment", "an embodiment", and / or "some embodiments" means a certain feature, structure or characteristic related to at least one embodiment of the present specification. Therefore, it should be emphasized and noted that the "an embodiment" or "one embodiment" or "one alternative embodiment" mentioned in different positions in the present specification does not necessarily refer to the same embodiment. In addition, those skilled in the art can combine and combine the different embodiments or examples described in the present specification and the features of different embodiments or examples without contradiction.

[0015] The terminology used in this disclosure of one or more embodiments is for the purpose of describing particular embodiments only and is not intended to be limiting of one or more embodiments of the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0016] The terms "comprises," "comprising," "includes," "including," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.

[0017] Although the terms first, second, etc. can be used herein to describe various information, these terms are not intended to denote a temporal sequence, but to distinguish between different pieces of information. For example, a first entity discussed below could be termed a second entity without departing from the scope of one or more embodiments of the present disclosure. The first, second, etc. designations, are used herein merely to distinguish one piece of information from another, and do not necessarily have a chronological and / or spatial sequence.

[0018] Depending on the context, the word "if' can be interpreted to mean "when" or "upon" or "in response to determining" taking into account both possibilities.

[0019] In this disclosure, unless expressly stated to the contrary, "receiving" and "sending" of data is not necessarily direct receiving and sending, but can be indirect receiving and sending. For example, A receiving data sent by B can be understood as A directly receiving data sent by B, or A indirectly receiving data sent by B through C or other subjects. Similarly, B sending data to A can be understood as B directly sending data to A, or B indirectly sending data to A through C or other subjects. Here, C can be one subject, or two or more subjects.

[0020] In this specification, unless explicitly stated otherwise, the relationships between structures can be direct or indirect. For example, when describing "A is connected to B," unless it is explicitly stated that A and B are directly connected, it should be understood that A can be directly connected to B or indirectly connected to B. Similarly, when describing "A is on top of B," unless it is explicitly stated that A is directly above B (AB is adjacent and A is above B), it should be understood that A can be directly above B or indirectly above B (AB is separated by other elements, and A is above B). And so on.

[0021] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties. The collection, use and processing of related data shall comply with the relevant laws, regulations and standards of the relevant regions, and corresponding operation entry points shall be provided for users to choose to authorize or refuse.

[0022] It is important to understand that the interface detection methods described in this specification are applied to scenarios where AI API services are provided in the form of Application Programming Interfaces (APIs). For example, they are used in applications that provide AI-based services to locate the API interfaces (or AI interfaces) that provide these services. For instance, in an application that provides image enhancement and filter services, the application relies on AI-provided services, and therefore, the API interface providing these AI services needs to be located.

[0023] With the development of artificial intelligence technology, the number and types of AI applications have exploded, especially in the field of providing services to the public, where AI applications are gradually becoming an important component. However, while leveraging the powerful functions and convenience gained from using APIs that provide AI services, there are also security and compliance risks.

[0024] First, the terms and concepts used in one or more embodiments of this specification will be explained.

[0025] Artificial intelligence service API interfaces (i.e., AI interfaces): These refer to the interfaces in an application system that provide AI-related service capabilities to the outside world through programming interfaces (APIs) or service nodes. These include, but are not limited to, basic AI services and task interfaces developed based on AI services. Examples include model inference service interfaces, natural language generation API interfaces, recommendation algorithm service interfaces, classification applications based on model services, dialogue services, and other task interfaces.

[0026] Microservice architecture: A distributed application design architecture that breaks down an application into several independently running service units. Each service unit has independent task functions and communicates with each other through standardized interfaces (such as REST or RPC). Microservice architecture makes development and deployment more flexible, but it also brings complex interface dependencies and call relationships.

[0027] Static code analysis is an analytical method that extracts information from source code without running the program. It is typically used to examine code structure, dependencies, and data flow. This document demonstrates how static analysis can identify the code relationships between specific interfaces and AI models or algorithms.

[0028] Call graph: Using static code analysis, functions and their call relationships in the software are stored in the form of a graph. Each node represents a function, and directed edges represent the relationships between functions. The method call graph described in this specification can be understood as displaying the method and interface information involved in the application as nodes based on static code analysis of at least one application, and determining the mutual call relationships between the methods and interfaces as edges between the nodes.

[0029] AI applications are characterized by their highly experimental nature and complex, diverse application scenarios during development and use. Furthermore, in modern microservice architectures, the call relationships between various interfaces are often extremely complex. In addition, the dynamic and distributed nature of service modules in microservice architectures increases the challenge of interface identification. Therefore, inaccurate identification of AI interfaces can easily lead to security vulnerabilities due to a lack of oversight.

[0030] To address the above, related technologies typically rely on code feature scanning for identification. This includes extracting structured information to identify keywords, identifying dependency packages or frameworks, or analyzing parameter types or data flow characteristics in certain service functions. However, this approach requires pre-defined rules and templates and can only identify compatible frameworks, lacking universality. Furthermore, this method cannot pinpoint the AI ​​interfaces used in the application. Further, related technologies can identify AI interfaces through log or traffic analysis. For example, by capturing interface logs or traffic after deployment, characteristics of request parameter values ​​can be identified to determine the AI ​​interface. However, this method requires the interface to be deployed before deployment and cannot accurately locate AI interfaces called across applications. Building on the above, related technologies can also extract interface function code and leverage AI's semantic understanding to identify whether the extracted interface function code is an AI interface. However, this method has limitations. If the extracted AI interface function code is singular, it may lack other characteristics besides input and output, making accurate identification of the AI ​​interface difficult. Furthermore, if the introduced interface function code calls other functions, redundancy between these functions can lead to low recognition accuracy. Therefore, this technology cannot accurately locate the AI ​​interface.

[0031] Therefore, this specification provides an interface detection method that constructs a method call graph containing method nodes and interface nodes by parsing the code of each application. The method call graph identifies the AI ​​service method node, and then, based on the call relationship between the service node and the AI ​​method node, the AI ​​interface node is determined. On this basis, the method efficiently and accurately locates the AI ​​interface based on the correlation between the AI ​​method node and the AI ​​interface node.

[0032] This specification provides an interface detection method, and also relates to an interface detection device, a computing device, a computer-readable storage medium, and a computer program product, which will be described in detail in the following embodiments.

[0033] See Figure 1 , Figure 1 This is a schematic diagram of the overall scheme of an interface detection method provided in the embodiments of this specification, including steps 102-108.

[0034] Step 102: Construct the method call graph.

[0035] The method call graph includes service nodes and the call relationships between them. Service nodes include method nodes and interface nodes. Interface nodes can be understood as API interfaces for different applications, displayed as nodes in the method call graph, thus representing the interface method nodes that represent the API interfaces. Method nodes can be understood as other method nodes in the method call graph besides the method nodes representing API interfaces. The method call graph can be understood as a collection representing the call relationships between service nodes, that is, using a graph structure to represent the methods contained in multiple applications and the reference relationships between them.

[0036] It is important to understand that the AI ​​service interfaces discussed later in this specification are API interfaces that provide AI services. The interfaces in the method call diagram are API interfaces (for example, they could be API interfaces providing AI services or API interfaces providing data transmission, etc.). The call relationship can be understood as unidirectional; the interface, as the initiator, calls a method other than the interface itself, and the method does not call the interface in return (where the interface is used for external interaction with the user, and the method is used for internal application implementation). Based on this, if interface A calls method M1, and method M1 calls method M2, then interface A and M2 form a transitive call relationship through M1.

[0037] In one specific embodiment of this specification, the application to be processed is identified, and the static code of the application is parsed. The parsed code is used to construct a method call graph based on the methods and interfaces. In the method call graph, the nodes corresponding to the methods and interfaces are identified as service nodes, and the relationships between service nodes are displayed in the form of edges.

[0038] In one or more embodiments provided in this specification, a method call graph is constructed, including: Obtain at least one application to be processed, and obtain the corresponding interface information, method information and call relationship for each application to be processed; The applications to be processed can be understood as those that provide services to the outside world.

[0039] By using the interface information and method information as service nodes and the call relationship as edges between service nodes, a method call graph is constructed.

[0040] In one example, when the application to be processed is a single application, the static code of the application to be processed is parsed to determine the interface information, method information, and the calling relationship between the interface information and the methods, thereby constructing a method call graph.

[0041] In another example, such as Figure 2 As shown. Figure 2This is a schematic diagram of a method call graph provided in an embodiment of this specification. When there are two or more applications to be processed (e.g., three applications: application 1, application 2, and application 3), the static code of the three applications is parsed, and based on the parsed code, interface information (e.g., interface 1 and interface 2) and method information (e.g., method 1, method 2, method 3, method 4, method 5, and method 6) are determined. Based on the above, a method call graph is constructed according to the call relationships between each interface and method (e.g., there is a call relationship between interface 1 and method 1).

[0042] According to one or more embodiments provided above in this specification, a method call graph is constructed at the code level by parsing the static code of the application, without being limited by the application. Furthermore, the interface and method information in the application is displayed as nodes in the method call graph, intuitively and completely presenting the call chain within and across applications. This makes the dependencies between methods and interfaces in the application clear and traceable, accurately displaying the call relationships between interfaces across applications, and thus providing a visual analysis platform for subsequent location and analysis of AI service calls from different interfaces.

[0043] Step 104: Determine the artificial intelligence service method node in each method node based on the preset auxiliary recognition code information.

[0044] In one specific embodiment of this specification, the method information corresponding to each method node is matched with preset auxiliary identification code information to clarify the artificial intelligence service method node in the method call graph.

[0045] The preset auxiliary identification code information can be understood as analyzing the characteristics of the code from different dimensions for different methods and interface methods in the corresponding application, so as to determine that the code of the corresponding method conforms to the characteristics of artificial intelligence services, and then determining the node corresponding to the method that conforms to the characteristics of artificial intelligence services as the artificial intelligence service method node.

[0046] For example, among various methods, if method A satisfies the condition that the API interface method calling method A must be an interface method of the artificial intelligence service API, then method A can be understood as having pre-defined auxiliary identification code information. This pre-defined auxiliary identification code information includes whether method A directly calls artificial intelligence, or whether it doesn't directly call artificial intelligence but serves as preparation before or processing after the call. For instance, if method A itself calls artificial intelligence, then the service provided by the API interface method calling method A must be a service built using artificial intelligence. Similarly, if method A's function is preparation before calling artificial intelligence, then the API interface method calling method A must also be calling artificial intelligence.

[0047] The preset auxiliary recognition code information includes features in at least one dimension of the following a)-f): a) Characteristics of constant strings.

[0048] The constant string feature characterization method code represents the string corresponding to the artificial intelligence service. For example, constant string features can include: "you are", "you are a...", etc.

[0049] b) Method parameter name.

[0050] In this context, the method parameter name represents the parameter name related to the configuration of the artificial intelligence service in the method code. For example, the method parameter name can contain "temperature", "promptTemplate", etc.

[0051] c) Model name.

[0052] The model name represents the name that appears in the method code that conforms to the artificial intelligence model.

[0053] d) Uniform Resource Locator (URL) characteristics.

[0054] The Uniform Resource Locator (URL) characteristic represents the path to the corresponding AI service interface. Examples include " / chat" and " / completions".

[0055] e) Domain characteristics.

[0056] Among them, domain name characteristics represent the domain names of artificial intelligence service providers.

[0057] f) Function characteristics.

[0058] Among them, function features characterize the specific behavior of the function called by the corresponding artificial intelligence service.

[0059] It should be understood that the preset auxiliary recognition code information of different dimensions mentioned above is illustrative and not intended to be limiting. Furthermore, the preset auxiliary recognition code information can be understood as the general features shown in one or more of the above dimensions. These general features can identify the code to determine whether the code of the corresponding method conforms to the code of an artificial intelligence service.

[0060] In one or more embodiments provided in this specification, determining the artificial intelligence service method node in each method node based on preset auxiliary recognition code information includes: Obtain the code of the method to be processed corresponding to the method node to be processed, wherein the method node to be processed is any one of the method nodes; The code of the method to be processed is compared with the preset auxiliary identification code information; If the method code to be processed is successfully matched with the preset auxiliary identification code information, the method node to be processed is determined to be an artificial intelligence service method node.

[0061] In one specific embodiment of this specification, any method node in the method call diagram is selected as the method node to be processed. The method code corresponding to this method node is then obtained. The method code to be processed is compared with preset auxiliary identification code information. If the method code to be processed contains one or more types of code identical to those in the preset auxiliary identification code information, then the method code to be processed is considered to have successfully matched the preset auxiliary identification code information, and the method node to be processed is determined to be an artificial intelligence service method node.

[0062] According to one or more embodiments provided above in this specification, a comparison is made between preset auxiliary identification code information and the code of the method to be processed, so as to accurately identify the method directly involved in AI service interaction, thereby avoiding misidentification of conventional task methods as AI service methods. Furthermore, identifying the code of the method to be processed does not require waiting for the interface to go online or relying on runtime logs or traffic, thus avoiding security and compliance risks caused by the lag in subsequent interface node location and detection.

[0063] Step 106: Based on the calling relationship between the AI ​​service method node and each service node, determine the target interface node in the method call graph.

[0064] The target interface node can be understood as an interface node that contains information about providing artificial intelligence service functions.

[0065] In one specific embodiment of this specification, when an artificial intelligence service method node is determined, in order to facilitate accurate location of the target interface node, the interface node that calls the artificial intelligence service method node can be determined according to the calling relationship between the artificial intelligence service method node and each method node and interface node, and the interface node that calls the artificial intelligence service method node can be determined as the target interface node.

[0066] In one example, with Figure 2 The method node corresponding to method 3 shown is an example of an artificial intelligence service method node. According to... Figure 2 It can be seen that the service node that has a calling relationship with the method node corresponding to method 3 is the method node corresponding to method 1. The service node that has a calling relationship with the method node corresponding to method 1 is the interface node corresponding to interface 1. Based on this, when it is determined that the method node corresponding to method 3 is the artificial intelligence service method node, the interface node corresponding to interface 1 is determined to be the target interface node.

[0067] For ease of understanding, in one or more embodiments provided in this specification, the content of determining the target interface node in the method call graph based on the calling relationship between the artificial intelligence service method node and each service node is explained according to S1062-S1066.

[0068] S1062: Based on the calling relationship between the artificial intelligence service method node and each service node, determine the initial interface node in the method call graph, and determine the interface call chain based on the initial interface node and the artificial intelligence service method node.

[0069] The initial interface node can be understood as any interface node in the method call graph that has a call relationship with the AI ​​service method node.

[0070] S1064: Determine at least one pending interface call chain based on the initial interface node, and obtain the pending chain code corresponding to each pending interface call chain.

[0071] In the pending interface call chain, the starting node is the initial interface node, and the ending node is the artificial intelligence service method node.

[0072] In one example, set Figure 2 In the method call graph, the method nodes corresponding to methods 2 and 3 are both AI service method nodes. Therefore, the initial interface node with a call relationship to the method node corresponding to method 2 is determined to be the interface node corresponding to interface 1. Similarly, the interface node with a call relationship to the method node corresponding to method 3 is the interface node corresponding to interface 1. Based on this, the interface node corresponding to interface 1 is determined as the initial interface node. The interface call chains determined based on the initial interface node and the AI ​​service method node include two separate processes: Processing Interface Call Chain 1 (Interface 1 → Method 1 → Method 3) and Processing Interface Call Chain 2 (Interface 1 → Method 1 → Method 2). The processing chain code for Processing Interface Call Chain 1 and Processing Interface Call Chain 2 are then obtained.

[0073] It should be understood that when there are multiple interface call chains corresponding to the initial interface node, in order to improve the processing efficiency of multiple interface call chains and to accurately determine the interface call chain to be processed from multiple interface call chains, this specification can use one or more of the following embodiments to filter multiple interface call chains.

[0074] In one or more embodiments provided in this specification, determining at least one interface call chain to be processed based on an initial interface node includes: When the initial interface node corresponds to at least two interface call links, the link determination parameters corresponding to the initial interface node are determined. Based on the link determination parameters, determine the interface call link to be processed from at least two interface call links.

[0075] In this context, link determination parameters can be understood as key parameters in an interface interaction scenario that, based on the parameter information input by the user to the interface, can accurately locate method nodes that have a direct or indirect call relationship with that interface. Link determination parameters can include specific numerical values ​​or content input by the user, as well as the call logic relationship between the interface and the method.

[0076] In one example, when a user calls an API, the input call path determination parameters trigger the API's internal task logic processing. These parameters, based on their type, name, and propagation path, can match method nodes in the method call graph that have a call relationship with the API. For example, if the call path determination parameters include "promptTemplate," these parameters might be passed to the method that builds the AI ​​service input. By using these parameters, the call relationship between the API and this method can be located, thus revealing the complete call path.

[0077] In one example, such as Figure 2 As shown, when it is detected that the method nodes corresponding to methods 4 and 6 are both AI service method nodes, the initial interface node is determined to be the interface node corresponding to interface 2 based on the call relationship between the services. Based on this, the interface call chains corresponding to the interface node corresponding to interface 2 are determined to be interface call chain 3 (interface 2 → method 5 → method 6) and interface call chain 4 (interface 2 → method 6). The link determination parameter A corresponding to interface 2 is determined. After being received from interface 2, link determination parameter A is transmitted to method 5. Therefore, interface call chain 3 is more closely associated with link determination parameter A. Thus, among interface call chain 3 and interface call chain 4 corresponding to interface 2, the interface call chain to be processed is determined to be interface call chain 3.

[0078] According to one or more embodiments provided above in this specification, when an initial interface node is determined based on the method call graph and the way it is called by the AI ​​service method node, if at least one interface call chain exists corresponding to the initial interface node, then at least one interface call chain is filtered based on the chain determination parameters. Since the chain determination parameters can match the method node with a call relationship to the interface in the method call graph based on features such as parameter type, name, and transmission path, the method of using chain determination parameters can accurately determine the association between the AI ​​service method node and the initial interface. This makes the filtered interface call chains to be processed more accurate, thereby facilitating the subsequent determination of the target interface node based on the interface call chains to be processed.

[0079] In one or more embodiments provided in this specification, determining at least one interface call chain to be processed based on an initial interface node includes: In the case that the initial interface node corresponds to at least two interface call chains, determine the number of service nodes included in each interface call chain; Interface call chains with fewer than a first preset threshold number of nodes are identified as interface call chains to be processed.

[0080] The first preset threshold can be understood as a pre-set critical value used to determine the complexity of the interface call chain. The first preset threshold can be set according to the characteristics of the actual task requirements. For example, in a microservice architecture, because cross-application calls may lead to long interface call chains, the first preset threshold can be appropriately increased. However, for monolithic applications, because the processing logic of the interface call chain is relatively simple, the first preset threshold can be set lower to facilitate the rapid identification of the interface call chain to be processed.

[0081] In one example, a first preset threshold number can be used to distinguish between simple and complex API call chains. If the number of service nodes is lower than the first preset threshold number, the chain can be considered a simple chain with fewer call layers and clearer logic; otherwise, it is a complex chain.

[0082] In one specific embodiment of this specification, when the initial interface node corresponds to at least two interface call chains, to avoid the interface call chains being too long and containing a large number of redundant nodes unrelated to the core logic, thus affecting the subsequent judgment of the target interface node, a first preset quantity threshold is pre-set, and the number of service nodes contained in the interface call chains corresponding to the initial interface node is analyzed. When the number of service nodes is less than the first preset quantity threshold, the interface call chain is determined as an interface call chain to be processed.

[0083] According to one or more embodiments provided above in this specification, by setting a first preset quantity threshold, at least two interface call chains determined by the initial interface node are divided into simple interface call chains and complex interface call chains, and the simple interface call chains are determined as the interface call chains to be processed. This avoids redundant service nodes due to an excessive number of service nodes during the judgment of the target interface node, thus allowing priority to be given to processing chains more likely to be directly related to artificial intelligence service methods, improving analysis efficiency and accuracy.

[0084] In one specific embodiment of this specification, according to any of the above-described embodiments, one or more interface call chains corresponding to the obtained initial interface node are filtered. Based on the above, the methods for filtering interface call chains provided in this specification can also be combined in any way to determine the interface call chain to be processed based on the combination. It should be understood that the embodiments provided in this specification do not limit the implementation method used to determine the interface call chain to be processed.

[0085] In one example, when the initial interface node corresponds to at least two interface call chains, each interface call chain can be filtered according to the chain determination parameters and the first preset quantity threshold, so as to further accurately determine the interface call chain to be processed.

[0086] In one or more embodiments provided in this specification, when the call chain of the interface to be processed is obtained, the code of the call chain to be processed corresponding to each call chain to be processed is obtained, including: Determine the initial processing link code corresponding to the initial processing interface call link, wherein the initial processing interface call link is any one of the processing interface call links; Obtain the number of service nodes in the initial pending interface call chain; If the number of nodes is greater than a second preset threshold, the initial link code to be processed is extracted based on preset rules to obtain the link code to be processed.

[0087] The second preset quantity threshold is less than the first preset quantity threshold. The second preset quantity threshold can be understood as a pre-set critical value used to determine whether the initial code to be processed needs to be truncated. The preset rules can be understood as rules used to retain the method code associated with the interface information corresponding to the initial interface node.

[0088] In one specific embodiment of this specification, each pending interface call chain is determined as an initial pending interface call chain. The corresponding initial pending chain code (i.e., complete code) is extracted from the initial interface call chain. This initial pending chain code contains the implementation logic and call relationships of all service nodes in the initial pending interface call chain. The number of service nodes in the initial pending interface call chain is counted, and the complexity of the initial pending interface call chain is measured based on the number of service nodes. If the number of service nodes exceeds a second preset threshold, the chain code of the initial pending interface call chain is considered too complex. In this case, the initial pending chain code is truncated according to preset rules to obtain the processed pending chain code.

[0089] In one example, taking a call chain to be processed containing 10 nodes (1 interface node and 9 method nodes) and a second preset quantity threshold of 6 as an example, the process of obtaining the code of the call chain to be processed is illustrated above.

[0090] It's important to understand that when the pending interface call chain contains 10 nodes, as mentioned above, the starting node is the initial interface node, and the ending node is the AI ​​service method node. Based on this, keeping the starting and ending nodes unchanged, each service node in the pending interface call chain is truncated according to a second preset threshold. For ease of understanding, with the second preset threshold set to 6 and the starting and ending nodes unchanged, 4 service nodes can be randomly truncated from the pending chain to simplify it. The processed pending chain code can then be extracted from the simplified pending chain. Furthermore, the first 5 service nodes and the last service node can also be retained to further simplify the pending chain.

[0091] According to one or more embodiments provided above in this specification, the filtered interface call chains to be processed are processed. When the link code corresponding to the obtained interface call chain to be processed is too long, the interface call chain to be processed is simplified according to a second preset number threshold, so that the second preset number threshold can be used to simplify the interface call chain to be processed while retaining the key method nodes, thereby improving the processing efficiency of the interface call chain to be processed.

[0092] S1066: If at least one link code to be processed meets the preset conditions, the initial interface node is determined to be the target interface node.

[0093] In one specific embodiment of this specification, when at least one pending link code meets preset conditions, it indicates that the pending link code conforms to the characteristics of the corresponding artificial intelligence service. Based on this, the initial interface node on the pending link corresponding to the pending link code is taken as the target interface node.

[0094] Among them, the preset conditions can be understood as the conditions under which the code to be processed and the AI ​​service call are related.

[0095] In one example, the preset condition could be whether the link code to be processed contains features of one or more dimensions corresponding to the auxiliary identification code information.

[0096] In another example, the preset condition could be to analyze whether the code to be processed contains code traces that call core logic such as AI models, model inference, and natural language processing.

[0097] It should be understood that the examples of the preset conditions mentioned above are not limited in this specification.

[0098] In one or more embodiments provided in this specification, the preset condition may be whether the code to be processed is an AI service call link after semantic analysis by a Large Language Model (LLM), and the determination method is as follows: Generate link prompt information based on the code of each link to be processed; The link hint information can be understood to include at least one of the following a)-c): a) The core content of the link code.

[0099] For example, it can be understood as the calling relationship between interfaces and methods, function implementation, parameter passing logic, etc.

[0100] b) Reference standards.

[0101] For example, it can be understood as a pre-defined list of AI service features, such as "whether it includes prompt building, model API calls, or natural language processing related code".

[0102] c) The target to be verified.

[0103] For example, it can be understood as "determining whether the link contains AI service call logic" or "identifying whether there is a method in the link that interacts with a large language model".

[0104] The link prompt information is input into the code analysis model, and based on the output of the code analysis model, it is determined whether the link code to be processed meets the preset conditions.

[0105] In one specific embodiment of this specification, for each link code to be processed, structured link hint information is constructed. This link hint information is then input into a code analysis model (e.g., a Large Language Model (LLM)). The code analysis model's ability to understand the semantics and logical relationships of the code is used to analyze the link code to be processed, thereby obtaining a judgment result on the link characteristics.

[0106] For example, the output of a code analysis model could be: This link contains API calls to the GPT model. Or, the output of a code analysis model could also be: There exists a method for constructing AI prompt words.

[0107] According to one or more embodiments provided above in this specification, a code analysis model is used to analyze the code to be processed. By utilizing the contextual understanding and reasoning capabilities of the code analysis model itself, the context of the code to be processed is analyzed, avoiding the phenomenon of missed detection due to the lack of initial interface node features caused by the existence of multi-level calls in the code to be processed, thereby improving the accuracy of identifying the initial interface node as the target interface node.

[0108] Step 108: Determine that the service interface corresponding to the target interface node is the artificial intelligence service interface.

[0109] In one specific embodiment of this specification, based on the target interface node obtained according to the above-described content, the service interface corresponding to the target interface node is determined as an artificial intelligence service interface.

[0110] According to one or more embodiments provided above in this specification, by parsing the application into a code level and constructing a method call graph at the code level, the logical relationship of interface calls between applications can be intuitively displayed. Furthermore, by judging service nodes in the method call graph, method nodes are identified as artificial intelligence service nodes. Based on this, by determining the interface call chain that has a call relationship with the artificial intelligence service node and the method for determining the target interface node, the method avoids missing interface nodes due to the lack of corresponding code characteristics, thus improving the accuracy of interface node detection.

[0111] To facilitate understanding of the above content, the following examples are used in this specification to illustrate the above content.

[0112] In one specific embodiment of this specification, based on code analysis capabilities, the code of Application 1, Application 2, and Application 3, which require determining whether an externally provided interface is an AI interface, is analyzed to construct a method call graph. The constructed method call graph is shown below. Figure 2 For example, this instruction manual will not elaborate further on this.

[0113] Based on the obtained method call graph, according to the preset auxiliary identification code information, the characteristics of the application to be judged at the code level are summarized, and then the method nodes that conform to the preset auxiliary identification code information are obtained.

[0114] In one example, the characteristics of the application to be judged at the code level are summarized as the characteristics of method x that is "if an interface calls a method x, then the interface is an AI application interface".

[0115] For example, the summary includes: methods that directly call the API of an AI service; methods used to prepare the prompt for AI service input; and methods used to construct the variables required for calling the AI ​​service.

[0116] The preset auxiliary recognition code information may include multiple dimensions. For specific dimensions, please refer to the content mentioned above in this manual, which will not be repeated here.

[0117] Based on the above, when the AI ​​service method node is identified as the method node corresponding to method 3, it is marked in the method call graph. Using the method node corresponding to method 3 marked in the method call graph as a basis, the interface node (such as interface node 1) that calls the corresponding node of method 3 is extracted from the graph database. Interface 1 is then identified as the AI ​​service interface.

[0118] To further confirm that Interface 1 is an artificial intelligence service interface, the code on the link corresponding to Interface Node 1 to Method Node 3 can be extracted and used to construct prompt words. These prompt words are then used as input to a code analysis model. The model is then analyzed, and the output is used to further determine that the code on the link corresponding to Interface Node 1 to Method Node 3 is an AI application call chain, thus confirming that Interface 1 is an artificial intelligence service interface.

[0119] Corresponding to the above method embodiments, this specification also provides embodiments of interface detection devices. Figure 3 This is a schematic diagram of an interface detection device provided in an embodiment of this specification. Figure 3 As shown, the device includes: The construction unit 302 is configured to construct a method call graph, wherein the method call graph includes service nodes and the call relationships between each service node, and the service nodes include method nodes and interface nodes.

[0120] The determining unit 304 is configured to determine the artificial intelligence service method node in each method node based on preset auxiliary recognition code information; determine the target interface node in the method call graph according to the calling relationship between the artificial intelligence service method node and each service node; and determine that the service interface corresponding to the target interface node is the artificial intelligence service interface.

[0121] Optionally, the determining unit 304 is further configured to: Based on the calling relationships between the AI ​​service method nodes and each service node, an initial interface node is determined in the method call graph, and an interface call chain is determined based on the initial interface node and the AI ​​service method node. Based on the initial interface node, at least one interface call chain to be processed is determined, and the code of the chain to be processed corresponding to each interface call chain is obtained; If at least one link code to be processed meets the preset conditions, the initial interface node is determined as the target interface node.

[0122] Optionally, the determining unit 304 is further configured to: Generate link prompt information based on the code of each link to be processed; The link prompt information is input into the code analysis model, and based on the output of the code analysis model, it is determined whether the link code to be processed meets the preset conditions.

[0123] Optionally, the determining unit 304 is further configured to: When the initial interface node corresponds to at least two interface call links, the link determination parameters corresponding to the initial interface node are determined. Based on the link determination parameters, determine the interface call link to be processed from at least two interface call links.

[0124] Optionally, the determining unit 304 is further configured to: In the case that the initial interface node corresponds to at least two interface call chains, determine the number of service nodes included in each interface call chain; Interface call chains with fewer than a first preset threshold number of nodes are identified as interface call chains to be processed.

[0125] Optionally, the determining unit 304 is further configured to: Determine the initial processing link code corresponding to the initial processing interface call link, wherein the initial processing interface call link is any one of the processing interface call links; Obtain the number of service nodes in the initial pending interface call chain; If the number of nodes is greater than the second preset number threshold, the initial link code to be processed is extracted based on preset rules to obtain the link code to be processed, wherein the second preset number threshold is less than the first preset number threshold.

[0126] Optionally, the determining unit 304 is further configured to: Obtain the code of the method to be processed corresponding to the method node to be processed, wherein the method node to be processed is any one of the method nodes; The code of the method to be processed is compared with the preset auxiliary identification code information; If the method code to be processed is successfully matched with the preset auxiliary identification code information, the method node to be processed is determined to be an artificial intelligence service method node.

[0127] Optionally, the building unit 302 is further configured to: Obtain at least one application to be processed, and obtain the corresponding interface information, method information and call relationship for each application to be processed; By using the interface information and method information as service nodes and the call relationship as edges between service nodes, a method call graph is constructed.

[0128] The above is a schematic scheme of an interface detection device according to this embodiment. It should be noted that the technical solution of this interface detection device and the technical solution of the interface detection method described above belong to the same concept. For details not described in detail in the technical solution of the interface detection device, please refer to the description of the technical solution of the interface detection method described above.

[0129] See Figure 4 , Figure 4 This is an architecture diagram of an interface detection system provided in an embodiment of this specification. The interface detection system may include a client 100 and a server 200. Client 100 is used to send an interface detection task to server 200, wherein the interface detection task is used to detect whether there is an artificial intelligence service interface in the application to be detected. Server 200 is used to construct a method call graph, wherein the method call graph includes service nodes and the call relationships between each service node, and the service nodes include method nodes and interface nodes; based on preset auxiliary identification code information, it determines whether an artificial intelligence service method node exists in each method node; if an artificial intelligence service method node exists, it determines the target interface node in the method call graph according to the artificial intelligence service method node and the call relationships between each service node, and determines that the interface detection result indicates that an artificial intelligence service interface exists in the application to be detected; if no artificial intelligence service method node exists, it determines that the interface detection result indicates that an artificial intelligence service interface does not exist in the application to be detected; and sends the interface detection result to client 100. Client 100 is also used to receive interface detection results sent by server 200.

[0130] By applying the solutions described in the embodiments of this specification, the artificial intelligence service interfaces that provide artificial intelligence services in an application can be accurately and quickly located.

[0131] The interface testing system may include multiple clients 100 and a server 200. Clients 100 can be referred to as edge devices, and server 200 can be referred to as cloud devices. Multiple clients 100 can establish communication connections through server 200. In the interface testing scenario, server 200 is used to provide interface testing services between multiple clients 100. Each client 100 can act as either a sender or a receiver, communicating through server 200.

[0132] Users can interact with server 200 through client 100 to receive data sent by other clients 100, or send data to other clients 100, etc. In the interface detection scenario, users can publish data streams to server 200 through client 100, and server 200 can determine the interface detection results based on the data streams and push the interface detection results to other clients that have established communication.

[0133] In this system, client 100 and server 200 establish a connection via a network. The network provides the medium for communication between client 100 and server 200. The network can include various connection types, such as wired or wireless communication links or fiber optic cables. Data transmitted by client 100 may need to undergo encoding, transcoding, compression, or other processing before being published to server 200.

[0134] Client 100 can be a browser, an app (application), a web application such as an H5 (HyperText Markup Language 5) application, a lightweight application (also known as a mini-program), or a cloud application. Client 100 can be developed based on the software development kit (SDK) of the corresponding service provided by server 200, such as a real-time communication (RTC) SDK. Client 100 can be deployed on a computing device and depends on the device or certain apps on the device to run. The computing device may have a display screen and support information browsing, such as a personal mobile terminal like a mobile phone, tablet, or personal computer. Various other types of applications can also be configured on the computing device, such as human-computer interaction applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, and social media platform software.

[0135] Server 200 may include servers providing various services, such as servers providing communication services to multiple clients, servers supporting backend training of models used on clients, and servers processing data sent by clients. It should be noted that server 200 can be implemented as a distributed server cluster composed of multiple servers, or as a single server. The server can also be a server in a distributed system, or a server integrated with blockchain. The server can also be 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, content delivery networks (CDNs), and big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.

[0136] It is worth noting that the interface detection method provided in the embodiments of this specification is generally executed by the server. However, in other embodiments of this specification, the client may also have similar functionality to the server, thereby executing the interface detection method provided in the embodiments of this specification. In other embodiments, the interface detection method provided in the embodiments of this specification may also be executed jointly by the client and the server.

[0137] Figure 5 A structural block diagram of a computing device according to an embodiment of this application is shown. The components of the computing device 500 include, but are not limited to, a memory 510 and a processor 520. The processor 520 is connected to the memory 510 via a bus 530, and a database 550 is used to store data.

[0138] The computing device 500 also includes an access device 540, which enables the computing device 500 to communicate via one or more networks 560. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 540 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.

[0139] In one embodiment of this application, the aforementioned components of the computing device 500 and Figure 5 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 5 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this application. Those skilled in the art can add or replace other components as needed.

[0140] The computing device 500 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 500 can also be a mobile or stationary server.

[0141] The processor 520 is used to execute the following computer program / instructions, which, when executed by the processor, implement the steps of the interface detection method described above.

[0142] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the interface detection method described above belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the interface detection method described above.

[0143] An embodiment of this specification also provides a computer-readable storage medium storing a computer program / instructions that, when executed by a processor, implement the steps of the interface detection method described above.

[0144] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on its differences from other embodiments. In particular, the computer-readable storage medium embodiments are basically similar to the interface detection method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the interface detection method embodiments.

[0145] An embodiment of this specification also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the interface detection method described above.

[0146] The above is an illustrative scheme of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the interface detection method described above belong to the same concept. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solution of the interface detection method described above.

[0147] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for the embodiments of apparatus, devices, and systems, since they are basically similar to the method embodiments, the descriptions are relatively simple, and relevant parts can be referred to the descriptions of the method embodiments. The apparatus, devices, systems, and methods provided in the embodiments of this specification correspond to each other; therefore, the apparatus, devices, and systems also have similar beneficial technical effects to the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the corresponding apparatus, devices, and systems will not be repeated here.

[0148] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0149] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program a digital system themselves to "integrate" it onto a PLD, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must also be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also understand that by simply performing some logic programming on the method flow using one of these hardware description languages ​​and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.

[0150] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.

[0151] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0152] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.

[0153] Those skilled in the art will understand that one or more embodiments of this specification can be provided as a method, system, or computer program product. Therefore, the invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0154] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0155] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0156] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0157] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0158] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0159] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital character versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0160] This application can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. 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.

[0161] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. An interface detection method, comprising: Construct a method call graph, wherein the method call graph includes service nodes and the call relationships between each service node, and the service nodes include method nodes and interface nodes; The artificial intelligence service method node is determined in each method node based on the preset auxiliary recognition code information; Based on the AI ​​service method node and the calling relationship between each service node, the target interface node is determined in the method call graph; The service interface corresponding to the target interface node is determined to be the artificial intelligence service interface.

2. The method as described in claim 1, wherein determining the target interface node in the method call graph based on the call relationship between the artificial intelligence service method node and each service node includes: Based on the calling relationships between the AI ​​service method nodes and each service node, an initial interface node is determined in the method call graph, and an interface call chain is determined based on the initial interface node and the AI ​​service method node. Based on the initial interface node, at least one interface call chain to be processed is determined, and the code of the chain to be processed corresponding to each interface call chain is obtained; If at least one link code to be processed meets the preset conditions, the initial interface node is determined as the target interface node.

3. The method of claim 2, further comprising: Generate link prompt information based on the code of each link to be processed; The link prompt information is input into the code analysis model, and based on the output of the code analysis model, it is determined whether the link code to be processed meets the preset conditions.

4. The method as described in claim 2, wherein determining at least one interface call chain to be processed based on the initial interface node, includes: When the initial interface node corresponds to at least two interface call links, the link determination parameters corresponding to the initial interface node are determined. Based on the link determination parameters, determine the interface call link to be processed from at least two interface call links.

5. The method as described in claim 2, wherein determining at least one interface call chain to be processed based on the initial interface node includes: When the initial interface node corresponds to at least two interface call chains, determine the number of service nodes included in each interface call chain; Interface call chains with fewer than a first preset threshold number of nodes are identified as interface call chains to be processed.

6. The method described in any one of claims 1-5, comprising obtaining the code of the processing link corresponding to each processing interface call link, including: Determine the initial processing link code corresponding to the initial processing interface call link, wherein the initial processing interface call link is any one of the processing interface call links; Obtain the number of service nodes in the initial pending interface call chain; If the number of nodes is greater than the second preset number threshold, the initial link code to be processed is extracted based on preset rules to obtain the link code to be processed, wherein the second preset number threshold is less than the first preset number threshold.

7. The method as described in claim 1, wherein determining the artificial intelligence service method node in each method node based on preset auxiliary recognition code information includes: Obtain the code of the method to be processed corresponding to the method node to be processed, wherein the method node to be processed is any one of the method nodes; The code of the method to be processed is compared with the preset auxiliary identification code information; If the method code to be processed is successfully matched with the preset auxiliary identification code information, the method node to be processed is determined to be an artificial intelligence service method node.

8. The method as described in claim 1, comprising constructing a method call graph, including: Obtain at least one application to be processed, and obtain the corresponding interface information, method information and call relationship for each application to be processed; By using the interface information and method information as service nodes and the call relationship as edges between service nodes, a method call graph is constructed.

9. An interface testing device, comprising: The building unit is configured to build a method call graph, wherein the method call graph includes service nodes and the call relationships between each service node, and the service node includes method nodes and interface nodes; The determining unit is configured to determine the artificial intelligence service method node in each method node based on preset auxiliary recognition code information; Based on the AI ​​service method node and the calling relationship between each service node, the target interface node is determined in the method call graph; The service interface corresponding to the target interface node is determined to be the artificial intelligence service interface.

10. A computing device, comprising: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, which, when executed by the processor, implement the steps of the method according to any one of claims 1 to 8.

11. A computer-readable storage medium storing a computer program / instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 8.

12. A computer program product comprising a computer program / instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 8.