A method and apparatus for determining an interface, a computer device, and a storage medium

By calculating the business relevance and target parameter relevance between the currently called interface and related interfaces, the coupling degree is determined, which solves the problems of low accuracy and high cost of API interface recommendation in existing technologies, and realizes the rapid and accurate determination of suitable interfaces.

CN116304360BActive Publication Date: 2026-05-08JINAN YUSHI INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JINAN YUSHI INTELLIGENT TECH CO LTD
Filing Date
2021-12-20
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Current technologies recommend API interfaces with low accuracy and high cost, making it difficult to quickly determine suitable interfaces.

Method used

By determining the business relevance and target parameter relevance between the current calling interface and the associated interfaces, the coupling degree is calculated, thereby identifying the target interface from the associated interfaces.

Benefits of technology

It enables the rapid and accurate determination of suitable interfaces, reducing the cost of recommendation interfaces.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116304360B_ABST
    Figure CN116304360B_ABST
Patent Text Reader

Abstract

The application discloses a kind of interface determination method, device, computer equipment and storage medium.The method comprises: according to the service correlation between current calling interface and each interface, determine the associated interface matched with current calling interface;Wherein, current calling interface and each interface are stored in the same system, and the associated interface includes upstream interface and / or downstream interface;According to the parameter of current calling interface and the parameter of associated interface, determine the target parameter correlation between current calling interface and associated interface, wherein the parameter includes input parameter and output parameter;According to the service correlation and target parameter correlation between current calling interface and associated interface, determine the coupling degree between current calling interface and associated interface, and determine target interface from associated interface according to at least one coupling degree matched with current calling interface.Using the technical solution of the application, the appropriate interface can be determined quickly and accurately.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of data processing technology, and in particular to a method, apparatus, computer device, and storage medium for determining an interface. Background Technology

[0002] In the internet age, developers provide a series of APIs (Application Programming Interfaces) for third parties to use through open platforms. However, the calling relationships between these APIs are complex, making it difficult for third parties to quickly determine the appropriate interface based on their own business needs.

[0003] In existing technologies, to recommend suitable APIs to third parties, the recommended APIs are typically determined by searching similar projects in a project library and identifying the APIs called by these similar projects. Alternatively, the recommended APIs are determined by analyzing current API call relationships and searching for similar API call relationships in a database. However, these two methods of determining recommended APIs are inefficient. The former, which compares projects, lacks precision down to the API itself, resulting in low accuracy. The latter requires identifying a large number of existing, reasonable API call relationships, leading to higher costs. Summary of the Invention

[0004] This invention provides a method, apparatus, computer device, and storage medium for determining an interface, so as to achieve rapid and accurate determination of a suitable interface.

[0005] In a first aspect, embodiments of the present invention provide a method for determining an interface, the method comprising:

[0006] Based on the business relevance between the current calling interface and other interfaces, determine the associated interfaces that match the current calling interface; wherein the current calling interface and other interfaces are stored in the same system, and the associated interfaces include upstream interfaces and / or downstream interfaces;

[0007] Based on the parameters of the currently invoked interface and the parameters of the associated interface, determine the target parameter correlation degree between the currently invoked interface and the associated interface, wherein the parameters include input parameters and output parameters;

[0008] Based on the business relevance and target parameter relevance between the current calling interface and the associated interfaces, the coupling degree between the current calling interface and the associated interfaces is determined, and the target interface is determined from the associated interfaces based on at least one coupling degree that matches the current calling interface.

[0009] Secondly, embodiments of the present invention also provide an interface determination device, the device comprising:

[0010] The business relevance determination module is used to determine the associated interfaces that match the current calling interface based on the business relevance between the current calling interface and each interface; wherein the current calling interface and each interface are stored in the same system, and the associated interfaces include upstream interfaces and / or downstream interfaces;

[0011] The target parameter correlation degree determination module is used to determine the target parameter correlation degree between the current calling interface and the associated interface based on the parameters of the current calling interface and the parameters of the associated interface, wherein the parameters include input parameters and output parameters;

