Computing Card Programming Interface Identification Method and Electronic Device
By acquiring and matching the prefix names and mapping relationships of the calling functions of the computing card programming interface, the accuracy and efficiency problems of computing card interface identification in the prior art are solved, making it suitable for embedded devices and edge computing scenarios.
Patent Information
- Application Number
- CN202511167820.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-20
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-08-20
AI Technical Summary
Existing methods for identifying computing card programming interfaces cannot fully capture dynamic link libraries and runtime-loaded computing card interfaces, and dynamic tracing tools record redundant data and lack targeted filtering capabilities.
By obtaining the mapping relationship between the target application's calling functions and their prefix names and the computing card's programming interface, and using the calling relationship and preset calling relationship templates for matching, the target computing card's programming interface can be determined, thereby improving the accuracy and efficiency of identification.
It achieves efficient and accurate identification of programming interfaces for different computing cards, making it suitable for embedded devices and edge computing scenarios while reducing resource consumption.
Smart Images

Figure CN120670269B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, specifically to a method for identifying a computing card programming interface and an electronic device. Background Technology
[0002] In fields such as deep learning, scientific computing, and graphics rendering, computing cards significantly improve program performance by providing parallel computing capabilities. Computing cards interact with applications through dedicated application programming interfaces, and it is necessary to monitor and analyze the application's calls to the computing card in order to optimize performance, troubleshoot compatibility issues, or verify hardware resource utilization.
[0003] Currently, monitoring methods are mainly divided into static code analysis and dynamic tracing tools. Static code analysis cannot fully capture dynamic link libraries and runtime loaded computing cards, while dynamic tracing tools usually record all system calls or function calls, which can easily lead to log redundancy and lack the ability to target and filter computing cards. Summary of the Invention
[0004] In view of the above problems, this application provides a computing card programming interface identification method and electronic device to improve the capture accuracy.
[0005] The first aspect of this application provides a method for identifying a computing card programming interface, comprising: acquiring call relationships among multiple call functions associated with the execution process of a target application and mapping relationships between prefix names of the multiple call functions and multiple computing card programming interfaces; determining at least one first target call function from the multiple call functions whose prefix name is a target prefix name; using the call relationships, determining target call information of the at least one first target call function, wherein the target call information indicates at least one second target call function that has a call relationship with the at least one first target call function, and the execution order of the at least one first target call function and the at least one second target call function; matching the target call information with a preset call relationship template to determine the matching degree between the at least one first target call function and historical call functions, wherein the preset call relationship template includes historical call information of historical call functions corresponding to the multiple computing card programming interfaces; and determining the target computing card programming interface corresponding to the at least one target prefix name from the multiple computing card programming interfaces based on the mapping relationships and the matching degree.
[0006] A second aspect of this application provides an electronic device, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.
[0007] The computing card programming interface identification method based on the embodiments of this application extracts the prefix names of multiple called functions, determines the corresponding computing card programming interface from the running process of the target application based on the mapping relationship between the prefix names and the computing card programming interface, and then matches the calling information of the computing card programming interface with historical calling information. This can automatically distinguish different computing card programming interfaces used in different platforms, improve the efficiency and accuracy of identifying different computing card programming interfaces, be compatible with mainstream computing card platforms, be suitable for embedded devices and edge computing scenarios, and reduce resource consumption. Attached Figure Description
[0008] The above-mentioned contents, other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0009] Figure 1 This illustration schematically depicts an application scenario of a computing card programming interface identification method and an electronic device according to embodiments of this application.
[0010] Figure 2 A flowchart illustrating a computing card programming interface identification method according to an embodiment of this application is shown schematically.
[0011] Figure 3 The diagram illustrates a block diagram of processing a called function to determine a target called function according to an embodiment of this application.
[0012] Figure 4 A block diagram illustrating the determination of a target computing card programming interface based on a programming interface call log according to an embodiment of this application is shown schematically.
[0013] Figure 5 This schematically illustrates an overall block diagram of a computing card programming interface identification method according to an embodiment of this application;
[0014] Figure 6 A block diagram of a computing card programming interface identification device according to an embodiment of this application is shown schematically;
[0015] Figure 7 A block diagram schematically illustrates an electronic device suitable for implementing a computing card programming interface identification method according to an embodiment of this application. Detailed Implementation
[0016] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.
[0017] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0018] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0019] When expressions such as "at least one of A, B, and C, etc." are used, they should generally be interpreted in accordance with the meaning commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0020] In the technical solution of this application, the user information (including but not limited to user personal information, user image information, user device information, such as location information) and data (including but not limited to data used for analysis, stored data, and displayed data) involved are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of related data all comply with relevant laws, regulations, and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entry points for users to choose to authorize or refuse.
[0021] Figure 1 The illustration shows an application scenario diagram of a computing card programming interface identification method and an electronic device according to embodiments of this application.
[0022] like Figure 1 As shown, a server may include one or more ( Figure 1Only one is shown in the image. A processor 102 (which may include, but is not limited to, a microprocessor (MCU) or a field-programmable gate array (FPGA)) and a memory 104 for storing data are also shown. The server may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the server described above. For example, the server may also include components that are more complex than... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0023] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the link congestion control method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thus implementing the aforementioned method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0024] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the computer terminal. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0025] The computing card programming interface identification method in this embodiment can be executed by a server. Here, the server refers to the entire server, including the relevant components and processors within the server that need to execute the computing card programming interface identification method. Alternatively, the computing card programming interface identification method in this embodiment can be executed by the processor 102. In this embodiment, the process of obtaining the called function and the function name of the called function through the programming interface call log can be executed by the memory 104. In some examples of this embodiment, the computing card programming interface identification method is described using the execution of the server as an example.
[0026] The computing card programming interface identification method in this embodiment can be applied to different platforms that are compatible with computing card programming interfaces. It is suitable for embedded devices and edge computing scenarios. Through prefix matching rules, it can accurately intercept the called functions in different devices and obtain the information of the computing card programming interface corresponding to the called functions.
[0027] The following will be based on Figure 1 The described scene, through Figures 2-5 The computing card programming interface identification method of the present application embodiment will be described in detail.
[0028] Figure 2 A flowchart illustrating a computing card programming interface identification method according to an embodiment of this application is shown schematically.
[0029] like Figure 2 As shown, the computing card programming interface identification method of this embodiment includes operations S210 to S250.
[0030] In operation S210, the call relationships between multiple call functions associated with the target application's execution process are obtained, as well as the mapping relationship between the prefix names of the multiple call functions and the programming interfaces of multiple computing cards.
[0031] According to embodiments of this application, the computing card programming interface is a programming interface used for interacting with the computing card. Different computing cards can provide corresponding computing card programming interfaces. The called function can refer to a computing card programming interface function, typically provided by the computing card's programming framework, used for managing computing resources, performing parallel computing, or processing data transmission. A call refers to the process where the calling function of the caller triggers the execution of the calling function of the callee; a call relationship means that multiple calling functions can call each other. The calling function can access hardware or privileged resources through the operating system kernel.
[0032] There can be direct and indirect calls between multiple function calls. If function A calls function B, and function B calls function C, then the call between function A and function B is a direct call, while the call between function A and function C is an indirect call. Based on direct and indirect calls, the calling relationships between multiple function calls can be determined.
[0033] Different computing card programming interfaces can integrate at least one calling function. Multiple calling functions corresponding to each computing card programming interface can have the same prefix name, while calling functions corresponding to different computing card programming interfaces can have different prefix names. Therefore, the prefix names of different calling functions can be directly associated with the computing card programming interface to which that calling function belongs; that is, there is a mapping relationship between the prefix names of calling functions and the computing card programming interfaces.
[0034] Applications can invoke the parallel computing capabilities of the computing card by calling the functions provided by the computing card's programming interface to perform related tasks. The target application can be any application that invokes the computing card to complete a target task by calling the functions provided by the computing card's programming interface.
[0035] For example, when the function call is "cudaMemcpy", the "cuda" prefix directly maps to the "CUDA (Compute Unified Device Architecture)" programming interface for the computing card, indicating that "cudaMemcpy" can be used for data transfer functions in the graphics processor. As another example, when the function call is "clMemcpy", the "cl" prefix maps to the "Parallel Computing Framework" programming interface for the computing card, indicating that "clMemcpy" is the function for parallel computing.
[0036] In operation S220, at least one target calling function with the prefix name of the target prefix name is determined from a plurality of calling functions.
[0037] According to embodiments of this application, multiple function calls in the obtained target application can be processed to determine the prefix name of each function call. Multiple prefix names are filtered using preset filtering rules to obtain a target prefix name. The filtering rules may include the desired target prefix name. Each function call's prefix name is checked; if the detected prefix name matches the target prefix name, the current function call is used as the target function call; if the detected prefix name does not match the target prefix name, a new function call is checked to determine at least one final target function call.
[0038] For example, the target prefix name can be cu, __cu, cn, __cn, Cu, __Cu, Cn or __Cn, etc., and the calling function with the prefix name cu, __cu, cn, __cn, Cu, __Cu, Cn or __Cn is determined as the target calling function.
[0039] In operation S230, the target call information of at least one first target call function is determined by utilizing the call relationship.
[0040] The target call information indicates at least one second target call function that has a call relationship with at least one first target call function, and the execution order of at least one first target call function and at least one second target call function.
[0041] For example, if the first target function is called by function B, or the first target function calls function C, then function B or function C can be a second target function that has a calling relationship with the first target function. The execution order is: first, function B is executed; then, the first target function is executed; and finally, function C is executed.
[0042] In operation S240, the target call information is matched with the preset call relationship template to determine the matching degree between at least one first target call function and the historical call function.
[0043] The preset call relationship template includes historical call information for functions that exist in multiple computing card programming interfaces. The historical call functions and historical call information can be "usage records" generated by multiple computing card programming interfaces during historical use.
[0044] Historical function calls can be functions that directly or indirectly called the computing card programming interface during the execution of previous applications. Historical call information can be the execution order of multiple historical function calls, or it can be which functions called historical functions, and which functions were called by those historical functions.
[0045] The target call information is compared with the historical call functions or historical call information in the preset call relationship template to determine the matching degree between at least one first target call function and the historical call function.
[0046] In operation S250, using mapping relationships and matching degrees, the target computing card programming interface corresponding to at least one target prefix name is determined from multiple computing card programming interfaces.
[0047] According to an embodiment of this application, since the mapping relationship between the prefix names of the called functions and the programming interfaces of the computing card has already been obtained, after determining the target prefix name, the target prefix name can be matched with multiple prefix names stored in the mapping relationship. Then, based on the mapping relationship, the computing card programming interface corresponding to the matched target prefix name can be directly determined as the target computing card programming interface. During matching, the priority of matching the prefix names of multiple called functions can be predetermined, and the prefix names of different called functions in the rule base can be matched with the target prefix name according to the matching order specified by the priority.
[0048] The computing card programming interface identification method based on embodiments of this application extracts the prefix names of multiple function calls, determines the corresponding computing card programming interface from the target application's runtime based on the mapping relationship between the prefix names and the computing card programming interface, and then matches the calling information of the computing card programming interface with historical calling information. This automatically distinguishes different computing card programming interfaces used on different platforms, improving the efficiency and accuracy of identifying different computing card programming interfaces. It is compatible with mainstream computing card platforms, suitable for embedded devices and edge computing scenarios, and can accurately identify the actual computing card programming interface called in multiple function calls.
[0049] In the embodiments of this application, obtaining multiple call functions associated with the target application's execution process in operation S210 can take various forms. In practice, one of multiple methods can be used to obtain the call functions, or multiple methods can be used simultaneously to obtain the call functions separately, and then the call functions obtained by the multiple methods can be merged to obtain the final call function.
[0050] The following describes various ways to obtain the called function with specific examples.
[0051] In some embodiments of this application, one way to obtain the calling functions is to: insert a preset command line into the execution instruction, and use the preset command line to specify the executable path of the target application; trace the running process of the target application based on the executable path, and obtain multiple calling functions associated with the running process of the target application.
[0052] To put the target application into a running state, the operating system located on the server hardware can be initialized. After successful initialization, the operating system begins parsing the executable file and sends execution instructions to the processor 102. The processor 102 determines the memory allocation space for the executable file, sets the registers in the processor 102, and determines the execution order of multiple target applications in the executable file. After the settings are completed, the processor 102 begins executing the application code and starts the target application.
[0053] After the target application is launched, custom execution logic can be inserted into the target application to intervene in, modify, and replace the calling function of the computing card programming interface corresponding to the calling function, thereby tracing the running process of the target application to obtain multiple calling functions associated with the running process of the target application.
[0054] Preset command lines can be inserted into the execution instructions. These preset command lines can be executed through library function call tools. The executable path and tracing parameters of the target application can be specified through the command line, and the tracing mode can be defined. Different tracing modes can be used for target applications in different scenarios to obtain multiple call functions associated with the execution process of the target application.
[0055] For example, the default command line can be hook code. The download command can be edited in the custom execution logic of the hook code. The download command can modify the export paths of multiple call functions associated with the target application during its operation, and monitor and trace multiple call functions.
[0056] The download command can be a GET request. Sending a GET request in the command line and capturing the functions traced within the GET request allows you to obtain multiple function calls associated with the target application's execution process. When analyzing deep learning training scripts, you can configure the download command to only trace the call chain related to deep learning, ignoring system background processes.
[0057] GET requests can also capture detailed information about the executable path of the traced function, including request headers, request parameters, and response status codes.
[0058] The computing card programming interface identification method based on the embodiments of this application can directly associate with the specified executable file through the preset command line, avoiding the analysis of irrelevant processes. Different tracking parameters can quickly switch the analysis dimension. The structured results output by the command line can be directly embedded into the CI (Continuous Integration) or CD (Continuous Deployment) process. The output format is consistent and supports cross-platform detection.
[0059] In some other embodiments of this application, another way to obtain the called functions is to determine the process identifier of the target application's running process, track the running process of the target application through the process identifier, and obtain multiple called functions associated with the running process of the target application.
[0060] A PID (Process Identifier) is a unique numerical identifier assigned by the operating system to each running process, used for system kernel management and inter-process communication. After the operating system sends an execution instruction to the processor 102, the target application's running process is created and assigned a unique PID. Once the PID of the target application is determined, the operating system can use the PID to track the process resources of the target application's running process and determine the execution path of the target application.
[0061] For example, the target application's process can be dynamically and directly inserted into the hook code, and then a trace signal can be sent to the process identifier to trace the functions in the target application's running process and obtain multiple function calls associated with the target application's running process.
[0062] The computing card programming interface identification method based on the embodiments of this application can avoid analyzing erroneous applications when multiple identical applications are running simultaneously by using process identifiers. It can also perform real-time dynamic analysis and start tracing without restarting the application, making it suitable for production environment diagnosis. It can be directly attached to the running process without modifying the target program code or recompiling.
[0063] In some other embodiments of this application, another way to obtain the called function is to insert a preset command line into the operating system's execution instructions, and after the target application is started, the operating system assigns a unique PID to the target application.
[0064] The target application can output relevant information about the called function through a preset command line, then filter the relevant information about the called function by PID, and merge the called functions obtained through the preset command line and by PID to obtain the final called function.
[0065] The computing card programming interface identification method based on the embodiments of this application can achieve function call tracing without modifying the source code of the target application or recompiling it, and is especially suitable for closed-source software or systems that are inconvenient to refactor.
[0066] In the embodiments of this application, after tracing multiple call functions of the target application through the above two methods (preset command line or based on PID), a preset callback function can be used to intercept the call process of the traced target application and obtain relevant information of multiple call functions. The relevant information may include, for example, the function name, the prefix of the function name, the call relationship, etc.
[0067] The following is a detailed description with reference to specific embodiments.
[0068] In the embodiments of this application, the execution process of the tracked target application is intercepted to obtain a programming interface call log. The call relationships between multiple called functions and the function names of multiple called functions are obtained from the programming interface call log. The function names of the multiple called functions are processed to obtain the prefix names of the multiple called functions.
[0069] The above hook code includes a pre-defined callback function, which is used to intercept the calls to multiple tracked functions.
[0070] The following combination Figure 3 The process of handling multiple function calls after call interception is described in detail.
[0071] Figure 3 The diagram illustrates a block diagram of processing a called function to determine a target called function according to an embodiment of the present application.
[0072] like Figure 3 As shown, the process of determining the target function in this embodiment includes processing the function names of multiple intercepted function calls to obtain prefix names of multiple function calls. Preserving prefix names that are the target prefix names and ignoring prefix names that are not the target prefix names.
[0073] For example, if a function A is predefined and passed to a calling function B, when calling function B, function A will be automatically invoked to intercept the calling function B. This function A refers to the callback function.
[0074] In the hook code, a callback function is set up. By utilizing the logging mechanism in the hook code, detailed execution logs are output for each function call during the target application's execution. After the function call is completed, it returns normally, preserving the stack call relationship of the function call. The logic of the original computing card programming interface is not changed. The execution logs of multiple function calls are organized to generate a programming interface call log.
[0075] After generating the programming interface call log, the call relationship between multiple calling functions and the function name of each calling function are determined based on the programming interface call log. The function name of each calling function is then processed to obtain the prefix name of each calling function.
[0076] The programming interface call log can provide information such as the function name, call timestamp, call hierarchy, and thread ID (identity document). The call timestamp can be used to analyze the timing of different function calls, the call hierarchy can be used to analyze the nesting level of the called functions in the call stack, and the thread ID can be used to distinguish the source of the call in a multi-threaded environment.
[0077] The computing card programming interface identification method based on this application intercepts function calls during target application runtime using callback functions, thus avoiding the omission of dynamically loaded symbols in function calls during static analysis. The generated programming interface call logs can be integrated with monitoring system processes to observe function call activity in real time.
[0078] In the embodiments of this application, after obtaining multiple called functions and their names from the programming interface call log, the function names are processed in various ways. In practice, one of the various methods can be used to process the function names to obtain the prefix names of the multiple called functions.
[0079] The following section describes one method for processing function names using specific examples.
[0080] In an embodiment of this application, one method for processing function names is to use regular expression matching to process the function names of multiple function calls, where the multiple function names include multiple characters. The type of the multiple characters is determined using regular expressions, and based on the type of the multiple characters, the prefix name of the multiple function calls is obtained.
[0081] For example, character types include uppercase letters, lowercase letters, numbers, underscores, and special symbols.
[0082] Regular expression matching is a technique that uses regular expressions to perform pattern matching, searching, replacing, or extraction on strings. A regular expression is a "pattern string" composed of special symbols and ordinary characters, which defines specific matching rules for characters, used to extract specific content from multiple characters. It can read generated programming interface call logs to obtain the function names of multiple called functions. Based on regular expressions and specific matching rules, it can determine whether characters of different character types meet a certain format. Specific parts of characters that meet the format can be extracted to obtain the prefix names of multiple called functions.
[0083] For example, the format of characters in function names includes camelCase, underscore-separated, double colon qualifier, and mixed format.
[0084] In the embodiments of this application, after determining the type of multiple characters using regular expressions, determining the prefix name of the called function based on the character type can include various forms. In practice, one of several methods can be used to determine the prefix name of the called function.
[0085] The following examples illustrate various ways to determine the prefix name of a called function based on the format of different character types.
[0086] In embodiments of this application, when the format of characters in the function name is underscore-separated, one way to determine the prefix name of the called function is as follows: After determining the type of multiple characters using regular expressions, obtain multiple prefix names of the called function based on the types of the multiple characters. The types of the multiple characters include letter type and separator type. Based on the types of the multiple characters, determine at least one first character of letter type and at least one second character of separator type from the multiple characters. Based on the order of appearance of at least one second character in the programming interface call log, determine a second target character from at least one second character; according to the positional relationship between at least one first character and the second target character, determine a first target character from at least one first character, and use the first target character as the prefix name of the called function.
[0087] Different types of characters can be categorized and stored, recording the position and value of the characters. By default, four letters are used, and the first character can be the four consecutive letters preceding the second character.
[0088] For example, character types also include invalid types. Characters of letter type are the core identifier of the programming interface of the computing card. Characters of separator type are used to mark the boundaries of the prefix name. Characters of invalid type can be directly filtered out and not analyzed.
[0089] The function name can be checked for separators, and the function name can be split into a first character and a second character according to the separator. The second target character is determined based on the order of appearance of the second character in the programming interface call log. The first target character whose position is next to the second target character is used as the prefix name of the called function.
[0090] You can determine if a function name contains an underscore, split the function name by the underscore, and take the first character before the underscore as the prefix name for multiple function calls.
[0091] For example, if the function name is "cu_alloc_buffer", and the underscore "_" is used as a prefix boundary, then the prefix name of "cu_alloc_buffer" is "cu".
[0092] The computing card programming interface identification method based on the embodiments of this application determines the prefix name of different called functions by character type, which can accurately distinguish similar prefixes of different function names. By the order of characters appearing in the programming interface call log and the positional relationship between different characters, the prefixes of different function names can be correctly obtained, avoiding the misjudgment of version numbers as prefixes. It supports mixed recognition of multiple types of separators, automatically filters invalid characters, dynamically analyzes character types to determine prefix boundaries, and can adapt to different naming styles of function names.
[0093] In the embodiments of this application, when the format of the characters in the function name is camelCase, another way to determine the prefix name of the called function is to use the conversion position between uppercase and lowercase characters as the boundary of the prefix. For example, when the function name of the called function is "cudaMemcpy", the lowercase character "a" and the uppercase character "M" can be used as the prefix boundary to determine that the prefix name of "cudaMemcpy" is "cuda".
[0094] In the embodiments of this application, when the format of the characters in the function name is double colon qualifying, another way to determine the prefix name of the called function is to use the position of the double colon as the prefix boundary.
[0095] For example, a double colon at the beginning of a function name, such as "::function", indicates that the called function has no prefix. A double colon in the middle of a function name has two possibilities: either at least two double colons, such as "A::B::foo", which determines that the prefix of "A::B::foo" is "A::B"; or a single double colon, such as "B::foo", which determines that the prefix of "B::foo" is "B".
[0096] In the embodiments of this application, when the format of characters in the function name is mixed, another way to determine the prefix name of the called function can be: using the position of numbers or underscores as the prefix boundary.
[0097] For example, if a number follows an underscore, such as in the function name "ModuleA_func1", then "ModuleA_func1" will be prefixed with "ModuleA". If a number precedes an underscore, such as in the function name "Lib2_doTask", then "Lib2_doTask" will be prefixed with "Lib2". If only numeric characters precede the underscore, the function name will not have a prefix.
[0098] In the embodiments of this application, determining the mapping relationship between the prefix names of multiple called functions and the multiple computing card programming interfaces in operation S210 can include various forms. In actual operation, one of several methods can be used to determine the mapping relationship between the prefix names of multiple called functions and the multiple computing card programming interfaces.
[0099] The following describes various methods for determining the mapping relationship between the prefix names of multiple called functions and multiple computing card programming interfaces, using specific examples.
[0100] In the embodiments of this application, one way to determine the mapping relationship between the prefix names of multiple called functions and multiple computing card programming interfaces is to use regular expressions to match multiple prefix names and map the matched prefix names to multiple computing card programming interfaces according to preset mapping rules.
[0101] The prefix name is matched with multiple prefix names stored in the mapping relationship. Regular expressions are used to determine the priority of multiple prefix names, and the prefix name with the highest priority is matched first. This can be directly mapped to the computing card programming interface, and the prefix names are matched one by one according to priority. If the match fails, fuzzy matching is performed on the prefix names that fail to match. Fuzzy matching is used to compare two or more characters and handle inconsistencies between different characters.
[0102] The priority of a prefix name that matches multiple prefix names stored in the mapping relationship is greater than the priority of a prefix name that matches multiple prefix names stored in the mapping relationship after processing, which is greater than the priority of a prefix name that does not match multiple prefix names stored in the mapping relationship after processing.
[0103] For example, fuzzy matching is performed on prefix names to determine wildcards and edit distances. Prefix names that are spelling errors or case variations are processed. If the edit distance of the fuzzy matched prefix name is less than or equal to 2, matching can be performed again. Prefix names with an edit distance greater than 2 are marked as unknown.
[0104] For example, for prefixes that are misspelled, the number of character errors must be within 2 characters.
[0105] The computing card programming interface identification method based on the embodiments of this application improves the efficiency and accuracy of prefix name mapping to computing card programming interfaces by prioritizing different prefix names through regular expression matching, accurately determines the required computing card programming interface, and reduces the volume of programming interface call logs by more than 90%.
[0106] In an embodiment of this application, another way to determine the mapping relationship between the prefix names of multiple called functions and multiple computing card programming interfaces is as follows: if the multiple matched prefix names are not in the preset mapping rules, the parameter information of the obtained called functions is parsed to determine the mapping relationship between the prefix names of multiple called functions and multiple computing card programming interfaces, and the preset mapping rules can be updated; the updated mapping rules are used to map the multiple matched prefix names to multiple computing card programming interfaces.
[0107] By using the programming interface call log, query the call stack of the function that contains the above-mentioned unknown prefix name, determine whether it is associated with the known prefix name, and determine the actual computing card programming interface called by the unknown prefix name through the association relationship with the known prefix name, and automatically update the mapping rules.
[0108] The computing card programming interface identification method based on the embodiments of this application processes unknown prefixes, automatically learns the mapping rules of the prefixes, and dynamically updates the mapping rules, which can improve the response speed of mapping, adapt to the computing card programming interface corresponding to new hardware, and be compatible with different testing frameworks.
[0109] In embodiments of this application, the method for determining at least one second target calling function that has a calling relationship with at least one first target calling function in operation S230 can include various forms. In practice, one of these various methods can be used to determine the second target calling function.
[0110] The following describes one method for determining the second target calling function with specific examples.
[0111] In an embodiment of this application, one way to determine the second target calling function is to: use a calling function that actively calls at least one first target calling function or is called by at least one first target calling function as at least one second target calling function; use a calling function whose output parameter is the input parameter of at least one first target calling function or whose input parameter is the output parameter of at least one target calling function as at least one second target calling function.
[0112] The input parameters can be the data provided to the function that calls the first target for processing, and the output parameters can be the processing results output by the function that calls the first target for processing the data.
[0113] For example, if target function E is the first target function, and the return value of target function D is the parameter of target function E, then target function D can be the second target function; if the output of target function D is passed to target function F, processed by target function F, and then passed to target function E, then both target function F and target function G can be the second target function.
[0114] The computing card programming interface identification method based on the embodiments of this application verifies interface adaptability by analyzing the execution order of different calling functions and the data flow between calling functions, thereby improving the accuracy of determining the target computing card programming interface.
[0115] In embodiments of this application, the method for determining the matching degree between at least one first target calling function and the historical calling function in operation S240 can include various forms. In practice, one of the various methods can be used to determine the matching degree between at least one first target calling function and the historical calling function.
[0116] The following describes one method for determining the matching degree with specific examples.
[0117] In the embodiments of this application, the second target calling function is matched with the historical calling function, and the execution order is matched with the execution order of the historical calling function to determine the function matching rate and the order matching rate of at least one first target calling function; the function matching rate and the order matching rate are weighted and summed to determine the matching degree between at least one target calling function and the historical calling function.
[0118] For example, if there are 10 historical function calls, and the second target function is the same as one of these 10 historical function calls, then the function matching rate can be considered 100%. If there are 20 possible execution orders for the historical function calls, and the execution order between the first and second target function calls is the same as the execution order of the historical function calls in 19 of these cases, then the order matching rate can be considered 95%.
[0119] For example, if the function weight of the function matching rate is set to 0.4 and the order weight of the order matching rate is set to 0.6, then the matching degree between at least one target calling function and the historical calling function is the sum of the product of the function matching rate and the function weight and the product of the order matching rate and the order weight, and the calculated matching degree is 97%.
[0120] The computing card programming interface identification method based on the embodiments of this application determines the matching degree by weighted summation of function matching rate and sequence matching rate, realizing dual verification of "function entity similarity" and "execution logic consistency". This not only ensures the comprehensiveness and accuracy of matching evaluation, but also adapts to the needs of different scenarios through weight adjustment, which can significantly improve the reliability and efficiency of computing card programming interface selection.
[0121] In the embodiments of this application, the process of determining the target computing card programming interface corresponding to the target prefix name from multiple computing card programming interfaces in operation S250 can include various forms. In practice, one of several methods can be used to determine the target computing card programming interface.
[0122] The following describes one method for determining the programming interface of a target computing card, using specific embodiments as examples.
[0123] In an embodiment of this application, one way to determine the target computing card programming interface is to: obtain multiple initial computing card programming interfaces corresponding to multiple target prefix names, store the multiple initial computing card programming interfaces in a hash table, and use the hash table to remove duplicates from the multiple initial computing card programming interfaces to obtain the target computing card programming interface.
[0124] The following is combined Figure 4 The process of determining the programming interface of the target computing card is described in detail.
[0125] Figure 4 The diagram illustrates a block diagram of determining the target computing card programming interface based on the programming interface call log according to an embodiment of this application.
[0126] like Figure 4 As shown, this embodiment determines the target computing card programming interface based on the programming interface call log by reading the generated programming interface call log line by line to obtain the function names of multiple called functions. Regular expressions are then used to process the function names to obtain the prefix names of the multiple called functions. The initial computing card programming interface is determined based on the prefix names and stored. Since there may be computing card programming interfaces with duplicate names among the multiple called functions, the stored initial computing card programming interfaces are deduplicated and sorted to obtain the target computing card programming interface and output the result.
[0127] Line-by-line reading reads and processes log information line by line, according to the natural line division of the log content called through the programming interface, until all lines of the entire log have been processed. An input line refers to a line of data or text content, separated by newline characters, passed in through the programming interface call to the log.
[0128] Hash chains can be generated based on the characteristics of different computing card programming interfaces. These hash chains are then stored in a hash table, and the time complexity of insertion and query operations in the hash table is O(1). Automatic deduplication is achieved through the set data structure in the hash table. A set deduplication algorithm can be used, which has a time complexity of O(n). Duplicate initial computing card programming interfaces are automatically ignored during insertion, eliminating the need for manual checks.
[0129] After deduplication, the matching degree is used to determine the matching status between the call information in the multiple initial computing card programming interfaces and the historical call information.
[0130] For example, the matching degree can be a percentage. If the matching degree is greater than 95%, this initial computing card programming interface can be used as the target computing card programming interface.
[0131] The computing card programming interface identification method based on the embodiments of this application can add newly detected initial computing card programming interfaces to the hash table in O(1) time. The timestamp can automatically filter interfaces with the same hash value that have later timestamps, which improves the processing speed of initial computing card programming interfaces. It can process 1GB of programming interface call logs (about 10 million lines) in 30 seconds and supports flexible expansion.
[0132] In the embodiments of this application, deduplicating multiple initial computing card programming interfaces using a hash table can include various methods. In practice, one of these methods can be used to deduplicatize the initial computing card programming interfaces.
[0133] The following describes a method for deduplicating the programming interface of the initial computing card, using specific examples.
[0134] In an embodiment of this application, one way to deduplicate the initial computing card programming interface is to: obtain the hash values of multiple initial computing card programming interfaces in a hash table, sort the multiple initial computing card programming interfaces according to their running time, and deduplicate the initial computing card programming interfaces whose running time meets a predetermined condition among the multiple initial computing card programming interfaces with the same hash value.
[0135] The following is combined Figure 5 The process of deduplicating the initial computing card programming interface is described in detail.
[0136] Figure 5 An overall block diagram of a computing card programming interface identification method according to an embodiment of this application is shown schematically.
[0137] like Figure 5 As shown, after the operating system in the server initializes the request, it initiates the execution instruction of the target application. During the execution of the target application, a preset callback function is used to intercept the calls of multiple functions in the target application. The callback function contains interception rules that can detect the prefix of the function name of each function call.
[0138] The system intercepts multiple function calls, and each function call generates a detailed execution log. The execution logs of these functions are then organized to generate a programming interface call log. Regular expressions are used to match the information in the programming interface call log to determine the initial computing card programming interface for each target function call. The initial computing card programming interfaces for each target function call are then deduplicated and sorted to obtain the target computing card programming interface.
[0139] The hash values of multiple initial computing card programming interfaces are retrieved from the hash table. The multiple initial computing card programming interfaces are grouped according to the hash values, and the initial computing card programming interfaces with the same hash value are sorted according to the timestamp.
[0140] After determining the hash values corresponding to multiple initial computing card programming interfaces in the hash table, the initial computing card programming interfaces with different hash values are directly output, and the initial computing card programming interfaces with the same hash value are sorted according to the timestamp in the programming interface call log. The initial computing card programming interface with the earliest timestamp is retained, and the hash table is updated. The initial computing card programming interface with the earliest or most stable timestamp is used as the target computing card programming interface.
[0141] The timestamp includes the last used time, the average call interval, and the most recent peak period. The last used time is used to determine the latest active computing card programming interface, the average call interval is used to identify stable high-frequency computing card programming interfaces, and the most recent peak period is the maximum call frequency within the sliding window, which is used to deal with sudden load scenarios.
[0142] For example, a weighted scoring method can be used to determine the target computing card programming interface, and the initial computing card programming interface can be deduplicated by combining the weight of the last use time and the weight of the average call interval.
[0143] For example, when the timestamp is unavailable, the programming interface can be selected as the target programming interface by sorting the version numbers of the computing card programming interfaces in descending order.
[0144] The computing card programming interface identification method based on embodiments of this application, by deduplicating and sorting initial computing card programming interfaces, can select the latest or most stable computing card programming interface and automatically avoid problematic interfaces. Combined with dynamic operational behavior, it precisely controls the lifecycle of the computing card programming interface, obtains historical records of different computing card programming interfaces, supports time series prediction, improves system reliability, and balances version differences of computing card programming interfaces on different computing nodes.
[0145] Based on the above-mentioned computing card programming interface identification method, this application also provides a computing card programming interface identification device.
[0146] Figure 6 A block diagram of a computing card programming interface identification device according to an embodiment of this application is shown schematically.
[0147] like Figure 6 As shown in the embodiments of this application, the computing card programming interface identification device 600 includes a function acquisition module 610, a function determination module 620, and an interface determination module 630.
[0148] The function acquisition module 610 is used to acquire the call relationships between multiple called functions associated with the execution process of the target application, as well as the mapping relationships between the prefix names of the multiple called functions and the multiple computing card programming interfaces. In one embodiment, the function acquisition module 610 can be used to perform the operation S210 described above, which will not be repeated here.
[0149] The function determination module 620 is used to determine at least one first target call function from a plurality of call functions whose prefix name is the target prefix name. In one embodiment, the function determination module 620 may be used to perform the operation S220 described above, which will not be repeated here.
[0150] The interface determination module 630 is used to determine, using call relationships, target call information of at least one first target call function. The target call information indicates at least one second target call function that has a call relationship with at least one first target call function, and the execution order of the at least one first target call function and the at least one second target call function. The target call information is matched with a preset call relationship template to determine the matching degree between at least one first target call function and historical call functions. The preset call relationship template includes historical call information of historical call functions corresponding to multiple computing card programming interfaces. Based on the mapping relationship and matching degree, a target computing card programming interface corresponding to at least one target prefix name is determined from multiple computing card programming interfaces. In one embodiment, the interface determination module 630 can be used to perform operations S230 to S250 described above, which will not be repeated here.
[0151] According to an embodiment of this application, the function acquisition module 610 includes a path specification unit and a function first tracking unit.
[0152] The path specification unit is used to specify the executable path of the target application using a default command line.
[0153] The first function tracing unit is used to trace the execution process of the target application based on the executable path and obtain multiple function calls associated with the execution process of the target application.
[0154] According to embodiments of this application, the function acquisition module further includes an identifier determination unit and a second function tracking unit.
[0155] The identifier determination unit is used to determine the process identifier of the target application.
[0156] The second function tracing unit is used to trace the execution process of the target application through the process identifier and obtain multiple function calls associated with the execution process of the target application.
[0157] According to an embodiment of this application, the function acquisition module 610 further includes a function interception unit, a log acquisition unit, and a function processing unit.
[0158] The function interception unit is used to intercept the calls of the target application after tracing using a preset callback function, and obtain the programming interface call log.
[0159] The log acquisition unit is used to obtain the call relationships between multiple called functions and the function names of multiple called functions from the programming interface call log.
[0160] The function processing unit is used to process the function names of multiple called functions and obtain the prefix names of the multiple called functions.
[0161] According to an embodiment of this application, the function processing unit includes a type determination subunit and a prefix acquisition subunit.
[0162] The type determination subunit is used to determine the type of multiple characters using regular expressions.
[0163] The prefix retrieval subunit is used to retrieve the prefix name of multiple called functions based on the type of multiple characters.
[0164] The character determination first unit is used to determine, based on the types of multiple characters, at least one first character of type letter and at least one second character of type separator from multiple characters.
[0165] The character determination second unit is used to determine the second target character from at least one second character based on the order in which at least one second character appears in the programming interface call log.
[0166] The prefix determination unit is used to determine the first target character from at least one first character according to the positional relationship between at least one first character and the second target character, and use the first target character as the prefix name of the called function.
[0167] According to an embodiment of this application, the interface determination module 630 includes an information determination unit, an information matching unit, and an interface determination unit.
[0168] The information determination unit is used to determine, by utilizing the calling relationship, target calling information of at least one first target calling function, the target calling information indicating at least one second target calling function that has a calling relationship with at least one first target calling function, and the execution order of at least one first target calling function and at least one second target calling function.
[0169] The information matching unit is used to match the target call information with the preset call relationship template to determine the matching degree between at least one first target call function and the historical call function. The preset call relationship template includes the historical call information of the historical call functions corresponding to multiple computing card programming interfaces.
[0170] An interface determination unit is used to determine, based on mapping relationships and matching degrees, a target computing card programming interface corresponding to at least one target prefix name from multiple computing card programming interfaces.
[0171] According to embodiments of this application, the information determination unit includes a call determination subunit and a parameter determination subunit.
[0172] The call determination subunit is used to identify at least one first target call function as a call function that actively calls at least one first target call function or is called by at least one first target call function as at least one second target call function.
[0173] The parameter determination subunit is used to take a calling function whose output parameter is the input parameter of at least one first target calling function or whose input parameter is the output parameter of at least one first target calling function as at least one second target calling function.
[0174] According to an embodiment of this application, the information matching unit includes a data determination subunit and a weighted determination subunit.
[0175] The data determination subunit is used to match the second target calling function with the historical calling functions and the execution order with the execution order of the historical calling functions, and to determine the function matching rate and order matching rate of at least one first target calling function.
[0176] The weighted determination subunit is used to sum the function matching rate and the sequence matching rate in a weighted manner to determine the matching degree between at least one target calling function and the historical calling functions.
[0177] According to an embodiment of this application, the interface determination unit includes an interface storage unit, an interface deduplication unit, and a matching determination unit.
[0178] The interface storage unit is used to store multiple initial computing card programming interfaces into a hash table.
[0179] The interface deduplication unit is used to deduplicatize multiple initial computing card programming interfaces using a hash table.
[0180] The matching determination unit is used to select the initial computing card programming interface whose matching degree meets the preset threshold range from the multiple initial computing card programming interfaces after deduplication as the target computing card programming interface.
[0181] According to an embodiment of this application, the interface deduplication unit includes a hash determination subunit, an interface sorting subunit, and an interface determination subunit.
[0182] The hash determination subunit is used to obtain the hash values of multiple initial computing card programming interfaces in the hash table.
[0183] The interface sorting subunit is used to sort multiple initial computing card programming interfaces according to their runtime.
[0184] The interface determination subunit is used to determine the target computing card programming interface from among multiple initial computing card programming interfaces with the same hash value whose running time meets the predetermined conditions.
[0185] According to embodiments of this application, any plurality of modules among the function acquisition module 610, function determination module 620, and interface determination module 630 can be merged into one module, or any one of these modules can be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules can be combined with at least part of the functionality of other modules and implemented in one module. According to embodiments of this application, at least one of the function acquisition module 610, function determination module 620, and interface determination module 630 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or implemented in hardware or firmware by any other reasonable means of integrating or packaging the circuitry, or implemented in any one of software, hardware, and firmware methods, or in a suitable combination of any of these. Alternatively, at least one of the function acquisition module, function determination module, and interface determination module can be at least partially implemented as a computer program module, which, when run, can perform a corresponding function.
[0186] Figure 7 A block diagram schematically illustrates an electronic device suitable for implementing a computing card programming interface identification method according to an embodiment of this application.
[0187] like Figure 7As shown, an electronic device 700 according to an embodiment of this application includes a processor 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage portion 708 into a random access memory (RAM) 703. The processor 701 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 701 may also include onboard memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this application.
[0188] RAM 703 stores various programs and data required for the operation of electronic device 700. Processor 701, ROM 702, and RAM 703 are interconnected via bus 704. Processor 701 executes various operations of the method flow according to embodiments of this application by executing programs in ROM 702 and / or RAM 703. It should be noted that the programs may also be stored in one or more memories other than ROM 702 and RAM 703. Processor 701 may also execute various operations of the method flow according to embodiments of this application by executing programs stored in said one or more memories.
[0189] According to embodiments of this application, the electronic device 700 may further include an input / output (I / O) interface 705, which is also connected to a bus 704. The electronic device 700 may also include one or more of the following components connected to the input / output (I / O) interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the input / output (I / O) interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.
[0190] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatuses and methods according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0191] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined or combined in various ways without departing from the spirit and teachings of this application. All such combinations or combinations fall within the scope of this application.
[0192] The embodiments of this application have been described above. However, these embodiments are merely illustrative and not intended to limit the scope of this application. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Without departing from the scope of this application, those skilled in the art can make various substitutions and modifications, all of which should fall within the scope of this application.
Claims
1. A method for identifying a computing card programming interface, characterized in that, The method includes: Obtain the call relationships between multiple call functions associated with the target application's runtime process, as well as the mapping relationships between the prefix names of the multiple call functions and multiple computing card programming interfaces; From the plurality of calling functions, determine at least one first target calling function whose prefix name is the target prefix name; Using the calling relationship, target calling information of the at least one first target calling function is determined, the target calling information indicating at least one second target calling function that has a calling relationship with the at least one first target calling function, and the execution order of the at least one first target calling function and the at least one second target calling function; The target call information is matched with a preset call relationship template to determine the matching degree between the at least one first target call function and the historical call function. The preset call relationship template includes the historical call information of the historical call functions corresponding to the plurality of computing card programming interfaces. Based on the mapping relationship and the matching degree, the target computing card programming interface corresponding to the at least one target prefix name is determined from the plurality of computing card programming interfaces.
2. The method according to claim 1, characterized in that, Retrieve the call relationships between multiple function calls associated with the target application's runtime process, including: The executable path of the target application is specified using a preset command line; The execution process of the target application is traced based on the executable path to identify multiple function calls associated with the execution process of the target application.
3. The method according to claim 1, characterized in that, Retrieve the call relationships between multiple function calls associated with the target application's runtime process, including: Determine the process identifier of the target application's execution process; The process identifier is used to trace the execution process of the target application and identify multiple function calls associated with the execution process of the target application.
4. The method according to claim 2 or 3, characterized in that, Obtain the call relationships between multiple function calls associated with the target application's runtime process, as well as the mapping relationships between the prefix names of the multiple function calls and multiple computing card programming interfaces, including: Using a preset callback function, the execution process of the target application after tracking is intercepted to obtain the programming interface call log; Obtain the call relationships between the multiple call functions and the function names of the multiple call functions from the programming interface call log; The function names of the multiple called functions are processed to obtain the prefix names of the multiple called functions.
5. The method according to claim 4, characterized in that, The multiple function names include multiple characters. The function names of the multiple called functions are processed to obtain the prefix names of the multiple called functions, including: The type of the multiple characters is determined using regular expressions, and the types of the multiple characters include letter type and separator type; Based on the types of the plurality of characters, at least one first character of type letter and at least one second character of type separator are determined from the plurality of characters; The second target character is determined from the at least one second character according to the order in which the at least one second character appears in the programming interface call log; Based on the positional relationship between the at least one first character and the second target character, a first target character is determined from the at least one first character, and the first target character is used as the prefix name of the called function.
6. The method according to claim 1, characterized in that, At least one second target calling function that has a calling relationship with the at least one first target calling function includes at least one of the following: The function that actively calls the at least one first target calling function or is called by the at least one first target calling function shall be regarded as the at least one second target calling function; The calling function whose output parameter is the input parameter of the at least one first target calling function or whose input parameter is the output parameter of the at least one first target calling function shall be used as the at least one second target calling function.
7. The method according to claim 1, characterized in that, Matching the target call information with a preset call relationship template to determine the matching degree between the at least one target call function and the historical call function includes: The function matching rate and order matching rate of the at least one first target function are determined by matching the second target function with the historical function calls and by matching the execution order with the historical function calls. The matching degree between the at least one target calling function and the historical calling function is determined by weighted summation of the function matching rate and the sequence matching rate.
8. The method according to claim 1, characterized in that, Based on the mapping relationship and the matching degree, determining the target computing card programming interface corresponding to the at least one target prefix name from the plurality of computing card programming interfaces includes: The mapping relationship is used to obtain multiple initial computing card programming interfaces corresponding to multiple target prefix names; Store the multiple initial computing card programming interfaces into a hash table; The hash table is used to deduplicate the programming interfaces of the multiple initial computing cards; Using the matching degree, the initial computing card programming interface whose matching degree meets the preset threshold range among the multiple initial computing card programming interfaces after deduplication is used as the target computing card programming interface.
9. The method according to claim 8, characterized in that, The hash table is used to deduplicate the programming interfaces of the plurality of initial computing cards, including: Obtain the hash values of the multiple initial computing card programming interfaces in the hash table; The programming interfaces of the multiple initial computing cards are sorted according to their running time; Among the multiple initial computing card programming interfaces with the same hash value, those whose running time meets the predetermined conditions are deduplicated.
10. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic feature is that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Application programming interface generation method and device
CN108108162A
Interface calling method and device, electronic equipment and storage medium
CN115328673A