Application program interface identification method, device, system and storage medium

CN116560876BActive Publication Date: 2026-10-27SHANGHAI GUAN AN INFORMATION TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310580150.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-22
Publication Date
2026-10-27
Estimated Expiration
2043-05-22

AI Technical Summary

Technical Problem

[0004]本发明提供一种应用程序接口识别方法、装置、系统及存储介质,以至少解决相关技术中因API的识别能力受预设API特征库中存储的API特征种类的限制,而导致对API识别的准确度低的问题

Benefits of technology

[0018]根据本发明实施例的第六方面,提供了一种计算机可读存储介质,计算机可读存储介质上存储有指令,当计算机可读存储介质中的指令由电子设备的处理器执行时,使得电子设备能够执行如第一方面或第二方面的应用程序接口识别方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116560876B_ABST
    Figure CN116560876B_ABST
Patent Text Reader

Abstract

The present disclosure relates to an application program interface identification method, device, system and storage medium, and relates to the technical field of computing. The present disclosure solves the problem of low accuracy of API identification caused by the limitation of API features stored in the preset API feature library. The method comprises the following steps: when the proxy server detects the starting operation of the browser, inserting the target program code into the webpage information of the browser webpage; the target program code is used to modify the request mode in the calling process of the interface associated with the browser; receiving the calling request of the target interface returned by the browser, decrypting the encrypted target information in the calling request to obtain a decryption result, and identifying the target interface according to the decryption result; the calling request is sent by the browser, and is generated by the browser according to the target program code, the target request mode corresponding to the target interface and the target information of the user in response to the target operation of the user on the browser webpage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to application programming interface (API) identification methods, apparatus, systems, and storage media. Background Technology

[0002] With the continuous development of internet technology, a large number of Application Programming Interfaces (APIs) exist in network data traffic. Furthermore, the accuracy of API calls is crucial to effective network management and security. Therefore, effectively identifying APIs in network traffic data is a pressing technical problem that needs to be solved.

[0003] In related technologies, the API to be invoked is identified by matching the feature information of the API to be invoked included in the call request with the features of multiple APIs in a preset API feature library, and then the identified API is invoked. However, the recognition capability of this method is limited by the types of API features stored in the preset API feature library. It cannot effectively identify APIs outside the preset API feature library (e.g., APIs newly added to network traffic data), thus reducing the accuracy of API identification. Summary of the Invention

[0004] This invention provides an application programming interface (API) identification method, apparatus, system, and storage medium to at least solve the problem in related technologies where the accuracy of API identification is low due to the limitation of API feature types stored in a preset API feature library. The technical solution of this invention is as follows:

[0005] According to a first aspect of the present invention, an application programming interface (API) identification method is provided, applied to a proxy server, the proxy server having reverse proxy functionality. The method includes: detecting a browser startup operation; inserting target program code into the webpage information of the browser webpage; the target program code being used to modify the request method during the call process of an interface associated with the browser; receiving a call request for the target interface returned by the browser, and decrypting the encrypted target information in the call request to obtain a decryption result; the call request being sent by the browser and being generated by the browser in response to a user's target operation on the browser webpage, based on the target program code, the target request method corresponding to the target interface, and the user's target information; and identifying the target interface based on the decryption result.

[0006] Furthermore, the determination of whether the target interface is abnormal based on the decryption result includes: when the decryption result indicates that the decryption failed, determining that the target interface is an abnormal interface and rejecting the call request; when the decryption result indicates that the decryption was successful, accepting the call request to call the target interface to the browser.

[0007] Furthermore, in response to the user's target operation on the browser webpage, the browser generates the following based on the target program code, the target request method corresponding to the target interface, and the user's target information: the browser responds to the user's target operation on the browser webpage by modifying the target request method corresponding to the target interface using the target program code; the target operation is used to request and call the target interface; the browser encrypts the user's target information according to the modified target request method, and generates a call request based on the encrypted target information.

[0008] Furthermore, upon detecting the browser's startup operation, the target program code is inserted into the webpage information of the browser's webpage, including: after detecting the browser's startup operation, associating the target program code with the engine identifier; the engine identifier indicating the presence of the target program code; and inserting the engine identifier into the webpage information of the browser's webpage.