[0012] The target interface determination module is used to determine the coupling degree between the current calling interface and the associated interfaces based on the business correlation degree and the target parameter correlation degree between the current calling interface and the associated interfaces, and to determine the target interface from the associated interfaces based on at least one coupling degree that matches the current calling interface.

[0013] Thirdly, embodiments of the present invention also provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the interface determination method as described in any of the embodiments of the present invention.

[0014] Fourthly, embodiments of the present invention also provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform a method for determining an interface as described in any of the embodiments of the present invention.

[0015] This invention addresses the issues of low accuracy and high cost in existing methods for determining recommended interfaces, achieving rapid and accurate identification of suitable interfaces. It obtains the business relevance between the currently invoked interface and its matched associated interfaces, determines the target parameter relevance based on the parameters of the current and associated interfaces, calculates the coupling degree between them, and uses this coupling degree to identify the target interface from among the associated interfaces. Attached Figure Description

[0016] Figure 1 This is a flowchart of a method for determining an interface according to Embodiment 1 of the present invention;

[0017] Figure 2 This is a flowchart of a method for determining an interface according to Embodiment 2 of the present invention;

[0018] Figure 3 This is a schematic diagram of the structure of an interface determination device according to Embodiment 3 of the present invention;

[0019] Figure 4This is a schematic diagram of the structure of a computer device according to Embodiment 4 of the present invention. Detailed Implementation

[0020] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.

[0021] Example 1

[0022] Figure 1 This is a flowchart of an interface determination method provided in Embodiment 1 of the present invention. This embodiment can be applied to recommending suitable upstream and downstream interfaces to users when they use the interfaces of an open platform. The method can be executed by an interface determination device, which can be implemented by software and / or hardware and is generally integrated into a computer device.

[0023] like Figure 1 As shown, the technical solution of this embodiment of the invention specifically includes the following steps:

[0024] S110. Based on the business relevance between the current calling interface and other interfaces, determine the associated interface that matches the current calling interface.

[0025] The currently invoked interface and all other interfaces are stored in the same system, and the associated interfaces include upstream interfaces and / or downstream interfaces.

[0026] The currently invoked interface refers to the interface that the user is currently invoking. Optionally, the currently invoked interface can be a core interface in the business project that the user wants to implement, that is, an interface that is essential to implementing the business project. The currently invoked interface is not necessarily the first interface that needs to be called in the business project that the user wants to implement. Therefore, when the currently invoked interface is in the middle of the interface call chain of the business project, it is necessary to filter both the upstream and downstream interfaces of the currently invoked interface to obtain the upstream interface list and the downstream interface list.

[0027] An associated interface refers to an interface that has an upstream or downstream business relationship with the currently called interface. For example, if a business project needs to call interface A and interface B, and the calling order requires calling interface A first and then interface B, then if the currently called interface is interface A, then interface B is an associated interface and a downstream interface. However, the upstream and downstream relationship between interfaces is not limited to being determined by the calling order. For example, if the currently called interface is interface A, and during the process of calling interface A, interface B needs to be called to perform a corresponding operation, then interface B is also a downstream interface of interface A. This embodiment does not limit the method for determining upstream and downstream interfaces.

[0028] Business relevance is used to represent the upstream and downstream relationships between interfaces. If a business project needs to call interface A and interface B, and interface A is called first, followed by interface B, then a high business relevance can be set between interface B and interface A. It should be noted that because of the upstream and downstream relationship between interfaces, the business relevance between interface B and interface A when the current call is for interface A is independent of the business relevance between interface A and interface B when the current call is for interface B.

[0029] In this embodiment of the invention, the business correlation between different interfaces can be determined in advance through analysis of the business processes between interfaces and historical pairing statistics. For example, if there is an upstream / downstream relationship between interfaces, the business correlation is determined based on factors such as the analysis of the business processes between interfaces and historical pairing statistics; in this case, the business correlation can be an integer greater than 0. If there is no upstream / downstream relationship between interfaces, the business correlation is set to 0. When it is necessary to determine the recommended interface based on the currently called interface, the business correlation between the currently called interface and related interfaces can be quickly obtained.

[0030] In this embodiment of the invention, based on a pre-determined business correlation between the currently invoked interface and other interfaces, related interfaces can be selected from among the other interfaces. For example, if the business correlation between the currently invoked interface and other interfaces is greater than 0, then that interface is considered a related interface.

