Application program interface processing method and device, electronic equipment and readable storage medium

Through filtering and statistical processing of network traffic, API resource information is automatically identified, solving the complex and error-prone problem of manual sorting, achieving rapid and accurate identification of API resources and improving security.

CN118784357APending Publication Date: 2024-10-15RIVER INFORMATION TECH SHANGHAI CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411080855.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

In the existing technology, manual sorting of API resources on a regular basis is complex and error-prone, resulting in reduced API resource processing efficiency and reliability, and making it difficult to quickly and accurately identify API resource information in network traffic.

Method used

By filtering the network traffic, the traffic to be identified for the API resources to be identified is obtained, and statistical processing of the API access characteristics is performed, and the API resource information of the specified operation method under the specified calling path is identified based on the statistical parameters to achieve automated identification.

Benefits of technology

Without additional manual participation, API resource information can be quickly and accurately identified, which improves the efficiency and reliability of API resource identification, reduces manual intervention and business impact, and enhances the security of API resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118784357A_ABST
    Figure CN118784357A_ABST
Patent Text Reader

Abstract

The invention discloses an application program interface processing method and device, electronic equipment and a readable storage medium, and relates to the technical field of data processing, in particular to the technical field of artificial intelligence such as big data and information processing. According to the specific implementation scheme, the method comprises the following steps: filtering obtained network traffic to obtain to-be-identified traffic of to-be-identified application program interface (API) resources; performing statistical processing with API access features on the to-be-identified traffic to obtain API access feature statistical parameters of a specified operation method under a specified call path; and obtaining API resource information of a specified operation method under the specified call path according to the API access feature statistical parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and specifically to the field of artificial intelligence technology such as big data and information processing. Background Art

[0002] The traffic in the network is very huge, and the Application Programming Interface (API) resources generated by it also exist in a certain amount.

[0003] Usually, the existing API resources in the system can be manually sorted out regularly to achieve security protection of the API. This will make the operation complicated, time-consuming, and error-prone, thus reducing the efficiency and reliability of API resource processing. Summary of the invention

[0004] The present disclosure provides a method, device, electronic device and readable storage medium for processing an application program interface.

[0005] According to one aspect of the present disclosure, a method for processing an application program interface is provided, comprising:

[0006] Filter the acquired network traffic to obtain the traffic to be identified of the application program interface (API) resource to be identified;

[0007] Performing statistical processing on the traffic to be identified with API access characteristics to obtain API access characteristic statistical parameters of a specified operation method under a specified call path;

[0008] According to the API access feature statistical parameters, API resource information of the specified operation method under the specified calling path is obtained.

[0009] According to another aspect of the present disclosure, there is provided a device for processing an application program interface, comprising:

[0010] A filtering unit, used for filtering the acquired network traffic to obtain the traffic to be identified of the application program interface API resource to be identified;

[0011] A statistical unit, used for performing statistical processing on the traffic to be identified with API access characteristics to obtain API access characteristic statistical parameters of a specified operation method under a specified call path;

[0012] The identification unit is used to obtain the API resource information of the specified operation method under the specified calling path according to the API access feature statistical parameters.

[0013] According to another aspect of the present disclosure, there is provided an electronic device, comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any possible implementation manner and the aspects described above.

[0017] According to yet another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method of the above-mentioned aspect and any possible implementation manner.

[0018] According to yet another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the computer program implements the above-mentioned aspects and any possible implementation method.

[0019] It can be seen from the above technical scheme that the embodiment of the present disclosure filters the acquired network traffic to obtain the traffic to be identified of the API resource to be identified, and then performs statistical processing with API access characteristics on the traffic to be identified to obtain API access characteristic statistical parameters of the specified operation method under the specified calling path, so that the API resource information of the specified operation method under the specified calling path can be obtained according to the API access characteristic statistical parameters, and the API resource information in the network traffic can be quickly and accurately identified without additional human participation, with simple operation, short processing time and high accuracy, thereby improving the efficiency and reliability of API resource identification.