[0009] Furthermore, the method also includes: obtaining interface information of the target interface, the interface information including at least request information, operation information and context information; and determining the service type of the target interface based on multiple decryption results and interface information corresponding to the target interface.

[0010] Furthermore, before detecting the browser startup operation and inserting the target program code into the webpage information of the browser webpage, the method further includes: receiving a browser startup request sent by the browser; the proxy server forwarding the browser startup request to the business server; the browser startup request is sent by the browser when the browser identifier displayed on the user's terminal device performs a trigger operation; receiving the page display information of the browser webpage returned by the business server; and sending the received page display information to the browser so that the browser displays the browser webpage to the user.

[0011] According to a second aspect of the present invention, another application programming interface (API) identification method is provided, applied to a browser, the method comprising:

[0012] If the target program code exists in the webpage information of the browser, in response to the user's target operation on the browser, a call request is generated based on the target program code, the target request method corresponding to the target interface, and the user's target information. The call request includes encrypted target information. The call request is sent to the proxy server so that the proxy server can decrypt the target information in the call request, obtain the decryption result, and identify the target interface based on the decryption result.

[0013] Furthermore, in response to the user's target operation on the browser webpage, a call request is generated based on the target program code, the target request method corresponding to the target interface, and the user's target information. This includes: in response to the user's target operation on the browser webpage, modifying the target request method corresponding to the target interface using the target program code; the target operation is used to request and call the target interface; the browser encrypts the user's target information according to the modified target request method, and generates a call request based on the encrypted target information.

[0014] Furthermore, the method also includes: determining that an engine identifier exists in the webpage information of the browser webpage, thereby identifying the target program code in the webpage information of the browser webpage; the engine identifier indicates the presence of the target program code, and the engine identifier is associated with the target program code.

[0015] According to a third aspect of the present invention, an application programming interface (API) identification device is provided, applied to a proxy server, the proxy server having a reverse proxy function. The device includes: a detection unit configured to detect a browser startup operation and insert target program code into the webpage information of the browser webpage; the target program code is used to modify the request method in the calling process of the browser-associated interface; a receiving unit configured to receive a call request for the target interface returned by the browser and decrypt the encrypted target information in the call request to obtain a decryption result; the call request is sent by the browser and is generated by the browser in response to the user's target operation on the browser webpage, based on the target program code, the target request method corresponding to the target interface, and the user's target information; and an identification unit configured to identify the target interface based on the decryption result.

[0016] According to a fourth aspect of the present invention, another application programming interface (API) identification device is provided, applied to a browser. The device includes: a generation unit configured to, in response to a user's target operation on a browser webpage, generate a call request based on the target program code, the target request method corresponding to the target interface, and the user's target information, when the webpage information of the browser webpage contains target program code; the call request includes encrypted target information; and a sending unit configured to send the call request to a proxy server, so that the proxy server decrypts the target information in the call request, obtains a decryption result, and identifies the target interface based on the decryption result.

[0017] According to a fifth aspect of the present invention, an application programming interface (API) identification system is provided, the system comprising: a proxy server; the proxy server being configured to execute the API identification method as described in the first aspect; and a browser; the browser being configured to execute the API identification method as described in the second aspect.

[0018] According to a sixth aspect of the present invention, a computer-readable storage medium is provided, on which instructions are stored, such that when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform an application programming interface identification method as described in the first or second aspect.

[0019] The technical solution provided by the embodiments of the present invention brings at least the following beneficial effects: When the proxy server detects that a browser has started, it inserts the target program code into the webpage information of the browser's webpage. This allows the browser to modify the request method for calling the interface based on the target program code, thereby enabling the browser to encrypt the target information of the user who started the browser according to the modified request method. Thus, the call request generated by the browser includes the encrypted target information, requiring the proxy server to decrypt the encrypted target information in the call request. Based on the decryption result, the proxy server can identify the target interface to be called by the user, thereby achieving target interface identification according to the user's target information, ensuring the matching degree between the target interface called by the proxy server and the user's target information, and thus ensuring the accuracy of the interface call. Furthermore, because the above technical solution identifies the target interface based on the user's target information, it can accurately identify the target interface in real time based on the user's target information, and the identification range is unrestricted, avoiding the limitations of related technologies where the identification range is limited by the types of API features in the API feature library.

[0020] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0021] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.