[0031] S120. Based on the parameters of the currently called interface and the parameters of the associated interface, determine the target parameter correlation degree between the currently called interface and the associated interface.

[0032] The parameters include input parameters and output parameters.

[0033] Target parameter correlation is used to represent the parameter and parameter association relationships between the currently called interface and related interfaces. When there is an upstream and downstream relationship between interfaces, to ensure the accuracy of interface calls, the output parameters of the upstream interface need to match the input parameters of the downstream interface. Therefore, the determination of target parameter correlation is matched with the type of related interfaces.

[0034] Specifically, when the associated interface is a downstream interface, the target parameter correlation between the current calling interface and the associated interface is determined based on the interface output parameters of the current calling interface and the interface input parameters of the associated interface. When the associated interface is an upstream interface, the target parameter correlation between the current calling interface and the associated interface is determined based on the interface input parameters of the current calling interface and the interface output parameters of the associated interface.

[0035] S130. Determine the coupling degree between the current calling interface and the associated interface based on the business correlation degree and the target parameter correlation degree between the current calling interface and the associated interface, and determine the target interface from the associated interfaces based on at least one coupling degree that matches the current calling interface.

[0036] Coupling degree is used to represent the degree of dependence of information and parameters between two interfaces. The higher the coupling degree, the higher the probability that the associated interface is in the interface call chain of the current business project, and the higher the probability that the user will use the associated interface upstream or downstream of the current call interface.

[0037] In this embodiment of the invention, the coupling degree between the currently called interface and related interfaces is calculated through business relevance and target parameter relevance. This coupling degree can be used to assess the closeness of the business relationship between the related interfaces and the currently called interface, and whether a calling relationship exists in other similar scenarios. By calculating the coupling degree of each related interface, upstream and downstream related interfaces can be sorted from high to low according to their coupling degree, thereby generating upstream and downstream interface recommendation lists. This allows users to quickly and conveniently select the interfaces needed for their business projects.

[0038] The technical solution of this embodiment obtains the business relevance between the currently called interface and its associated interfaces. Based on the parameters of the currently called interface and the associated interfaces, it determines the target parameter relevance between the two interfaces. Then, it calculates the coupling degree between the currently called interface and the associated interfaces based on the business relevance and the target parameter relevance. Finally, it determines the target interface from among the associated interfaces based on the coupling degree. This solves the problems of low accuracy and high cost in existing methods of recommending interfaces, achieving fast and accurate determination of suitable interfaces.

[0039] Example 2

[0040] Figure 2 This is a flowchart of an interface determination method provided in Embodiment 2 of the present invention. Based on the above embodiments, the present invention further specifies the process of determining the correlation degree of the target parameters between the current calling interface and the associated interface, the process of determining the coupling degree between the current calling interface and the associated interface, and the process of determining the target interface from the associated interface.

[0041] Correspondingly, such as Figure 2 As shown, the technical solution of this embodiment of the invention specifically includes the following steps:

[0042] S210. Based on the business relevance between the current calling interface and other interfaces, determine the associated interface that matches the current calling interface.

[0043] Optionally, the business correlation between each interface can be stored in advance. The business correlation between each interface can be determined by factors such as analysis of the business processes between interfaces and historical pairing statistics between interfaces. This embodiment does not impose any restrictions on this.

[0044] S220. Determine the matching degree between the parameters of the currently called interface and the parameters of the associated interface.

[0045] The matching degree is used to indicate whether the parameters of the currently called interface match the parameters of the associated interface. Optionally, the matching degree is 1 when the parameters of the currently called interface match the parameters of the associated interface, and 0 otherwise.

[0046] Determining whether the parameters of the currently called interface match the parameters of the associated interface can be done through a complete consistency comparison principle; that is, if the parameters of the currently called interface are completely identical to those of the associated interface, then the parameters of the currently called interface are considered to match the parameters of the associated interface. Alternatively, a matching degree model can be trained using a machine learning algorithm. The parameters of the currently called interface and the associated interface are input into the matching degree model, and the model's output is obtained. Another method is manual calibration to determine whether the parameters of the currently called interface match the parameters of the associated interface, and the calibrated matching relationship is stored in relation to the interfaces. This embodiment does not restrict the method used to determine whether the parameters of the currently called interface match the parameters of the associated interface.