[0020] In addition, by adopting the technical solution provided by the present disclosure, API resource information can be automatically identified so that it can be added to the API resource list in a timely manner, thereby reducing the possibility of manual intervention and effectively improving the efficiency and reliability of API resource sorting.

[0021] In addition, by adopting the technical solution provided by the present invention, API resource information can be automatically identified and added to the API resource list in a timely manner, thereby effectively improving the security of API resources and reducing the impact on business.

[0022] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments or prior art descriptions. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. The drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure. Among them:

[0024] Figure 1 is a schematic diagram according to a first embodiment of the present disclosure;

[0025] Figure 2 is a schematic diagram according to a second embodiment of the present disclosure;

[0026] Figure 3 The block diagram is a block diagram of an electronic device used to implement the method for processing the application program interface of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0027] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0028] Obviously, the described embodiments are only part of the embodiments of the present disclosure, but not all of them. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present disclosure.

[0029] It should be noted that the terminals involved in the embodiments of the present disclosure may include but are not limited to computers (Personal Computer, PC), mobile phones, personal digital assistants (Personal Digital Assistant, PDA), wireless handheld devices, tablet computers and other smart devices; display devices may include but are not limited to personal computers, televisions and other devices with display functions.

[0030] In addition, the term "and / or" in this article is only a description of the association relationship between the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0031] The traffic in the network is very large, and there is a part of the API resource traffic generated by accessing API resources in the network traffic. These API resources can be interfaces based on HyperText Transfer Protocol (HTTP), or interfaces based on User Datagram Protocol (TCP), or interfaces based on Transmission Control Protocol (UDP), or interfaces based on WebSocket, or interfaces based on other Internet transmission protocols, which are not particularly limited in this embodiment.

[0032] As API resources carry more and more complex application logic and more and more sensitive data, they have gradually become the focus of attackers, leading to frequent data leakage incidents. Therefore, before protecting these API resources, you first need to sort out the API resources in the system.

[0033] Usually, the existing API resources in the system can be manually sorted out regularly to achieve security protection of the API. This will make the operation complicated, time-consuming, and error-prone, thus reducing the efficiency and reliability of API resource processing.

[0034] Therefore, there is an urgent need to provide a processing method that can quickly and reliably automatically identify API resource information so that it can be added to the API resource list in a timely manner to improve the efficiency and reliability of API resource sorting.

[0035] Figure 1 is a schematic diagram according to the first embodiment of the present disclosure, such as Figure 1 shown.

[0036] 101. Filter the acquired network traffic to obtain traffic to be identified of the API resource to be identified.

[0037] Traffic monitoring can be achieved by means of traffic bypass mirroring, and the monitored network traffic, for example, all the system traffic data, can be determined as traffic data for resource identification, so that resource identification can be achieved without generating interference data. These network traffic can be the traffic generated by calling APIs or background traffic. In order to better manage API resources, it is necessary to identify the API resources used from the network traffic.

[0038] 102. Perform statistical processing on the traffic to be identified that has API access characteristics to obtain API access characteristic statistical parameters of a specified operation method under a specified call path.

[0039] 103. Obtain API resource information of a specified operation method under the specified calling path according to the API access feature statistical parameters.

[0040] At this point, after obtaining the API resource information of the specified operation method under the specified call path, it can be further added to the API resource list to achieve automatic identification of the API resource information.

[0041] In this way, the acquired network traffic is filtered to obtain the traffic to be identified of the API resource to be identified, and then the traffic to be identified is statistically processed with API access characteristics to obtain API access characteristic statistical parameters of the specified operation method under the specified calling path, so that the API resource information of the specified operation method under the specified calling path can be obtained according to the API access characteristic statistical parameters, and the API resource information in the network traffic can be quickly and accurately identified without additional human participation, with simple operation, short processing time and high accuracy, thereby improving the efficiency and reliability of API resource identification.

[0042] In this application, the word "specified" in the specified application does not have any special meaning. It is just to specify the current operation object. Therefore, the specified calling path is the ordinary calling path, and the specified operation method is the ordinary operation method.