[0022] Figure 1 This is a schematic diagram illustrating an application programming interface (API) identification system according to an exemplary embodiment;

[0023] Figure 2 This is a flowchart illustrating an application programming interface (API) identification method according to an exemplary embodiment. Figure 1 ;

[0024] Figure 3 This is a flowchart illustrating an application programming interface (API) identification method according to an exemplary embodiment. Figure 2 ;

[0025] Figure 4 This is a flowchart illustrating an application programming interface (API) identification method according to an exemplary embodiment. Figure 3 ;

[0026] Figure 5 This is a frame of an application programming interface (API) identification device according to an exemplary embodiment. Figure 1 ;

[0027] Figure 6 This is a frame of an application programming interface (API) identification device according to an exemplary embodiment. Figure 2 ;

[0028] Figure 7 This is a schematic diagram of an electronic device according to an exemplary embodiment. Detailed Implementation

[0029] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0030] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0031] Before providing a detailed description of the application interface identification method provided in this application embodiment, let's briefly introduce the application scenarios and implementation environment involved in this application embodiment.

[0032] First, a brief introduction to the application scenarios involved in this application will be given.

[0033] With the continuous development of internet technology, a large number of Application Programming Interfaces (APIs) exist in network data traffic. Furthermore, the accuracy of API calls is crucial to effective network management and security. Therefore, effectively identifying APIs in network traffic data is a pressing technical problem that needs to be solved.

[0034] In related technologies, the API to be invoked is identified by matching the feature information of the API to be invoked included in the call request with the features of multiple APIs in a preset API feature library, and then the identified API is invoked. However, the recognition capability of this method is limited by the types of API features stored in the preset API feature library. It cannot effectively identify APIs outside the preset API feature library (e.g., APIs newly added to network traffic data), thus reducing the accuracy of API identification.

[0035] To address the aforementioned issues, this application provides an application programming interface (API) identification method. When a proxy server detects that a browser has started, it inserts the target program code into the webpage information of the browser's webpage. This allows the browser to modify the request method for calling the API based on the target program code, thereby enabling the browser to encrypt the target information of the user who started the browser according to the modified request method.

[0036] In this way, the browser-generated call request includes encrypted target information, which the proxy server needs to decrypt. Based on the decryption result, the proxy server can identify the target interface to be called by the user. This achieves the identification of the target interface according to the user's target information, ensuring the matching degree between the target interface called by the proxy server and the user's target information, thereby ensuring the accuracy of the interface call.

[0037] Furthermore, since the above technical solution identifies the target interface based on the user's target information, it can accurately identify the target interface in real time based on the user's target information, and the identification range is not limited, thus avoiding the limitation of the identification range being limited by the types of API features in the API feature library in related technologies.

[0038] Secondly, the implementation architecture involved in this application will be briefly introduced below.

[0039] Figure 1 This is a schematic diagram of an application programming interface (API) identification system 10 provided in this disclosure. Figure 1 As shown, the application interface identification system includes a proxy server 101, a business server 102, and a terminal device 103. The proxy server 101, business server 102, and terminal device 103 can establish a connection via a wired or wireless network. The terminal device 103 includes a browser. The proxy server 101 is associated with at least one business server 102, and the proxy server 101 is used to proxy the business operations that the business server 102 can perform.

[0040] In response to the user's browser launch operation, the browser on terminal device 103 sends an access request to proxy server 101 to access the browser page. Proxy server 101 forwards this access request to business server 102. Business server 102 sends the page information of the browser page to proxy server 101. Proxy server 101 returns the received page information of the browser page to the browser, enabling the browser to display the browser page including the page information to the user. Simultaneously, proxy server 101 inserts target code into the browser page. The user executes the corresponding target operation on the browser page to request the corresponding target interface. In response to the user's target operation, the browser encrypts the user's target information into the call request based on the target code and sends the call request to proxy server 101. After receiving the call request, proxy server 101 decrypts the encrypted target information in the call request, thereby identifying the target interface based on the decryption result.

[0041] For example, the target interface can be a Web Application Programming Interface (WebAPI).

[0042] In some embodiments, the proxy server 101 includes or is connected to a database, and the correspondence between application interfaces and web page information identifiers can be stored in the database. The browser on the terminal device 103 can access the application interfaces in the database through the proxy server 101.