[0047] Specifically, if the associated interface is an upstream interface, the matching degree between the parameters of the currently called interface and the parameters of the associated interface is determined, including: determining the matching degree between the interface input parameters of the currently called interface and the interface output parameters of the associated interface. If the associated interface is a downstream interface, the matching degree between the parameters of the currently called interface and the parameters of the associated interface is determined, including: determining the matching degree between the interface output parameters of the currently called interface and the interface input parameters of the associated interface.

[0048] For example, if the associated interface is a downstream interface, and the output parameters of the currently called interface include the location A, and the input parameters of the associated interface include the city A, then the matching degree between the parameters of the currently called interface and the parameters of the associated interface is 1.

[0049] In this embodiment of the invention, the number of parameters of the currently called interface can be one or more, and the number of parameters of the currently called interface matches the number of parameters of the associated interface. When the number of parameters of the currently called interface is multiple, the matching degree is determined for the parameters of the currently called interface and the parameters of its corresponding associated interface.

[0050] S230. Determine the user approval level between the currently invoked interface and the associated interface.

[0051] User approval rating indicates the degree to which a user approves of the match between the currently called API and the associated API. User approval rating is a dynamically changing parameter. An initial value can be set for user approval rating, and it can be adjusted during the process of determining the recommended API on the server side.

[0052] Optionally, user approval can be determined based on at least one of the following user approval evaluation parameters: the number of user clicks when the associated interface was used as a historical target interface, the number of times the associated interface was used as a historical target interface, and the user rating when the associated interface was used as a historical target interface.

[0053] For example, if the currently invoked interface is interface A and the associated interface is interface B, the server can count the number of times the user clicks and views interface B when interface B is provided to the user as the target interface of interface A, as well as the number of times the user selects interface B for application and debugging. Furthermore, after confirming that the user is using interface B, a rating request for the interface recommendation accuracy can be sent to the user through the human-computer interaction interface to obtain the user's rating. This embodiment does not limit the method for determining user approval.

[0054] S240. Determine the number of times other interfaces in the system reference the parameters of the currently called interface or the parameters of associated interfaces.

[0055] If the associated interface is an upstream interface, then the number of times other interfaces in the system reference the parameters of the currently called interface or the parameters of the associated interface is determined, including: determining the number of times other interfaces in the system reference the output parameters of the associated interface; if the associated interface is a downstream interface, then the number of times other interfaces in the system reference the parameters of the currently called interface or the parameters of the associated interface is determined, including: determining the number of times other interfaces in the system reference the output parameters of the currently called interface.

[0056] The reference count of the interface output parameters is preset and stored when the interface is published on the open platform. If the reference count changes after the interface is updated, the reference count stored on the open platform will also be updated in a timely manner.

[0057] Similarly, when there are multiple parameters for the current API call, the reference count for each parameter of the current API call or each associated API is determined separately.

[0058] The number of references can be used to characterize the importance of a parameter among all parameters. For example, when the associated interface is a downstream interface, the higher the number of references to the output parameter A of the currently called interface, the higher its importance among the output parameters of the currently called interface.

[0059] S250. Calculate the target parameter correlation degree between the current calling interface and the associated interface based on the matching degree, user approval degree, and number of references.

[0060] In this embodiment of the invention, after obtaining the matching degree, user approval degree, and reference count, the target parameter correlation degree can be directly calculated based on these factors. Specifically, when the current calling interface has only one parameter, the product of the matching degree, user approval degree, and reference count is used as the target parameter correlation degree. When the current calling interface has multiple parameters, the product of the matching degree, user approval degree, and reference count is calculated for each parameter of the current calling interface and its corresponding associated interface, and the sum of these products is used as the target parameter correlation degree. Alternatively, after calculating the product of the matching degree, user approval degree, and reference count, the average value of the historical parameter correlation degrees calculated when previously calculating the coupling degree for the current calling interface and associated interfaces can be used. This embodiment does not impose any limitations on this approach.