[0043] It should be noted that part or all of the execution entities of 101 to 103 may be applications located in the local terminal, or may also be functional units such as plug-ins or software development kits (SDK) set in the applications located in the local terminal, or may also be processing engines located in the network-side server, or may also be distributed systems located on the network side, for example, processing engines or distributed systems in processing devices of application program interfaces on the network side, etc. This embodiment does not specifically limit this.

[0044] It is understandable that the application may be a local program (nativeApp) installed on the local terminal, or may be a webpage program (webApp) of a browser on the local terminal, which is not limited in this embodiment.

[0045] In this way, the acquired network traffic is filtered to obtain the traffic to be identified of the API resource to be identified, and then the traffic to be identified is statistically processed with API access characteristics to obtain API access characteristic statistical parameters of the specified operation method under the specified calling path, so that the API resource information of the specified operation method under the specified calling path can be obtained according to the API access characteristic statistical parameters, and the API resource information in the network traffic can be quickly and accurately identified without additional human participation, with simple operation, short processing time and high accuracy, thereby improving the efficiency and reliability of API resource identification.

[0046] Optionally, in a possible implementation of this embodiment, in 101, the acquired network traffic can be specifically feature processed to obtain traffic feature data of the network traffic, and then, non-API resource traffic in the network traffic can be excluded based on the traffic feature data of the network traffic to obtain the traffic to be identified of the API resource. By excluding non-API resource traffic with obvious non-API resource traffic features from the network traffic based on the traffic feature data of the network traffic, the network traffic after excluding the non-API resource traffic can reduce a certain degree of interference and false alarms, can reduce potential risks to API resources, and improve the security and reliability of API resources.

[0047] The non-API resource traffic may include but is not limited to at least one of the following traffic:

[0048] Invalid traffic;

[0049] Machine flow;

[0050] Web traffic;

[0051] Attack traffic; and

[0052] Network device traffic.

[0053] The so-called invalid traffic refers to the network traffic corresponding to the response status code with a specific value, for example, the network traffic with a response status code greater than or equal to 400, or the network traffic with a response status code of 202.

[0054] Taking HTTP-based network traffic as an example, the response status code of the access response in HTTP indicates the processing status of the access request. Among them, a response status code greater than or equal to 400 usually indicates that an abnormality has occurred in the client, such as 400-Bad Request, 401-Unauthorized, 403-Forbidden, 404-Not Found, etc.

[0055] These response status codes indicate that there is a problem with the access request, which may be due to a client error, permission problem, or resource not found. They may interfere with normal network traffic statistics and analysis. Therefore, when counting the unidentified traffic of the unidentified API resources, these abnormal access requests are usually not included in the normal traffic statistics, thereby effectively eliminating the impact of abnormal situations and reducing the impact on the evaluation of API resource usage.

[0056] Generally speaking, developers or system administrators are more concerned about the processing of normal access requests, and would like to find and solve abnormal access requests in a timely manner. Therefore, when counting the traffic to be identified for the API resources to be identified, excluding abnormal access requests can better focus on normal network traffic statistics and analysis.

[0057] The so-called machine traffic refers to the value of the User Agent (UA) field in the header data of the access request, which is a programming language type such as Python type and Java type.

[0058] The network traffic generated by machine behaviors such as crawlers, monitoring tools, and testing tools usually does not represent the behavior of real users. Excluding these network traffic can make the statistics of the unidentified traffic of the unidentified API resources more accurate, better reflect the behavior of real users, and more accurately measure the activities of real users, so as to better understand user needs, behaviors, and interesting things, and provide more reliable data support for business decisions.

[0059] The network traffic generated by machine behaviors such as crawlers, monitoring tools, and testing tools may impose additional burdens on the performance and availability of API resources, especially when these traffics access API resources in large quantities. Therefore, before counting the traffic to be identified for the API resources to be identified, by excluding these machine traffics, performance issues caused by non-real users accessing API resources can be effectively avoided.

[0060] The so-called Web traffic refers to the network traffic generated by accessing static pages such as news and novels. It can also be called static resource traffic. For example, the suffix of the access path may include but is not limited to at least one of the following: .html, .gif, .jpg, .jpeg, .png, .bmp, .pdf, .swf, .js, .css, and .ico.

