An interface processing method and apparatus
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2026-08-11
AI Technical Summary
[0003]现有的识别外部接口的方法通常基于业务代码进行静态代码分析,结合接口文档以及静态代码分析结果识别出外部接口;在外部接口数量较大,应用代码迭代速度较快的情况下,现有的方法存在识别外部接口的灵活性较差,针对外部接口的识别准确率偏低的问题
[0023]为实现上述目的,根据本发明实施例的第五方面,提供了一种计算机程序产品,包括计算机程序,其特征在于,计算机程序被处理器执行时实现如上述接口处理方法中任一的方法。
Smart Images

Figure CN122547564A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of application development technology, and in particular to an interface processing method and apparatus. Background Technology
[0002] As the business functions of internet applications become increasingly complex, the number of external interfaces provided for external calls in the development of various businesses is also increasing. In some application scenarios, external interface providers need to identify and monitor various external interfaces of the business to improve the security and correctness of external interface calls.
[0003] Existing methods for identifying external interfaces typically rely on static code analysis of business code, combining interface documentation with the results of static code analysis to identify external interfaces. However, when there are a large number of external interfaces and the application code iterates rapidly, existing methods suffer from poor flexibility in identifying external interfaces and low accuracy in identifying them. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide an interface processing method and apparatus, which can determine multiple first interfaces that have a calling relationship with the atomic interface of a service, and parse multiple second interfaces associated with the atomic interface from the traffic information of the service. The first interfaces and second interfaces are stored in an interface set as interfaces (external interfaces) provided by the service provider to the external platform for calling. Embodiments of the present invention improve the efficiency and accuracy of identifying external interfaces for the service provider.
[0005] To achieve the above objectives, according to one aspect of the present invention, an interface processing method is provided, characterized in that it includes: determining a plurality of first interfaces that have a calling relationship with an atomic interface of a service; parsing a plurality of second interfaces associated with the atomic interface from the traffic information of the service; storing the plurality of first interfaces and the plurality of second interfaces as target interfaces in an interface set; wherein the target interface is an interface that the service provider provides to an external platform for invocation.
[0006] Optionally, multiple first interfaces that have a call relationship with the atomic interface of the business are determined, including: obtaining the business's operation log; parsing the interface call relationship topology diagram of each interface included in the business from the operation log; filtering multiple reference interfaces that have a set number of call relationships with the atomic interface from the interface call relationship topology diagram based on the atomic interface; and selecting the interface that provides calls to the external platform from the multiple reference interfaces as the first interface.
[0007] Optionally, multiple second interfaces associated with the atomic interface are parsed from the traffic information of the business, including: obtaining multiple traffic information generated when the business is running; obtaining the interface matching strategy corresponding to the business, and parsing multiple second interfaces that satisfy the interface matching strategy from the multiple traffic information; wherein, the external interface matching strategy is a matching strategy for interface variables.
[0008] Optionally, parsing multiple second interfaces that satisfy the external interface matching strategy from multiple traffic information includes: storing multiple target traffic that satisfy the interface matching strategy selected from each traffic information into a traffic data source; for each target traffic in the traffic data source, performing the step of parsing the interface that satisfies the external interface matching strategy from the target traffic; performing a deduplication operation on the parsed interface; and using the deduplicated interface as the second interface.
[0009] Optionally, after storing multiple first interfaces and multiple second interfaces as target interfaces in the interface set, the method further includes: verifying the correctness of the interface type of each identified target interface; and optimizing the step of determining the target interfaces included in the interface set based on the verification results.
[0010] Optionally, the step of determining the target interfaces included in the interface set can be optimized based on the verification results, including: optimizing the number of layers of the first interfaces for the step of determining multiple first interfaces that have a calling relationship with the atomic interface of the business; and / or optimizing the interface matching strategy for the step of parsing multiple second interfaces associated with the atomic interface from the traffic information of the business.
[0011] Optionally, the interface processing method further includes: receiving an interface query request from the service provider for providing calls to external platforms, and returning each target interface in the interface set corresponding to the service as the result of the interface query request; so that the service provider can manage the target interfaces based on the returned results.
[0012] To achieve the above objectives, according to a second aspect of the present invention, an interface processing apparatus is provided, characterized in that it includes: an interface acquisition module and an interface determination module; wherein,
[0013] The interface acquisition module is used to identify multiple first interfaces that have a call relationship with the atomic interface of the business; and to parse multiple second interfaces associated with the atomic interface from the business's traffic information.
[0014] The interface determination module is used to store multiple first interfaces and multiple second interfaces as target interfaces in the interface set; wherein, the target interface is the interface that the business provider provides to the external platform for invocation.
[0015] Optionally, the interface processing device is used to determine multiple first interfaces that have a call relationship with the atomic interface of the business, including: obtaining the business's operation log; parsing the interface call relationship topology diagram of each interface included in the business from the operation log; filtering multiple reference interfaces that have a set number of call relationships with the atomic interface from the interface call relationship topology diagram based on the atomic interface; and selecting the interface that provides calls to the external platform from the multiple reference interfaces as the first interface.
[0016] Optionally, the interface processing device is used to parse multiple second interfaces associated with the atomic interface from the traffic information of the service, including: obtaining multiple traffic information generated when running the service; obtaining the interface matching strategy corresponding to the service, and parsing multiple second interfaces that satisfy the interface matching strategy from the multiple traffic information; wherein, the external interface matching strategy is a matching strategy for interface variables.
[0017] Optionally, the interface processing device is used to parse multiple second interfaces that satisfy an external interface matching strategy from multiple traffic information, including: storing multiple target traffic that satisfy the interface matching strategy selected from each traffic information into a traffic data source; for each target traffic in the traffic data source, performing the step of parsing the interface that satisfies the external interface matching strategy from the target traffic; performing a deduplication operation on the parsed interface; and using the deduplicated interface as the second interface.
[0018] Optionally, the interface processing apparatus, after storing multiple first interfaces and multiple second interfaces as target interfaces in an interface set, further includes: verifying the correctness of the interface type of each identified target interface; and optimizing the step of determining the target interfaces included in the interface set based on the verification result.
[0019] Optionally, the interface processing device is used to optimize the step of determining the target interfaces included in the interface set based on the verification result, including: optimizing the number of layers of the first interfaces for the step of determining multiple first interfaces that have a calling relationship with the atomic interface of the business; and / or optimizing the interface matching strategy for the step of parsing multiple second interfaces associated with the atomic interface from the traffic information of the business.
[0020] Optionally, the interface processing device is further configured to receive an interface query request from the service provider for providing calls to an external platform, and return each target interface in the interface set corresponding to the service as the result of the interface query request; so that the service provider can manage the target interfaces according to the return results.
[0021] To achieve the above objectives, according to a third aspect of the present invention, an electronic device for interface processing is provided, characterized in that it includes: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any of the methods described above for interface processing.
[0022] To achieve the above objectives, according to a fourth aspect of the present invention, a computer-readable medium is provided having a computer program stored thereon, characterized in that, when the program is executed by a processor, it implements any of the methods described above for interface processing.
[0023] To achieve the above objectives, according to a fifth aspect of the present invention, a computer program product is provided, comprising a computer program, characterized in that, when executed by a processor, the computer program implements any of the methods described above for interface processing.
[0024] One embodiment of the above invention has the following advantages or beneficial effects: it can identify multiple first interfaces that have a calling relationship with the atomic interface of the business, and parse multiple second interfaces associated with the atomic interface from the traffic information of the business. The first and second interfaces are stored in the interface set as interfaces (external interfaces) provided by the business provider to the external platform for calling. The embodiments of the present invention improve the efficiency and accuracy of identifying external interfaces.
[0025] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description
[0026] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:
[0027] Figure 1 This is a flowchart illustrating an interface processing method according to an embodiment of the present invention;
[0028] Figure 2 is a schematic diagram of an interface processing flow provided in an embodiment of the present invention;
[0029] Figure 3 This is a flowchart illustrating a query interface provided in one embodiment of the present invention;
[0030] Figure 4 This is a schematic diagram of the structure of an interface processing device provided in one embodiment of the present invention;
[0031] Figure 5 is an exemplary system architecture diagram in which embodiments of the present invention can be applied;
[0032] Figure 6This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation
[0033] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0034] It should be noted that the collection, use, storage, sharing and transfer of user personal information involved in the technical solution of the present invention all comply with the provisions of relevant laws and regulations, and require notification to users and obtaining their consent or authorization. When applicable, user personal information is subjected to de-identification and / or anonymization and / or encryption technical processing.
[0035] Existing methods for identifying whether an interface provided by a business provider is an externally provided interface have the following drawbacks: 1) The method of reviewing application programming interface (API) documentation requires manual querying and organization, which is costly and the accuracy cannot be guaranteed; 2) Using static code analysis technology requires mastering the naming rules of all parameters for the corresponding business types, which has the problem of low accuracy.
[0036] In the description of the embodiments of the present invention, the external interface is the interface through which the service provider provides calls to the external platform, and the service provider is the provider of the service.
[0037] In view of this, such as Figure 1 As shown, this embodiment of the invention provides an interface processing method, which may include the following steps:
[0038] Step S101: Identify multiple first interfaces that have a calling relationship with the atomic interface of the business.
[0039] Specifically, a business can be one of the services provided by an internet application. A business is one or more services provided by a business provider (i.e., an application provider). For example, for an e-commerce application, the business can be related to price, inventory, sales, etc. Typically, the business provider can provide callable interfaces (i.e., external interfaces) to external platforms (or external applications) for various businesses. At the same time, the business provider usually needs to monitor and manage the interfaces provided to external platforms for key businesses such as price, inventory, and sales. By identifying various external interfaces, the business provider can further obtain the call data of each external interface in order to analyze the call status of external interfaces (e.g., whether there are abnormal calls) and manage them (e.g., statistical call data).
[0040] Furthermore, taking the "pricing" business as an example, the atomic interface of the pricing business is determined. The atomic interface is an interface with core business functions that can be called by other interfaces. Typically, the interface provided to the external platform (i.e., the external interface) can directly or indirectly call the atomic interface of the business.
[0041] Furthermore, multiple first interfaces that have a call relationship with the atomic interface of the business are identified, including: obtaining the business's operation log; parsing the interface call relationship topology diagram of each interface included in the business from the operation log; filtering multiple reference interfaces with a set number of call relationships with the atomic interface from the interface call relationship topology diagram based on the atomic interface; and selecting the interface that provides calls to the external platform from the multiple reference interfaces as the first interface.
[0042] Specifically, information on all API calls in the application can be collected by gathering application logs. Then, an API call topology diagram containing all APIs from the logs can be constructed. Link topology technology (such as pfinder) can be used to identify APIs that set business parameters (e.g., pricing), obtaining a call topology diagram extending from price-based atomic APIs. This atomic API call topology diagram can have multiple levels of call relationships. Figure 2 An example of a relational topology graph is shown, such as... Figure 2As shown, for example, the call relationship (direct or indirect call) with the atomic interface as the root node has multiple levels. For example, the first level includes API1 and API2; the second level includes API3 and API4; the third level includes API5 and API6, and so on, to obtain all interfaces that have a call relationship with the atomic interface. In the embodiments of the present invention, it was found from experimental data that the higher the number of levels, the lower the correlation between the interface and the atomic interface. Therefore, in order to improve the accuracy of identifying external interfaces, the number of levels can be set to 7 (setting the number of levels). Based on the atomic interface, multiple reference interfaces with a set number of call relationships with the atomic interface are selected from the interface call relationship topology diagram. It can be understood that the reference interface can be an external interface or an internal interface. Therefore, further, according to the preset configuration information about the external interface (e.g., the configuration information of all external interfaces extracted from the interface document), the external interface is selected as the first interface from all the reference interfaces.
[0043] Step S102: Parse the traffic information of the business to extract multiple second interfaces associated with the atomic interface.
[0044] Specifically, in embodiments of the present invention, in addition to the method for obtaining external interfaces described in step S101, external interfaces can also be identified by parsing service traffic information. It is understood that service traffic information corresponds to external traffic, therefore, information about the external interfaces provided by the service provider can be obtained from the traffic information.
[0045] Furthermore, multiple second interfaces associated with the atomic interface are parsed from the traffic information of the service. This includes: obtaining multiple traffic information generated during service operation; obtaining the interface matching policy corresponding to the service; and parsing multiple second interfaces that satisfy the interface matching policy from the multiple traffic information. The external interface matching policy is a matching policy for interface variables. Specifically, the interface matching policy can be set on the NIDS (Network Intrusion Detection System) server. Taking the "price" service interface as an example, the external interface matching policy for price can be implemented using regular expression matching. Identification conditions can include the variable identifier of the price interface (i.e., the external interface matching policy is a matching policy for interface variables), such as: variable identifiers like price, Price, PRICE, etc., and can also include the variable's numerical format, such as the numerical format (i.e., price value) as "xxx.00". Further, based on the interface matching policy, it is determined whether a matching interface exists in the obtained service traffic information. If so, the interface is identified as the external interface (i.e., the second interface).
[0046] More preferably, parsing multiple second interfaces that satisfy the external interface matching strategy from multiple traffic information includes: storing multiple target traffic that satisfy the interface matching strategy selected from each traffic information into a traffic data source; for each target traffic in the traffic data source, performing the step of parsing the interface that satisfies the external interface matching strategy from the target traffic; performing a deduplication operation on the parsed interface; and using the deduplicated interface as the second interface.
[0047] Specifically, during the parsing and selection of traffic information, traffic information that matches the interface matching strategy can be stored in a traffic data source (such as a database). Then, based on the traffic information in the database, further interface parsing and deduplication operations can be performed. Interface information includes the interface's domain name and path. For example, the interface path information parsed from the traffic may contain variables (e.g., a / b / 123 and a / b / 456 are actually the same interface). Therefore, a deduplication operation is further performed on the interface, and the deduplicated interface is used as the second interface.
[0048] Step S103: Store multiple first interfaces and multiple second interfaces as target interfaces in the interface set; wherein, the target interface is the interface that the business provider provides to the external platform for invocation.
[0049] Specifically, the first interface and multiple second interfaces are stored as target interfaces in an interface set; this ensures that the interface set contains various external interfaces identified for the defined business logic. In other words, the target interfaces are the interfaces that the business logic provider calls from external platforms.
[0050] The embodiments of this invention overcome various problems caused by reliance on manual identification in existing technologies by employing link topology and traffic information regular expression recognition to identify interfaces of specified business types. Furthermore, in these embodiments, since the number of interfaces identified using only link topology may be enormous, the number of call relationship levels is managed to control the number of interfaces, and the number of levels can be adjusted and optimized through verification of the identification results. In actual code development, developers' personal variable naming habits may lead to broken links when using existing static code analysis methods. The traffic information interface matching strategy (regular expression recognition) provided in these embodiments overcomes the problems of broken links and low accuracy caused by static code analysis. Moreover, by identifying traffic on NIDS, active external interfaces of business interest can be prioritized, overcoming the problem that static code analysis cannot characterize the actual activity of interfaces.
[0051] Preferably, after identifying the target interfaces provided by the service provider to the external platform based on the interface set, the process further includes: verifying the correctness of the interface type of each identified target interface; and optimizing the step of determining the target interfaces included in the interface set based on the verification results. Specifically, the service provider's technical personnel can perform sampling verification on each external interface in the interface set to determine whether there are any identification errors, such as identifying internal interfaces as external interfaces or having unidentified external interfaces.
[0052] Furthermore, the steps for determining the target interfaces included in the interface set are optimized based on the verification results. This includes: optimizing the number of levels of the first interfaces for the step of determining multiple first interfaces that have a calling relationship with the atomic interfaces of the business; and / or optimizing the interface matching strategy for the step of parsing multiple second interfaces associated with the atomic interfaces from the business traffic information. For example, adjusting the number of levels (e.g., increasing or decreasing), and / or adjusting the matching rules in the interface matching strategy (e.g., increasing or decreasing rules).
[0053] like Figure 2 As shown, this embodiment of the invention provides an interface processing method, which may include the following steps:
[0054] Step S201: Determine the first interface.
[0055] Specifically, the process involves identifying multiple first interfaces that have a call relationship with the atomic interface of the business, including: obtaining the business's operation logs; parsing the interface call relationship topology diagram of each interface included in the business from the operation logs; filtering multiple reference interfaces that have a set number of call relationships with the atomic interface from the interface call relationship topology diagram based on the atomic interface; and selecting the interface that provides calls to the external platform from the multiple reference interfaces as the first interface.
[0056] Step S202: Determine the second interface.
[0057] Specifically, multiple second interfaces associated with the atomic interface are parsed from the traffic information of the business, including: obtaining multiple traffic information generated when the business is running; obtaining the interface matching strategy corresponding to the business; and parsing multiple second interfaces that satisfy the interface matching strategy from the multiple traffic information. Preferably, this includes a step of deduplicating the interface data.
[0058] Step S203: Optimize the determined set of interfaces.
[0059] Specifically, after storing multiple first interfaces and multiple second interfaces as target interfaces in the interface set, the process further includes: verifying the correctness of the interface type of each identified target interface; and optimizing the step of determining the target interfaces included in the interface set based on the verification results.
[0060] The descriptions of steps S201 to S203 are the same as those of steps S101 to S103, and will not be repeated here.
[0061] like Figure 3 As shown, this embodiment of the invention provides a query interface process, which may include the following steps;
[0062] Step S301: Receive a query request from the business provider for the interface it provides for calling external platforms.
[0063] Step S302: Return each target interface in the set of interfaces corresponding to the business as the result of the interface query request.
[0064] Step S303: Enable the service provider to manage the target interface based on the returned results.
[0065] Specifically, in an embodiment of the present invention, when a service provider queries an external interface corresponding to a certain type of service (e.g., price), the service provider can determine the set of interfaces corresponding to the service type based on the service type, and return each target interface in the set of interfaces corresponding to the service as a result to the service provider; so that the service provider can manage the target interfaces based on the return result; wherein, managing the target interfaces includes, for example, further determining whether there are any abnormalities in the calling status of the target interfaces, and counting the frequency of external interface calls, etc.
[0066] like Figure 4 As shown, an embodiment of the present invention provides an interface processing device 400, comprising:
[0067] The interface module 401 is acquired and the interface module 402 is determined; wherein,
[0068] The interface acquisition module 401 is used to determine multiple first interfaces that have a calling relationship with the atomic interface of the business; and to parse multiple second interfaces associated with the atomic interface from the business's traffic information.
[0069] The interface determination module 402 is used to store multiple first interfaces and multiple second interfaces as target interfaces in the interface set; wherein, the target interface is the interface that the business provider provides to the external platform for invocation.
[0070] This invention also provides an electronic device for interface processing, including: one or more processors; and a storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the method provided in any of the above embodiments.
[0071] This invention also provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method provided in any of the above embodiments.
[0072] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements any of the methods described above for interface processing.
[0073] Figure 5 An exemplary system architecture 500 is shown that can be applied to the interface processing method or interface processing apparatus of the present invention.
[0074] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, and 503, a network 504, and a server 505. Network 504 serves as the medium for providing communication links between terminal devices 501, 502, and 503 and server 505. Network 504 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0075] Users can use terminal devices 501, 502, and 503 to interact with server 505 via network 504 to receive or send messages, etc. Various client applications can be installed on terminal devices 501, 502, and 503, such as e-commerce client applications, web browser applications, search applications, instant messaging tools, and email clients.
[0076] Terminal devices 501, 502, and 503 can be various electronic devices with displays and supporting various client applications, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0077] Server 505 can be a server that provides various services, such as a backend management server that supports client applications used by users through terminal devices 501, 502, and 503, or a server running a network intrusion detection system. The backend management server can process received requests to query external interfaces and feed back the identified external interface information to the terminal devices.
[0078] It should be noted that the interface processing method provided in the embodiments of the present invention is generally executed by the server 505, and correspondingly, the interface processing device is generally set in the server 505.
[0079] It should be understood that Figure 5 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0080] The following is for reference. Figure 6 It shows a schematic diagram of the structure of a computer system 600 suitable for implementing a terminal device of the present invention. Figure 6 The terminal device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0081] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 602 or programs loaded from storage section 608 into random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of the system 600. The CPU 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0082] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 610 as needed so that computer programs read from it can be installed into storage section 608 as needed.
[0083] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 609, and / or installed from removable medium 611. When the computer program is executed by central processing unit (CPU) 601, it performs the functions defined above in the system of this invention.
[0084] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0085] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. 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.
[0086] The modules and / or units described in the embodiments of the present invention can be implemented in software or hardware. The described modules and / or units can also be housed in a processor; for example, a processor can be described as including an interface acquisition module and an interface determination module. The names of these modules do not necessarily limit the module itself; for example, the interface acquisition module can also be described as "a module for determining a first interface and a second interface associated with an atomic interface of a service."
[0087] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs that, when executed by the device, cause the device to include: determining a plurality of first interfaces that have a calling relationship with an atomic interface of a service; parsing a plurality of second interfaces associated with the atomic interfaces from the service's traffic information; and storing the plurality of first interfaces and the plurality of second interfaces as target interfaces in an interface set; wherein the target interfaces are interfaces through which the service provider provides calls to an external platform.
[0088] The embodiments of the present invention can identify multiple first interfaces that have a calling relationship with the atomic interface of the business, and parse multiple second interfaces associated with the atomic interface from the traffic information of the business. The first interfaces and second interfaces are stored in the interface set as interfaces (external interfaces) provided by the business provider to the external platform. The embodiments of the present invention improve the efficiency and accuracy of identifying external interfaces.
[0089] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. An interface processing method, characterized in that, include: Identify multiple first interfaces that have a calling relationship with the atomic interface of the business; Parse the traffic information of the service to extract multiple second interfaces associated with the atomic interface; Multiple first interfaces and multiple second interfaces are stored as target interfaces in an interface set; wherein, the target interface is the interface that the service provider provides to the external platform for invocation.
2. The method according to claim 1, characterized in that, The multiple first interfaces that are determined to have a calling relationship with the atomic interface of the business include: Obtain the operation logs of the aforementioned service; The interface call relationship topology diagram of each interface included in the service is parsed from the operation log; Based on the atomic interface, multiple reference interfaces with a set number of call relationships with the atomic interface are selected from the interface call relationship topology graph, and the interface that provides calls to external platforms is selected from the multiple reference interfaces as the first interface.
3. The method according to claim 1, characterized in that, The step of parsing multiple second interfaces associated with the atomic interface from the traffic information of the service includes: Obtain multiple traffic information generated during the execution of the service; Obtain the interface matching strategy corresponding to the service, and parse out multiple second interfaces that satisfy the interface matching strategy from multiple traffic information; wherein, the external interface matching strategy is a matching strategy for interface variables.
4. The method according to claim 3, characterized in that, The step of parsing multiple second interfaces that satisfy the external interface matching strategy from multiple traffic information includes: Multiple target traffic items that meet the interface matching strategy, selected from various traffic information, are stored in the traffic data source; For each target traffic in the traffic data source, perform the step of parsing out the interface that satisfies the external interface matching strategy from the target traffic; Perform deduplication on the parsed interfaces; The deduplicated interface is used as the second interface.
5. The method according to claim 1, characterized in that, After storing the plurality of first interfaces and the plurality of second interfaces as target interfaces in the interface set, the method further includes: Verify the correctness of the interface type of each identified target interface; The steps for determining the target interfaces included in the interface set are optimized based on the verification results.
6. The method according to any one of claims 1 to 5, characterized in that, The step of optimizing the determination of the target interfaces included in the interface set based on the verification results includes: For the step of determining multiple first interfaces that have a calling relationship with the atomic interface of the business, the number of layers of the first interface is optimized. And / or, For the step of parsing multiple second interfaces associated with the atomic interface from the traffic information of the service, the interface matching strategy is optimized.
7. The method according to claim 1, characterized in that, Receives query requests from service providers regarding their interfaces for calling external platforms. Each target interface in the interface set corresponding to the service is returned as the result of the interface query request, so that the service provider can manage the target interfaces based on the returned results.
8. An interface processing device, characterized in that, include: Obtain the interface module and determine the interface module; among them, The interface acquisition module is used to determine multiple first interfaces that have a calling relationship with the atomic interface of the business; and to parse multiple second interfaces associated with the atomic interface from the traffic information of the business. The interface determination module is used to store multiple first interfaces and multiple second interfaces as target interfaces in an interface set; wherein, the target interface is the interface that the service provider provides to the external platform for invocation.
9. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-7.
10. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-7.
11. A computer program product, comprising a computer program, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-7.