[0061] Correspondingly, the S250 may include:

[0062] S251. For each parameter of the currently called interface, calculate the product of matching degree, user approval degree and reference count, and use the sum of the products as the current parameter correlation degree between the currently called interface and the associated interface.

[0063] In this embodiment of the invention, when there are multiple parameters of the current calling interface, the sum of the products of the matching degree, user approval degree and the number of references corresponding to the parameters of each current calling interface is used as the current parameter relevance.

[0064] S252. Take the current parameter correlation degree and the average of the historical parameter correlation degrees between the current calling interface and the associated interface within the historical time period as the target parameter correlation degree between the current calling interface and the associated interface.

[0065] During the previous recommendation interface determination process, the historical parameter correlation between the current calling interface and related interfaces over a historical time period is obtained. The average of the current parameter correlation and the historical parameter correlation is then used as the target parameter correlation between the current calling interface and related interfaces. This setting makes the target parameter correlation smoother, reduces the impact of error data on parameter correlation, and also makes the interface recommendations more closely match the trends of the recent time period.

[0066] S260. The sum of the product of business relevance and business relevance weight, and the product of target parameter relevance and target parameter relevance weight, is used as the coupling degree between the current calling interface and the associated interface.

[0067] In this embodiment of the invention, the business relevance weight and the target parameter relevance weight can be preset, and the sum of the business relevance weight and the target parameter relevance weight is 1. The business relevance weight and the target parameter relevance weight represent the degree of contribution of the business relevance and the target parameter relevance to the coupling degree, respectively. The business relevance weight and the target parameter relevance weight can be flexibly configured according to business needs. This embodiment does not limit the magnitude of the business relevance weight and the target parameter relevance weight.

[0068] S270. Determine whether the associated interface is an upstream interface. If yes, execute S280; otherwise, execute S2100.

[0069] In this embodiment of the invention, the associated interfaces are divided into upstream interfaces and downstream interfaces, and the upstream associated interfaces and downstream associated interfaces are sorted according to their coupling degree.

[0070] S280. Determine whether the coupling degree between the currently called interface and the associated interface meets the coupling degree condition. If yes, execute S290; otherwise, execute 2130.

[0071] The coupling degree condition can be met by having the highest coupling degree or by having a coupling degree in the order of precedence within a preset number. This embodiment does not impose any restrictions on this.

[0072] S290. Determine the associated interface as the target upstream interface.

[0073] S2100: Determine whether the associated interface is a downstream interface. If yes, execute S2110; otherwise, execute S2130.

[0074] S2110. Determine whether the coupling degree between the currently called interface and the associated interface meets the coupling degree condition. If yes, execute S2120; otherwise, execute S2130.

[0075] S2120. Determine the associated interface as the target downstream interface.

[0076] After sorting the target upstream interfaces and target downstream interfaces with the highest coupling degree according to their coupling degree, a recommended list of upstream interfaces and a recommended list of downstream interfaces are generated and provided to the user. This allows the user to obtain the interfaces that are most closely related to the business of the current interface call and are the most commonly used in the same scenario, so as to quickly build the project according to their own business needs.

[0077] S2130, End.

[0078] The technical solution of this embodiment obtains the business relevance between the currently called interface and its matching associated interfaces. Based on the matching degree between the parameters of the current called interface and the parameters of the associated interfaces, the user acceptance degree between the current called interface and the associated interfaces, and the number of times the parameters of the current called interface or the associated interfaces are referenced by other interfaces, the target parameter relevance between the current called interface and the associated interfaces is calculated. The coupling degree between the current called interface and the associated interfaces is calculated based on the business relevance and the target parameter relevance. The target upstream interface and the target downstream interface are then determined from the associated interfaces using the coupling degree. This solves the problems of low accuracy and high cost in existing methods of recommending interfaces, achieving fast and accurate determination of suitable interfaces.

[0079] Example 3

[0080] Figure 3 This is a schematic diagram of an interface determination device provided in Embodiment 3 of the present invention. The device includes: a business relevance determination module 310, a target parameter relevance determination module 320, and a target interface determination module 330. Wherein:

[0081] The business relevance determination module 310 is used to determine the associated interface that matches the current calling interface based on the business relevance between the current calling interface and each interface; wherein the current calling interface and each interface are stored in the same system, and the associated interface includes upstream interface and / or downstream interface;

[0082] The target parameter correlation degree determination module 320 is used to determine the target parameter correlation degree between the current calling interface and the associated interface based on the parameters of the current calling interface and the parameters of the associated interface, wherein the parameters include input parameters and output parameters;

[0083] The target interface determination module 330 is used to determine the coupling degree between the current calling interface and the associated interface based on the business correlation degree and the target parameter correlation degree between the current calling interface and the associated interface, and to determine the target interface from the associated interfaces based on at least one coupling degree that matches the current calling interface.

[0084] The technical solution of this embodiment obtains the business relevance between the currently called interface and its associated interfaces. Based on the parameters of the currently called interface and the associated interfaces, it determines the target parameter relevance between the two interfaces. Then, it calculates the coupling degree between the currently called interface and the associated interfaces based on the business relevance and the target parameter relevance. Finally, it determines the target interface from among the associated interfaces based on the coupling degree. This solves the problems of low accuracy and high cost in existing methods of recommending interfaces, achieving fast and accurate determination of suitable interfaces.

[0085] Based on the above embodiments, the target parameter correlation degree determination module 320 includes:

[0086] The matching degree determination unit is used to determine the matching degree between the parameters of the currently called interface and the parameters of the associated interface;

[0087] The user approval determination unit is used to determine the user approval level between the currently called interface and the associated interface.

[0088] The reference count determination unit is used to determine the number of times other interfaces in the system reference the parameters of the currently called interface or the parameters of associated interfaces.

[0089] The target parameter correlation calculation unit is used to calculate the target parameter correlation between the currently called interface and the associated interface based on the matching degree, user approval degree, and the number of references.

[0090] Based on the above embodiments, the matching degree determination unit is specifically used for:

[0091] If the associated interface is an upstream interface, then determine the degree of matching between the input parameters of the currently called interface and the output parameters of the associated interface;

[0092] If the associated interface is a downstream interface, then determine the degree of matching between the interface output parameters of the currently called interface and the interface input parameters of the associated interface;

[0093] The citation count determination unit is specifically used for:

[0094] If the associated interface is an upstream interface, then determine the number of times other interfaces in the system reference the interface output parameters of the associated interface.

[0095] If the associated interface is a downstream interface, then determine the number of times other interfaces in the system reference the output parameters of the currently called interface.

[0096] Based on the above embodiments, the user approval rating is determined according to at least one of the following user approval rating parameters:

[0097] User click count when the associated interface was used as a historical target interface, application count when the associated interface was used as a historical target interface, and user rating when the associated interface was used as a historical target interface.

[0098] Based on the above embodiments, the target parameter correlation calculation unit is specifically used for:

[0099] For each parameter of the currently called interface, calculate the product of matching degree, user approval degree and reference count, and use the sum of the products as the current parameter correlation degree between the currently called interface and the associated interface;

[0100] The target parameter correlation between the current parameter correlation degree and the average of the historical parameter correlation degrees between the current calling interface and the associated interface over the historical time period are used as the target parameter correlation degree between the current calling interface and the associated interface.

[0101] Based on the above embodiments, the target interface determination module 330 includes:

[0102] The coupling degree calculation unit is used to calculate the coupling degree between the current calling interface and the associated interface by summing the product of the business relevance degree and the business relevance degree weight, and the product of the target parameter relevance degree and the target parameter relevance degree weight.

[0103] Based on the above embodiments, the target interface determination module 330 includes:

[0104] The target upstream interface determination unit is used to determine the associated interface as the target upstream interface if the associated interface is determined to be an upstream interface and the coupling degree between the currently called interface and the associated interface meets the coupling degree condition.

[0105] The target downstream interface determination unit is used to determine the associated interface as the target downstream interface if the associated interface is determined to be a downstream interface and the coupling degree between the currently called interface and the associated interface meets the coupling degree condition.

[0106] The interface determination device provided in the embodiments of the present invention can execute the interface determination method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0107] Example 4