[0061] Static resource traffic is more for display purposes, not API resource traffic. Therefore, before counting the traffic of the API resources to be identified, you can exclude these static resource traffic. Static resource traffic may also occupy a large amount of network bandwidth and server resources. Therefore, before counting the traffic of the API resources to be identified, excluding these traffic can avoid performance problems caused by a large amount of non-API resource traffic.

[0062] Static resources such as images, style sheets, JavaScript files, etc. are usually cached by browsers, and they are not requested every time when accessing a web page. Therefore, access requests for these static resources do not represent actual requests for API resources by users. Excluding these static resource traffic can make the statistics of API resource traffic more accurate and better reflect the actual usage of API resources.

[0063] When analyzing the usage of API resources, developers or system administrators are more interested in the actual calls made by users to API resources rather than the access to static resources. Excluding these static resource traffic can make the analysis more focused on the core functions and user behaviors of API resources.

[0064] The so-called attack traffic refers to the network traffic generated by attack behaviors, such as Web Application Firewall (WAF) attacks, brute force cracking, database collisions, and Distributed Denial of Service (DDos) attacks.

[0065] WAF attacks can be identified based on whether the access request contains Structured Query Language (SQL) statement injection. However, access requests such as brute force cracking, database collision, and DDos attacks are normal and cannot be identified by the above method. In order to analyze this part of the attack traffic, it can be judged based on some other characteristics of the network traffic over a period of time.

[0066] Take brute force cracking as an example. If a normal user enters an incorrect password, the time interval between entering the password again is usually in the order of seconds. However, if a tool is used to traverse this account to try passwords, there may be hundreds of login requests in one second. Therefore, if the same IP address and the same account use passwords above the threshold number (such as 3) to log in within one second, it can be judged as brute force cracking.

[0067] Attack traffic may contain malicious access requests that aim to exploit vulnerabilities or weaknesses in API resources. These attacks may include SQL injection, cross-site scripting (XSS), cross-site request forgery (CSRF), etc. Excluding these attack traffic and preventing them from interfering with the identification of API resources enables API resources to be identified quickly and accurately, which can reduce potential risks to API resources and improve the security and reliability of API resources.

[0068] Attack traffic may cause the data returned by API resources to be abnormal or tampered, thus affecting the integrity and accuracy of the data. Eliminating attack traffic helps ensure that the data returned by API resources is authentic and trustworthy, protecting users and systems from attacks.

[0069] Attack traffic may have a negative impact on the performance and availability of API resources. Attackers may send a large number of malicious access requests, causing server overload, resource exhaustion, or service unavailability. Excluding attack traffic can effectively avoid statistical performance issues caused by attack traffic.

[0070] According to laws, regulations or industry standards, protecting API resources from attacks is an important compliance requirement. Excluding attack traffic from interfering with the identification of API resources enables quick and accurate identification of API resources, helps meet data security and privacy protection requirements, and ensures compliance with relevant laws, regulations and industry standards.

[0071] The so-called network device traffic refers to the network traffic of network device parameters such as ports, service ports, external network addresses (IP segments, IP addresses) of network devices such as switches and routers. The network device parameter values ​​in these network traffic can be obtained through the collector.

[0072] In computer networks, the allocation of intranet addresses and external network addresses is different. Intranet addresses such as 10.xxx, 172.16.xx, 192.168.xx, etc. are generally not used on the Internet. External network addresses can be used to uniquely identify network devices on the Internet. External network addresses are allocated by the Internet Assigned Numbers Authority or Internet service providers.

[0073] The ports and service ports of network devices are usually used to manage and maintain the network devices themselves, rather than the actual access requests of users to API resources. These flows do not represent the actual request behavior of users to API resources. Excluding these network flows can improve the accuracy of API resource flows and better reflect the actual user access behavior.