[0043] In other embodiments, the proxy server 101 may be a single server, or it may be a server cluster consisting of multiple servers. In some embodiments, the server cluster may also be a distributed cluster. This application does not limit the specific implementation of the proxy server 101.

[0044] Terminal device 103 can be a mobile phone, tablet computer, desktop, laptop, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), netbook, as well as cellular phone, personal digital assistant (PDA), augmented reality (AR) / virtual reality (VR) device, etc., that can install and use content community applications (such as Kuaishou). This disclosure does not impose any special restrictions on the specific form of the terminal. It can interact with users through one or more methods such as keyboard, touchpad, touch screen, remote control, voice interaction, or handwriting devices.

[0045] Optionally, the above Figure 1 In the application programming interface (API) identification system shown, the proxy server 101 can be connected to at least one terminal device 103. This application does not limit the number or type of terminal devices 103.

[0046] The application programming interface identification method provided in this application embodiment can be applied to the aforementioned... Figure 1 The implementation architecture shown includes a browser and a proxy server for the terminal device. For ease of understanding, the application programming interface (API) identification method provided in this application will be described in detail below with reference to the accompanying drawings.

[0047] Figure 2 This is a flowchart illustrating an application programming interface (API) identification method according to an exemplary embodiment, such as... Figure 2 As shown, the application interface identification method includes the following steps. For ease of description, "application interface" will be referred to as "interface".

[0048] S21, the proxy server detects the browser's startup operation and inserts the target program code into the webpage information of the browser's webpage.

[0049] The target program code is used to modify the request method during the call process of the browser's associated interface, so that the browser performs an operation to encrypt the user's target information during the process of generating the call request.

[0050] In some implementations, when a user initiates an access operation to a browser through a terminal device, and the browser responds to the access operation by displaying the corresponding browser webpage to the user, it indicates that the browser is performing a startup operation, that is, the operation of displaying a browser webpage to the user.

[0051] S22, if the target program code exists in the webpage information of the browser webpage, the browser responds to the user's target operation on the browser webpage by generating a call request based on the target program code, the target request method corresponding to the target interface, and the user's target information.

[0052] The generated call request includes encrypted target information. Typically, this target information is encrypted using a preset encryption rule.

[0053] In some implementations, the target information can be any one or both of the following: user authentication information entered by the user on a browser webpage and user information stored on the browser's corresponding terminal device. For example, the user authentication information entered by the user can be a user username and password. The user information stored on the terminal device can be understood as data information (usually encrypted) stored on the user's local terminal device used to identify the user; this data information can be temporarily or permanently stored.

[0054] The aforementioned target request method can be understood as the method by which a call request is generated during the execution of a call request to the target interface. For example, the call request can be an XHR request, a request request, or a fetch request. If the call request is an XHR request, the request method of the generated XHR request is called the XHR method. If the call request is a request request, the request method of the generated request request is called the request method. If the call request is a fetch request, the request method of the generated fetch request is called the fetch request.

[0055] In some implementations, the target operation can be a click-triggered operation, such as a single click or double click, performed by a user on target page information on a browser page. The target page information is the information that the user determines from the page information to be associated with an interface. The interface associated with the target page information is the target interface.

[0056] Understandably, after the browser starts, it displays a browser page to the user. The user performs a target operation on the target page information to request a target interface. In response to this target operation, the browser calls the target program code inserted in the webpage information, along with the target request method corresponding to the target interface and the user's target information, to generate a call request. This call request includes encrypted target information, thus achieving encryption of the call request based on the user's target information. Therefore, compared to the plaintext call requests used in related technologies, the technical solution of this application generates an ciphertext call request, which has higher security. Furthermore, it is specific to the user's target information.

[0057] S23, the browser sends a request to the proxy server.

[0058] The browser sends the generated call request to the proxy server, requesting the proxy server to call the target interface.

[0059] S24, the proxy server receives the call request for the target interface returned by the browser, and decrypts the encrypted target information in the call request to obtain the decryption result.

[0060] The proxy server receives the request from the browser. Simultaneously, the proxy server decrypts the target information based on preset decryption rules. These preset decryption rules correspond to the preset encryption rules.

[0061] S25, the proxy server identifies the target interface based on the decryption result.

[0062] The above decryption results fall into two categories: successful decryption and unsuccessful decryption.