[0108] Figure 4 This is a schematic diagram of the structure of a computer device provided in Embodiment 4 of the present invention, as shown below. Figure 4 As shown, the computer device includes a processor 70, a memory 71, an input device 72, and an output device 73; the number of processors 70 in the computer device can be one or more. Figure 4 Taking a processor 70 as an example; the processor 70, memory 71, input device 72, and output device 73 in a computer device can be connected via a bus or other means. Figure 4 Taking the example of a connection between China and Israel via a bus.

[0109] The memory 71, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the modules corresponding to the interface determination method in this embodiment of the invention (e.g., the business correlation determination module 310, the target parameter correlation determination module 320, and the target interface determination module 330 in the interface determination device). The processor 70 executes various functional applications and data processing of the computer device by running the software programs, instructions, and modules stored in the memory 71, thereby implementing the aforementioned interface determination method. This method includes:

[0110] Based on the business relevance between the current calling interface and other interfaces, determine the associated interfaces that match the current calling interface; wherein the current calling interface and other interfaces are stored in the same system, and the associated interfaces include upstream interfaces and / or downstream interfaces;

[0111] Based on the parameters of the currently invoked interface and the parameters of the associated interface, determine the target parameter correlation degree between the currently invoked interface and the associated interface, wherein the parameters include input parameters and output parameters;

[0112] Based on the business relevance and target parameter relevance between the current calling interface and the associated interfaces, the coupling degree between the current calling interface and the associated interfaces is determined, and the target interface is determined from the associated interfaces based on at least one coupling degree that matches the current calling interface.

[0113] The memory 71 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data created based on terminal usage. Furthermore, the memory 71 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory, or other non-volatile solid-state storage device. In some instances, the memory 71 may further include memory remotely located relative to the processor 70, which can be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0114] Input device 72 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the computer device. Output device 73 may include display devices such as a display screen.

[0115] Example 5

[0116] Embodiment 5 of the present invention also provides a storage medium containing computer-executable instructions, wherein the computer-executable instructions, when executed by a computer processor, are used to perform an interface determination method, the method comprising:

[0117] Based on the business relevance between the current calling interface and other interfaces, determine the associated interfaces that match the current calling interface; wherein the current calling interface and other interfaces are stored in the same system, and the associated interfaces include upstream interfaces and / or downstream interfaces;

[0118] Based on the parameters of the currently invoked interface and the parameters of the associated interface, determine the target parameter correlation degree between the currently invoked interface and the associated interface, wherein the parameters include input parameters and output parameters;

[0119] Based on the business relevance and target parameter relevance between the current calling interface and the associated interfaces, the coupling degree between the current calling interface and the associated interfaces is determined, and the target interface is determined from the associated interfaces based on at least one coupling degree that matches the current calling interface.

[0120] Of course, the computer-executable instructions provided in the embodiments of the present invention are not limited to the method operations described above, but can also perform related operations in the interface determination method provided in any embodiment of the present invention.

[0121] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0122] It is worth noting that in the embodiments of the interface determination device described above, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.

[0123] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.

Claims

1. A method for determining an interface, characterized in that, include: Based on the business relevance between the current calling interface and other interfaces, determine the associated interfaces that match the current calling interface; wherein the current calling interface and other interfaces are stored in the same system, and the associated interfaces include upstream interfaces and / or downstream interfaces; Based on the parameters of the currently invoked interface and the parameters of the associated interface, determine the target parameter correlation degree between the currently invoked interface and the associated interface, wherein the parameters include input parameters and output parameters; Based on the parameters of the currently invoked interface and the parameters of the associated interfaces, determine the target parameter correlation degree between the currently invoked interface and the associated interfaces, including: Determine the degree of match between the parameters of the currently invoked interface and the parameters of the associated interface; Determine the user acceptance level between the currently invoked API and its associated APIs; Determine the number of times other interfaces in the system reference the parameters of the currently called interface or related interfaces; Calculate the target parameter correlation degree between the current calling interface and the associated interface based on the matching degree, user approval degree, and number of references; Based on the business relevance and target parameter relevance between the current calling interface and the associated interfaces, the coupling degree between the current calling interface and the associated interfaces is determined, and the target interface is determined from the associated interfaces based on at least one coupling degree that matches the current calling interface.