[0074] The external network address traffic of network devices usually comes from malicious network behaviors such as network scanning and intrusion attempts. These traffic may be a precursor to potential attacks or abuse of API resources. By excluding these network traffic and preventing it from interfering with the identification of API resources, API resources can be identified quickly and accurately, which can help protect the security of API resources and reduce potential risks of API resources.

[0075] Optionally, in a possible implementation of the present embodiment, in 102, the access traffic of the specified operation method under the specified call path can be obtained from the traffic to be identified, and then, based on the API access characteristics of the access traffic, the API access characteristic statistical parameters of the specified operation method under the specified call path can be obtained.

[0076] The API access feature statistical parameters of the specified operation method under the specified call path may include but are not limited to at least one of the following parameters:

[0077] Response type (content_type) parameter;

[0078] AJAX request parameters;

[0079] few_ua_score parameter;

[0080] non_browser_score parameter;

[0081] Average response time parameter;

[0082] Response body length parameter;

[0083] Visits parameters;

[0084] Method of operation distribution parameters; and

[0085] Access source distribution parameters.

[0086] The so-called response type (content_type) parameter is used to indicate the case where the value of the response type (content_type) field in the header data of the access response of the same operation method under the same call path is a specific type, such as application, json, xml, etc. For example, the value of the response type (content_type) field in the header data of all access responses of the same operation method under the same call path can be obtained, and the access response with a value of a specific type, such as application, json, xml, etc., is scored as 1, representing API resource traffic, otherwise, the score is 0, and all the scores are averaged to obtain the average score as the response type (content_type) parameter.

[0087] The so-called AJAX request parameters are used to indicate the situation where the header data of the access request for the same operation method under the same call path contains a specific identifier. For example, the value of the X-Requested-With field is XHR (XMLHttpRequest), which corresponds to the XHR type AJAX request; it does not contain the User Agent (UA) field or the source page (Referer) field, which corresponds to the Fetch type AJAX request; it contains the source website (Origin) field, which corresponds to the Fetch type AJAX request; the value of the response type (content_type) field is application, json, xml, etc., which corresponds to the Fetch type AJAX request, etc. For example, the value of the X-Requested-With field in the header data of all access requests for the same operation method under the same call path can be obtained. For access requests with a value of XHR (XMLHttpRequest), the header data of all access requests for the same operation method under the same call path can be obtained. For access requests that do not contain a user agent (User Agent, UA) field or a source page (Referer) field, the header data of all access requests for the same operation method under the same call path can be obtained. For access requests that contain a source website (Origin) field, the value of the response type (content_type) field in the header data of all access responses for the same operation method under the same call path can be obtained. Any of the access requests with a value of application, json, and xml can be counted as 1, representing API resource traffic. Otherwise, the score is 0. All scores are averaged to obtain an average score as an AJAX request parameter.

[0088] The so-called few_ua_score parameter is used to indicate the situation where the User Agent (UA) field in the header data of the access request of the same operation method under the same call path has different values. For example, the value of the User Agent (UA) field in the header data of all access requests of the same operation method under the same call path can be obtained, and after deleting the values ​​of the UA field with repeated values, the statistical number of different values ​​is obtained, and the statistical number less than the number threshold (such as 5) is counted into a specific score, representing the API resource traffic, as the few_ua_score parameter, it can be counted as 3 points corresponding to the statistical number such as 3, or it can be directly counted as 1, otherwise, it is counted as 0.

[0089] The so-called non_browser_score parameter is used to indicate the case where the value of the User Agent (UA) field in the header data of the access request of the same operation method under the same call path is empty. For example, the value of the User Agent (UA) field in the header data of all access requests of the same operation method under the same call path can be obtained, and the access requests with empty values ​​​​are greater than the percentage threshold (such as 80%) of the total access requests. A specific score is included, representing the API resource traffic. As a non_browser_score parameter, it can correspond to the statistical percentage, such as 90%, and be counted as 0.9 points, or it can be directly counted as 1. Otherwise, the score is 0.