[0063] Specifically, when the proxy server fails to decrypt, the decryption result indicates that decryption failed. That is, if the target interface to be called is determined to be an abnormal interface, the proxy server will reject the call request and will not call the target interface so that the page information corresponding to the target interface will not be displayed on the browser webpage.

[0064] Generally, a decryption result of 0 indicates decryption failure, while a decryption result of 1 indicates decryption success.

[0065] When the proxy server successfully decrypts, the resulting decryption result indicates successful decryption. That is, it is determined that the target interface to be called is an interface that matches the user's target information. Then, the proxy server accepts the call request, that is, the proxy server calls the target interface and sends the target interface to the browser so that the browser displays the page information corresponding to the target interface.

[0066] Through the above embodiments, based on the target program code, encrypted target information is added to the call request. This allows the proxy server to identify the target interface to be called by the user based on the decryption result. This achieves target interface identification according to the user's target information, ensuring a high degree of matching between the target interface called by the proxy server and the user's target information, thereby guaranteeing the accuracy of the interface call. Furthermore, because the above embodiments identify the target interface based on the user's target information, they can accurately identify the interface in real time based on the user's target information, with an unrestricted identification range, avoiding the limitations of related technologies where the identification range is restricted by the types of API features in the API feature library.

[0067] In some implementations, the proxy server can detect a browser launch operation in step S21 based on the following scenario: When a user performs a trigger operation on the browser identifier displayed on the user's terminal device, the browser responds to the trigger operation performed by the user by sending a browser launch request to the proxy server. Upon receiving the browser launch request, the proxy server forwards it to the business server. The business server accepts the browser launch request and sends the page display information of the browser webpage to the proxy server. The proxy server receives the page display information of the browser webpage returned by the business server and sends the received page display information to the browser, causing the browser to display the browser webpage to the user, thus indicating that a browser launch operation has occurred.

[0068] As a refinement and extension of the specific implementation methods of the above embodiments, and in order to fully illustrate the specific implementation process of this embodiment, this application provides another application programming interface (API) identification method, combined with... Figure 2 ,like Figure 3 As shown, the process of inserting the target program code into the webpage information of the browser webpage in step S21 specifically includes:

[0069] S211, the proxy server detects the browser's launch operation and associates the target program code with the engine identifier.

[0070] The engine identifier mentioned above is used to indicate the presence of target program code.

[0071] The proxy server inserts the engine identifier into the webpage information of the browser to facilitate the identification of the target program code.

[0072] S212, the proxy server inserts the engine identifier into the webpage information of the browser webpage.

[0073] Based on the association between the engine identifier and the target program code, the target program code can be invoked based on the engine identifier.

[0074] Furthermore, as a specific implementation, the method of generating the invocation request in step S22 includes: the browser responding to the user's target operation on the browser webpage by modifying the target request method corresponding to the target interface using target program code, so that the modified target request method can perform encryption operations on the target information. The browser encrypts the user's target information according to the modified target request method and generates an invocation request based on the encrypted target information.

[0075] For example, the original request method for generating XHR requests is modified. According to the modified request method, when generating XHR requests, the encrypted target information is also added to the XHR requests to be generated, so that the generated XHR requests include the encrypted target information.

[0076] In another specific implementation, step S22 above determines whether target program code exists in the browser webpage in the following way: The browser can typically query the browser webpage for an identifier indicating whether target program code exists to determine if target program code exists. Specifically, if the browser determines that the browser webpage has an identifier indicating that target program code exists, then the target program code exists; if the browser determines that the browser webpage does not have an identifier indicating that target program code does not exist, then the target program code does not exist, indicating that the proxy server has not inserted the target program code into the browser webpage or has not successfully inserted the target program code into the browser webpage.

[0077] For example, the identifier of the target program code can be an engine identifier.

[0078] Furthermore, embodiments of this application provide yet another method for identifying application programming interfaces (APIs), combined with... Figure 2 ,like Figure 4As shown, after performing step S25 above, the service type of the target interface can be determined by performing the following steps.

[0079] S41, the proxy server obtains the interface information of the target interface.

[0080] The interface information includes at least one or more of the following: request information, operation information, and context information.