2. The method according to claim 1, characterized in that, If the associated interface is an upstream interface, determine the matching degree between the parameters of the currently called interface and the parameters of the associated interface, including: Determine the degree of matching between the input parameters of the currently invoked interface and the output parameters of the associated interface; Determine the number of times other interfaces in the system reference the parameters of the currently called interface or related interfaces, including: Determine the number of times other interfaces in the system reference the output parameters of the associated interface; If the associated interface is a downstream interface, then determine the matching degree between the parameters of the currently called interface and the parameters of the associated interface, including: Determine the degree of matching between the output parameters of the currently invoked interface and the input parameters of the associated interface; Determine the number of times other interfaces in the system reference the parameters of the currently called interface or related interfaces, including: Determine the number of times other interfaces in the system reference the output parameters of the currently called interface.

3. The method according to claim 1, characterized in that, The user approval rating is determined based on at least one of the following user approval evaluation parameters: User click count when the associated interface was used as a historical target interface, application count when the associated interface was used as a historical target interface, and user rating when the associated interface was used as a historical target interface.

4. The method according to claim 1, characterized in that, Based on matching degree, user approval, and reference count, calculate the target parameter correlation degree between the current API call and related APIs, including: For each parameter of the currently called interface, calculate the product of matching degree, user approval degree and reference count, and use the sum of the products as the current parameter correlation degree between the currently called interface and the associated interface; The target parameter correlation between the current parameter correlation degree and the average of the historical parameter correlation degrees between the current calling interface and the associated interface over the historical time period are used as the target parameter correlation degree between the current calling interface and the associated interface.

5. The method according to claim 1, characterized in that, Based on the business relevance and target parameter relevance between the current calling interface and related interfaces, determine the coupling degree between the current calling interface and related interfaces, including: The product of business relevance and business relevance weight, and the sum of the product of target parameter relevance and target parameter relevance weight, are used as the coupling degree between the current calling interface and the associated interface.

6. The method according to claim 1, characterized in that, The target interface is determined from the associated interfaces based on at least one degree of coupling that matches the currently invoked interface, including: If the associated interface is determined to be the upstream interface, and the coupling degree between the currently called interface and the associated interface meets the coupling degree condition, then the associated interface is determined to be the target upstream interface. If the associated interface is determined to be a downstream interface, and the coupling degree between the currently called interface and the associated interface meets the coupling degree condition, then the associated interface is determined to be the target downstream interface.

7. An interface determining device, characterized in that, include: The business relevance determination module is used to determine the associated interfaces that match the current calling interface based on the business relevance between the current calling interface and each interface; wherein the current calling interface and each interface are stored in the same system, and the associated interfaces include upstream interfaces and / or downstream interfaces; The target parameter correlation degree determination module is used to determine the target parameter correlation degree between the current calling interface and the associated interface based on the parameters of the current calling interface and the parameters of the associated interface, wherein the parameters include input parameters and output parameters; The target parameter correlation determination module includes: The matching degree determination unit is used to determine the matching degree between the parameters of the currently called interface and the parameters of the associated interface; The user approval determination unit is used to determine the user approval level between the currently called interface and the associated interface. The reference count determination unit is used to determine the number of times other interfaces in the system reference the parameters of the currently called interface or the parameters of associated interfaces. The target parameter correlation calculation unit is used to calculate the target parameter correlation between the current calling interface and the associated interface based on the matching degree, user approval degree, and the number of references. The target interface determination module is used to determine the coupling degree between the current calling interface and the associated interfaces based on the business correlation degree and the target parameter correlation degree between the current calling interface and the associated interfaces, and to determine the target interface from the associated interfaces based on at least one coupling degree that matches the current calling interface.

8. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method for determining the interface as described in any one of claims 1-6.

9. A storage medium containing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are used to perform the method for determining the interface as described in any one of claims 1-6.

Citation Information

Patent Citations

  • A method and device for generating an interface test report

    CN109376064A

  • API matching method and device based on API document

    CN111090462A