[0090] The so-called average response time parameter is used to indicate the response time of access requests of the same operation method under the same call path. For example, the response time of all access requests of the same operation method under the same call path can be obtained, and the average response time can be calculated. The average response time within the time threshold range (such as millisecond level) is given a specific score, which represents the API resource traffic. As the average response time parameter, it can correspond to the average response time, such as 5ms, and be scored 5 points, or it can be directly scored as 1. Otherwise, the score is 0.

[0091] The so-called response body length parameter is used to indicate the fluctuation of the response body length of the access request of the same operation method under the same call path. For example, the response body length of all access requests of the same operation method under the same call path can be obtained, and the fluctuation range of the response body length can be counted. A specific score is given to the fluctuation range within the fluctuation threshold range, which represents the API resource traffic. As a response body length parameter, it can correspond to the fluctuation range of the response body length, such as 7 bytes, and be scored 7 points, or it can be directly scored as 1, otherwise, it is scored as 0.

[0092] The so-called access volume parameter is used to indicate the network traffic of the same operation method under the same call path. For example, the statistical traffic of all access requests and access responses of the same operation method under the same call path can be obtained, and the statistical percentage of the statistical traffic to the total network traffic is less than the percentage threshold (such as 1%), and a specific score is included, which represents the API resource traffic. As an access volume parameter, it can correspond to the statistical percentage, such as 0.8%, and be counted as 0.8 points, or it can be directly counted as 1, otherwise, it is counted as 0.

[0093] The so-called operation method distribution parameter is used to indicate the different operation methods under the same call path. For example, the statistical number of operation methods used in all access requests and access responses under the same call path can be obtained, and a specific score is calculated for the statistical number greater than the number threshold (such as 2), which represents the API resource traffic. As an operation method distribution parameter, it can correspond to the statistical number, such as 4, and be calculated as 4 points, or it can be directly calculated as 1. Otherwise, the score is 0.

[0094] The so-called access source distribution parameter is used to indicate the source IP of the access request of the same operation method under the same call path. For example, the source IP address of all access requests of the same operation method under the same call path can be obtained, and the statistical percentage of the source IP address belonging to the same IP address segment is greater than the percentage threshold (such as 80%), and a specific score is calculated, which represents the API resource traffic. As an access source distribution parameter, it can correspond to the statistical percentage, such as 90%, and be calculated as 0.9 points, or it can be directly calculated as 1, otherwise, it is calculated as 0.

[0095] Optionally, in a possible implementation of the present embodiment, in 103, the API access feature statistical parameters can be specifically scored to obtain the API access possibility score of the specified operation method under the specified call path, and then, based on the API access possibility score of the specified operation method under the specified call path, the API resource information of the specified operation method under the specified call path can be obtained.

[0096] It can be understood that the API access feature statistical parameters of the specified operation method under the specified call path in the present application can be one, two or more of the above parameters. According to the number of parameters, the adopted parameters can be weighted averaged to obtain a final score to determine whether the score meets the threshold condition (such as 50 points). If so, the network traffic of the specified operation method under the specified call path is identified as API resource traffic, and then the API resource information of the specified operation method under the specified call path is obtained.

[0097] In this embodiment, the acquired network traffic is filtered to obtain the traffic to be identified of the API resource to be identified, and then the traffic to be identified is statistically processed with API access characteristics to obtain API access characteristic statistical parameters of the specified operation method under the specified calling path, so that the API resource information of the specified operation method under the specified calling path can be obtained according to the API access characteristic statistical parameters, and the API resource information in the network traffic can be quickly and accurately identified without additional human participation, with simple operation, short processing time and high accuracy, thereby improving the efficiency and reliability of API resource identification.

[0098] In addition, by adopting the technical solution provided by the present disclosure, API resource information can be automatically identified so that it can be added to the API resource list in a timely manner, thereby reducing the possibility of manual intervention and effectively improving the efficiency and reliability of API resource sorting.

[0099] In addition, by adopting the technical solution provided by the present invention, API resource information can be automatically identified and added to the API resource list in a timely manner, thereby effectively improving the security of API resources and reducing the impact on business.

[0100] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present disclosure is not limited by the order of the actions described, because according to the present disclosure, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present disclosure.