[0081] Specifically, request information may include the request content associated with the target interface, the request method that generated the request, the request type, and the response information associated with the request. Operation information may be information about the relevant operations performed by the user on the page information of the target interface displayed on the terminal device, such as the number of clicks and the click duration. Context information may include the descriptive information of the target interface.

[0082] S42, the proxy server determines the service type of the target interface based on the multiple decryption results and interface information corresponding to the target interface.

[0083] Understandably, the proxy server determines the service type of the target interface based on the number of successful and failed decryption results among the multiple decryption results corresponding to the target interface, as well as the target interface information.

[0084] In some implementations, if the number of successful calls to the target interface exceeds a preset threshold, and the number of clicks for each user exceeds a preset number, then the service type of the target interface is determined to be a page information refresh (i.e., repeatedly updating the page) service.

[0085] Taking the ticket-grabbing type corresponding to the target interface as an example, the service type will be further explained. Only after detecting that a user has repeatedly performed ticket-grabbing operations on the ticket-grabbing page of the target interface can the target page be displayed to the user through the browser, allowing the user to operate on the target page to complete the ticket purchase.

[0086] Through the above embodiments, based on the accurate identification of the target interface, the interface information of the target interface and the corresponding multiple decryption results are analyzed to determine the service type of the target interface, so as to identify the services that the interface can provide.

[0087] To achieve the above functions, the application programming interface (API) identification device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art will readily recognize that, based on the algorithmic steps of the examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0088] This disclosure also provides an embodiment such as Figure 5 The application interface identification device shown is applied to a proxy server, which has reverse proxy functionality. The application interface identification device includes a detection unit 511, a receiving unit 512, and an identification unit 513.

[0089] The detection unit 511 is configured to detect the browser's startup operation and insert target program code into the webpage information of the browser's webpage; the target program code is used to modify the request method in the process of calling the browser's associated interface.

[0090] The receiving unit 512 is configured to receive the call request for the target interface returned by the browser, and decrypt the encrypted target information in the call request to obtain the decryption result; the call request is sent by the browser and is generated by the browser in response to the user's target operation on the browser webpage, based on the target program code, the target request method corresponding to the target interface, and the user's target information.

[0091] The identification unit 513 is configured to identify the target interface based on the decryption result.

[0092] In one possible implementation, the identification unit 513 is specifically configured to: determine the target interface as an abnormal interface and reject the call request when the decryption result indicates that the decryption failed; and accept the call request to call the target interface to the browser when the decryption result indicates that the decryption was successful.

[0093] In another possible implementation, the receiving unit 512 is specifically configured as follows: in response to the user's target operation on the browser webpage, the browser modifies the target request method corresponding to the target interface using target program code; the target operation is used to request the call to the target interface; the browser encrypts the user's target information according to the modified target request method, and generates a call request based on the encrypted target information.

[0094] In another possible implementation, the detection unit 511 is specifically configured to: after detecting the browser's startup operation, associate the target program code with the engine identifier; the engine identifier indicates the existence of the target program code; and insert the engine identifier into the webpage information of the browser webpage.

[0095] In another possible implementation, the identification unit 513 is further configured to: acquire interface information of the target interface, the interface information including at least request information, operation information and context information; and determine the service type of the target interface based on multiple decryption results and interface information corresponding to the target interface.

[0096] In another possible implementation, the device is further configured to: receive a browser launch request sent by a browser, and the proxy server forwards the browser launch request to the business server; the browser launch request is sent by the browser when the browser identifier displayed on the user's terminal device performs a triggering operation; receive page display information of the browser webpage returned by the business server; and send the received page display information to the browser so that the browser displays the browser webpage to the user.

[0097] This disclosure also provides an embodiment such as Figure 6 The application interface identification device shown is applied to a browser and includes a generation unit 611 and a sending unit 612.

[0098] The generation unit 611 is configured to, in response to the user's target operation on the browser webpage, generate a call request based on the target program code, the target request method corresponding to the target interface, and the user's target information, when the target program code exists in the webpage information of the browser webpage. The call request includes encrypted target information.

[0099] The sending unit 612 is configured to send a call request to the proxy server so that the proxy server can decrypt the target information in the call request, obtain the decryption result, and identify the target interface based on the decryption result.

[0100] In one possible implementation, the generation unit 611 is specifically configured to, in response to a user's target operation on the browser webpage, modify the target request method corresponding to the target interface using the target program code; the target operation is used to request to call the target interface; the browser encrypts the user's target information according to the modified target request method, and generates a call request based on the encrypted target information.

[0101] In one possible implementation, the device is specifically configured to determine that an engine identifier exists in the webpage information of the browser webpage, thereby identifying the target program code in the webpage information of the browser webpage; the engine identifier indicates the presence of the target program code, and the engine identifier is associated with the target program code.

[0102] Regarding the apparatus in the above embodiments, the specific manner in which each unit module performs its operations has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0103] Figure 7 This is a schematic diagram of an electronic device provided in this application. (For example...) Figure 7 The electronic device 50 may include at least one processor 501 and a memory 503 for storing processor-executable instructions. The processor 501 is configured to execute the instructions in the memory 503 to implement the application programming interface (API) identification method described in the following embodiments.

[0104] In addition, electronic device 50 may also include communication bus 502, at least one communication interface 504, input device 506 and output device 505.

[0105] Processor 501 may be a processor (central processing unit, CPU), microprocessor unit, ASIC, or one or more integrated circuits for controlling the execution of programs according to the present application.

[0106] The communication bus 502 may include a path for transmitting information between the aforementioned components.

[0107] Communication interface 504 uses any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc.

[0108] Input device 506 is used to receive input signals and output device 505 is used to output signals.

[0109] Memory 503 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. Memory may exist independently and be connected to the processing unit via a bus. Memory may also be integrated with the processing unit.

[0110] The memory 503 stores instructions for executing the scheme of this application, and the processor 501 controls the execution. The processor 501 executes the instructions stored in the memory 503 to implement the functions of the method of this application.

[0111] In a specific implementation, as one example, the processor 501 may include one or more CPUs, for example... Figure 7 CPU0 and CPU1 in the CPU.

[0112] In a specific implementation, as one example, the electronic device 50 may include multiple processors, such as... Figure 7 Processors 501 and 507 are shown in the diagram. Each of these processors can be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor here can refer to one or more devices, circuits, and / or processing cores used to process data (such as computer program instructions).

[0113] The electronic device is as follows Figure 7 The diagram includes a processor 501 and a memory 503 for storing executable instructions of the processor 501; wherein the processor 501 is configured to execute executable instructions to implement the application programming interface (API) identification method as described in any of the possible embodiments above. Furthermore, it achieves the same technical effect, and to avoid repetition, will not be described further here.

[0114] This application also provides a computer-readable storage medium, which, when executed by a processor of an application programming interface (API) identification device or electronic device, enables the API identification device or electronic device to perform an API identification method as described in any of the possible embodiments above. The same technical effects can be achieved, and to avoid repetition, further details are omitted here.

[0115] This application also provides a computer program product, including a computer program or instructions, which are executed by a processor using an application programming interface (API) identification method as described in any of the possible implementations above. This achieves the same technical effect, and to avoid repetition, will not be repeated here.

[0116] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0117] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A method for identifying application programming interfaces (APIs), characterized in that, Applied to a proxy server, wherein the proxy server has reverse proxy functionality, the method includes: Upon detecting the browser's startup operation, the target program code is inserted into the webpage information of the browser's webpage; the target program code is used to modify the request method during the call process of the browser's associated interface, so that the browser performs an operation to encrypt the user's target information during the process of generating the call request. The system receives a call request to the target interface returned by the browser and decrypts the encrypted target information in the call request to obtain a decryption result. The call request is sent by the browser and is generated by the browser in response to the user's target operation on the browser webpage, based on the target program code, the target request method corresponding to the target interface, and the user's target information. Based on the decryption result, the target interface is identified.

2. The method according to claim 1, characterized in that, Determining whether the target interface is abnormal based on the decryption result includes: When the decryption result indicates that decryption failed, the target interface is determined to be an abnormal interface, and the call request is rejected; When the decryption result indicates successful decryption, the call request is accepted to invoke the target interface to the browser.

3. The method according to claim 1, characterized in that, The browser responds to the user's target operation on the browser webpage by generating a call request based on the target program code, the target request method corresponding to the target interface, and the user's target information. This includes: the browser responding to the user's target operation on the browser webpage by modifying the target request method corresponding to the target interface using the target program code; the target operation is used to request the call to the target interface; the browser encrypts the user's target information according to the modified target request method, and generates a call request based on the encrypted target information.