[0101] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0102] Figure 2 is a schematic diagram according to the second embodiment of the present disclosure, such as Figure 2 As shown. The processing device 200 of the application program interface of this embodiment may include a filtering unit 201, a statistical unit 202 and an identification unit 203. Among them, the filtering unit 201 is used to filter the acquired network traffic to obtain the traffic to be identified of the application program interface API resource to be identified; the statistical unit 202 is used to perform statistical processing with API access characteristics on the traffic to be identified to obtain API access characteristic statistical parameters of the specified operation method under the specified call path; the identification unit 203 is used to obtain the API resource information of the specified operation method under the specified call path according to the API access characteristic statistical parameters.

[0103] It should be noted that part or all of the processing device of the application interface of this embodiment may be an application located in the local terminal, or may also be a functional unit such as a plug-in or software development kit (SDK) set in the application located in the local terminal, or may also be a processing engine located in a network-side server, or may also be a distributed system located on the network side, for example, a processing engine or distributed system in a processing platform of the application interface on the network side, etc. This embodiment does not specifically limit this.

[0104] It is understandable that the application may be a local program (nativeApp) installed on the local terminal, or may be a webpage program (webApp) of a browser on the local terminal, which is not limited in this embodiment.

[0105] Optionally, in a possible implementation of this embodiment, the filtering unit 201 can be specifically used to perform feature processing on the acquired network traffic to obtain traffic feature data of the network traffic; and based on the traffic feature data of the network traffic, exclude non-API resource traffic in the network traffic to obtain the traffic to be identified of the API resource.

[0106] Optionally, in a possible implementation of this embodiment, the non-API resource traffic may include but is not limited to at least one of the following traffic:

[0107] Invalid traffic;

[0108] Machine flow;

[0109] Web traffic;

[0110] Attack traffic; and

[0111] Network device traffic.

[0112] Optionally, in a possible implementation of this embodiment, the statistical unit 202 can be specifically used to obtain the access traffic of the specified operation method under the specified call path from the traffic to be identified; and obtain the API access feature statistical parameters of the specified operation method under the specified call path based on the API access features of the access traffic.

[0113] Optionally, in a possible implementation of this embodiment, the identification unit 203 can be specifically used to score the API access feature statistical parameters to obtain the API access possibility score of the specified operation method under the specified call path; and obtain API resource information of the specified operation method under the specified call path based on the API access possibility score of the specified operation method under the specified call path.

[0114] It should be noted that Figure 1 The corresponding method in the embodiment can be implemented by the processing device of the application program interface provided in this embodiment. Figure 1 The relevant contents in the corresponding embodiments will not be repeated here.

[0115] In this embodiment, the acquired network traffic is filtered by a filtering unit to obtain the traffic to be identified of the API resource to be identified, and then the statistical unit performs statistical processing on the traffic to be identified with API access characteristics to obtain API access feature statistical parameters of the specified operation method under the specified calling path, so that the identification unit can obtain the API resource information of the specified operation method under the specified calling path according to the API access feature statistical parameters, and can quickly and accurately identify the API resource information in the network traffic without additional human participation, with simple operation, short processing time and high accuracy, thereby improving the efficiency and reliability of API resource identification.

[0116] In addition, by adopting the technical solution provided by the present disclosure, API resource information can be automatically identified so that it can be added to the API resource list in a timely manner, thereby reducing the possibility of manual intervention and effectively improving the efficiency and reliability of API resource sorting.

[0117] In addition, by adopting the technical solution provided by the present invention, API resource information can be automatically identified and added to the API resource list in a timely manner, thereby effectively improving the security of API resources and reducing the impact on business.