4. The method according to claim 1, characterized in that, The step of detecting the browser's launch operation and inserting the target program code into the webpage information of the browser webpage includes: Upon detecting the browser's launch operation, the target program code is associated with an engine identifier; the engine identifier indicates the presence of the target program code. The engine identifier is inserted into the webpage information of the browser webpage.

5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: Obtain the interface information of the target interface, wherein the interface information includes at least one or more of the following: request information, operation information, and context information; Based on the multiple decryption results corresponding to the target interface and the interface information, the service type of the target interface is determined.

6. The method according to any one of claims 1 to 4, characterized in that, Before detecting the browser launch operation and inserting the target program code into the webpage information of the browser webpage, the method further includes: Upon receiving a browser launch request from the browser, the proxy server forwards the browser launch request to the business server; the browser launch request is sent by the browser when the user performs a triggering operation on the browser identifier displayed on the user's terminal device; Receive page display information of the browser webpage returned by the business server; The received page display information is sent to the browser so that the browser displays the webpage to the user.

7. A method for identifying application programming interfaces (APIs), characterized in that, Applied to a browser, the method includes: If the webpage information of the browser contains target program code, in response to the user's target operation on the browser webpage, a call request is generated based on the target program code, the target request method corresponding to the target interface, and the user's target information. The call request includes encrypted target information. The target program code is used to modify the request method in the call process of the browser-associated interface so that the browser performs an operation to encrypt the user's target information during the process of generating the call request. The call request is sent to the proxy server so that the proxy server can decrypt the target information in the call request, obtain the decryption result, and identify the target interface based on the decryption result.

8. The method according to claim 7, characterized in that, The response to the user's target operation on the browser webpage involves generating a call request based on the target program code, the target request method corresponding to the target interface, and the user's target information, including: In response to a user's target operation on the browser webpage, the target program code is used to modify the target request method corresponding to the target interface; the target operation is used to request and invoke the target interface. The browser encrypts the user's target information according to the modified target request method, and generates a call request based on the encrypted target information.

9. The method according to claim 7 or 8, characterized in that, The method further includes: The presence of an engine identifier in the webpage information of the browser webpage is determined to identify the target program code in the webpage information of the browser webpage; the engine identifier indicates the presence of the target program code, and the engine identifier is associated with the target program code.

10. An application programming interface (API) identification device, characterized in that, Applied to a proxy server, wherein the proxy server has reverse proxy functionality, the device includes: The detection unit is configured to detect the browser's startup operation and insert target program code into the webpage information of the browser's webpage; the target program code is used to modify the request method in the process of calling the browser's associated interface, so that the browser performs an operation to encrypt the user's target information during the process of generating the call request. The receiving unit is configured to receive the call request for the target interface returned by the browser, and decrypt the encrypted target information in the call request to obtain the decryption result; the call request is sent by the browser and is generated by the browser in response to the user's target operation on the browser webpage, based on the target program code, the target request method corresponding to the target interface, and the user's target information. The identification unit is configured to identify the target interface based on the decryption result.

11. An application programming interface (API) identification device, characterized in that, Applied to a browser, the device includes: The generation unit is configured to, in response to a user's target operation on a browser webpage, generate a call request based on the target program code, the target request method corresponding to the target interface, and the user's target information, when the target program code exists in the webpage information of the browser webpage. The call request includes encrypted target information. The target program code is used to modify the request method in the call process of the browser-associated interface so that the browser performs an operation to encrypt the user's target information during the generation of the call request. The sending unit is configured to send the call request to the proxy server so that the proxy server decrypts the target information in the call request, obtains the decryption result, and identifies the target interface based on the decryption result.

12. An application programming interface (API) identification system, characterized in that, The system includes: Proxy server; the proxy server is used to execute the application interface identification method as described in any one of claims 1-6; A browser; the browser is used to execute the application programming interface identification method as described in any one of claims 7-9.

13. A computer-readable storage medium storing instructions thereon, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is enabled to perform the application programming interface identification method as claimed in any one of claims 1-6 or any one of claims 7-9.

Citation Information

Patent Citations

  • API request encryption method, data interaction method and system

    CN108512666A

  • Processing method, device and system for interface request

    CN112182617A