[0118] In the technical solution disclosed herein, the acquisition, storage and application of network traffic involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0119] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0120] Figure 3 A schematic block diagram of an example electronic device 300 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0121] like Figure 3As shown, the electronic device 300 includes a computing unit 301, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 302 or a computer program loaded from a storage unit 308 into a random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic device 300 can also be stored. The computing unit 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0122] A number of components in the electronic device 300 are connected to the I / O interface 305, including: an input unit 306, such as a keyboard, a mouse, etc.; an output unit 307, such as various types of displays, speakers, etc.; a storage unit 308, such as a disk, an optical disk, etc.; and a communication unit 309, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 309 allows the electronic device 300 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0123] The computing unit 301 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 301 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 301 performs the various methods and processes described above, such as the processing method of the application program interface. For example, in some embodiments, the processing method of the application program interface may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 308. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 300 via ROM 302 and / or communication unit 309. When the computer program is loaded into RAM 303 and executed by the computing unit 301, one or more steps of the processing method of the application program interface described above may be executed. Alternatively, in other embodiments, the computing unit 301 may be configured to execute the processing method of the application program interface by any other appropriate means (e.g., by means of firmware).

[0124] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0125] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0126] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0127] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0128] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.

[0129] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.

[0130] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0131] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for processing an application program interface, characterized in that: include: Filter the acquired network traffic to obtain the traffic to be identified of the application program interface (API) resource to be identified; Performing statistical processing on the traffic to be identified with API access characteristics to obtain API access characteristic statistical parameters of a specified operation method under a specified call path; According to the API access feature statistical parameters, API resource information of the specified operation method under the specified calling path is obtained.

2. The method according to claim 1, characterized in that The filtering process of the acquired network traffic to obtain the traffic to be identified of the application program interface API resource to be identified includes: Performing feature processing on the acquired network traffic to obtain traffic feature data of the network traffic; According to the traffic characteristic data of the network traffic, non-API resource traffic in the network traffic is excluded to obtain the traffic to be identified of the API resource.

3. The method according to claim 1, characterized in that: The non-API resource traffic includes at least one of the following traffic: Invalid traffic; Machine flow; Web traffic; Attack traffic; and Network device traffic.

4. The method according to claim 1, characterized in that: The performing statistical processing on the traffic to be identified with API access characteristics to obtain API access characteristic statistical parameters of a specified operation method under a specified call path includes: Obtaining access traffic of the specified operation method under the specified call path from the traffic to be identified; According to the API access characteristics of the access traffic, API access characteristic statistical parameters of the specified operation method under the specified call path are obtained.

5. The method according to any one of claims 1 to 4, characterized in that The step of obtaining the API resource information of the specified operation method under the specified calling path according to the API access characteristic statistical parameters includes: Scoring the API access feature statistical parameters to obtain an API access possibility score for a specified operation method under the specified call path; According to the API access possibility score of the specified operation method under the specified call path, API resource information of the specified operation method under the specified call path is obtained.

6. A device for processing an application program interface, characterized in that: include: A filtering unit, used for filtering the acquired network traffic to obtain the traffic to be identified of the application program interface API resource to be identified; A statistical unit, used for performing statistical processing on the traffic to be identified with API access characteristics to obtain API access characteristic statistical parameters of a specified operation method under a specified call path; The identification unit is used to obtain the API resource information of the specified operation method under the specified calling path according to the API access feature statistical parameters.

7. The device according to claim 6, characterized in that The filtering unit is specifically used to perform feature processing on the acquired network traffic to obtain traffic feature data of the network traffic; and According to the traffic characteristic data of the network traffic, non-API resource traffic in the network traffic is excluded to obtain the traffic to be identified of the API resource.

8. The device according to claim 6, characterized in that The non-API resource traffic includes at least one of the following traffic: Invalid traffic; Machine flow; Web traffic; Attack traffic; and Network device traffic.

9. The device according to claim 6, characterized in that The statistical unit is specifically configured to obtain, from the to-be-identified traffic, access traffic of the specified operation method under the specified calling path; and According to the API access characteristics of the access traffic, API access characteristic statistical parameters of the specified operation method under the specified call path are obtained.

10. The device according to any one of claims 6 to 9, characterized in that: The identification unit is specifically used for Scoring the API access feature statistical parameters to obtain an API access possibility score for a specified operation method under the specified call path; and According to the API access possibility score of the specified operation method under the specified call path, API resource information of the specified operation method under the specified call path is obtained.

11. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.

12. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-5.

13. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 5.