API interface sorting method and device based on flow data, equipment and storage medium
By analyzing the API interface data format, call requests and calls in traffic data, calculating the total score of the API interface and sorting out and classifying it, the cumbersome problem of the existing API interface sorting process is solved and efficiency is improved.
Patent Information
- Application Number
- CN202411482330.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-02-28
AI Technical Summary
The sorting process and classification process of existing API interfaces are cumbersome and rely on manual processing, resulting in inefficiency, which is almost impossible to complete especially when processing large-scale traffic data.
By obtaining the traffic data of the target website, analyzing the sending and receiving data formats of the API interface, calling requests, Referer fields and number of calls, calculate the total score of the API interface, and sort it out and classify it according to the score.
There is no need for manual sorting and classification, which significantly reduces the time of sorting and classification of API interfaces and improves the efficiency of sorting and classification of API interfaces.
Smart Images

Figure CN119538028A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology and can be applied to the field of financial technology. In particular, the present invention relates to an API interface combing method, device, equipment and storage medium based on traffic data. Background Art
[0002] API interface, full name Application Programming Interface, is a set of predefined rules and methods used for data interaction and communication between different components or systems in a software system. Sorting out API interfaces can improve the maintainability, scalability and development efficiency of the system. By clearly defining and organizing API interfaces, developers can more easily understand and use system functions and reduce errors caused by unclear or confusing interfaces.
[0003] However, the combing and classification processes of existing API interfaces are cumbersome, which is not conducive to improving the combing and classification efficiency of API interfaces. The reason is that the combing and classification processes of existing API interfaces rely on manual processing, and manual processing consumes a lot of human resources and time resources, increasing the combing and classification time of API interfaces. For large-scale traffic data, manual processing is almost an impossible task. In addition, some existing automated tools or algorithms often lack comprehensive considerations and sophisticated judgment conditions when identifying API interfaces, which can easily lead to misjudgments and inaccurate results and cannot meet the needs of actual applications. Therefore, the combing and classification processes of existing API interfaces are cumbersome, which is not conducive to improving the combing and classification efficiency of API interfaces. Summary of the invention
[0004] The present invention provides a method, device, computer equipment and storage medium for combing API interfaces based on traffic data, so as to solve the technical problem that the combing process and classification process of existing API interfaces are cumbersome and not conducive to improving the combing efficiency and classification efficiency of API interfaces.
[0005] In the first aspect, a method for combing API interfaces based on traffic data is provided, including:
[0006] Obtain traffic data of the target website;
[0007] In the traffic data, obtain the data format of the data sent or received by the API interface to be sorted, and obtain the call request received by the API interface;
[0008] Obtain the Referer field in the call request to obtain the number of calls to the API interface;
[0009] Determine a total score of the API interface based on the data format, the call request, the Referer field, and the number of calls;
[0010] Selecting the API interface whose total score meets a preset condition as the sorted API interface, and obtaining the user agent identifier of the sorted API interface;
[0011] The combed API interfaces are classified based on the user agent identifier to generate a classification result of the combed API interfaces.
[0012] Furthermore, in the traffic data, obtaining the data format of the data sent or received by the API interface to be sorted out, and obtaining the call request received by the API interface, includes:
[0013] In the traffic data, obtain the call information of the API interface to be sorted out;
[0014] In the call information, the data format of the data sent or received by the API interface is obtained, and the call request received by the API interface is obtained.
[0015] Further, obtaining the Referer field in the call request to obtain the number of calls to the API interface includes:
[0016] Obtain a first read instruction and a second read instruction;
[0017] The Referer field in the call request is read through the first read instruction, and the number of calls of the API interface within a preset time is read through the second read instruction.
[0018] Further, determining the total score of the API interface based on the data format, the call request, the Referer field, and the number of calls includes:
[0019] Obtain a first score corresponding to the data format, obtain a second score corresponding to the call request, obtain a third score corresponding to the Referer field, and obtain a fourth score corresponding to the number of calls;
[0020] The first score, the second score, the third score, and the fourth score are added together to generate a total score for the API interface.
[0021] Furthermore, the selecting the API interface whose total score meets a preset condition as the combed API interface, and obtaining the user agent identifier of the combed API interface includes:
[0022] Obtaining a preset score, and selecting the API interface whose total score is greater than the preset score as the sorted API interface;
[0023] Obtain the combed proxy information of the API interface, and obtain the user proxy identifier in the proxy information.
[0024] Furthermore, the classifying the combed API interfaces based on the user agent identifier to generate a classification result of the combed API interfaces includes:
[0025] When the user agent is identified as a browser, marking the sorted API interface as a calling interface belonging to the browser, and classifying the access interface belonging to the browser into the first set in the classification result;
[0026] When the user agent identifier is not the browser, the combed API interface is marked as a calling interface that does not belong to the browser, and the access interface that does not belong to the browser is classified into the second set in the classification result.
[0027] Further, after classifying the combed API interfaces based on the user agent identifier to generate classification results of the combed API interfaces, the API interface combing method includes:
[0028] A first storage area and a second storage area are created, the first set is stored in the first storage area, and the second set is stored in the second storage area, wherein the first storage area and the second storage area are different storage areas.
[0029] In a second aspect, a device for combing an API interface based on traffic data is provided, comprising:
[0030] The first acquisition module is used to acquire the traffic data of the target website;
[0031] A second acquisition module is used to obtain the data format of the data sent or received by the API interface to be sorted out in the traffic data, and obtain the call request received by the API interface;
[0032] The third acquisition module is used to obtain the Referer field in the call request and obtain the number of calls of the API interface;
[0033] A determination module, configured to determine a total score of the API interface based on the data format, the call request, the Referer field, and the number of calls;
[0034] A combing module, used for selecting the API interfaces whose total scores meet preset conditions as combed API interfaces, and obtaining user agent identifiers of the combed API interfaces;
[0035] A classification module is used to classify the combed API interfaces based on the user agent identifier and generate a classification result of the combed API interfaces.
[0036] In a third aspect, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned API interface combing method when executing the computer program.
[0037] In a fourth aspect, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned API interface combing method are implemented.
[0038] The present application provides an API interface combing method, device, computer equipment and storage medium based on traffic data, which obtains the traffic data of a target website; in the traffic data, obtains the data format of the data sent or received by the API interface to be combed, and obtains the call request received by the API interface; obtains the Referer field in the call request, and obtains the number of calls to the API interface; based on the data format, the call request, the Referer field and the number of calls, determines the total score of the API interface; selects the API interface whose total score meets the preset conditions as the combed API interface, and obtains the user agent identifier of the combed API interface; based on the The combed API interfaces are classified according to user agent identifiers to generate classification results of the combed API interfaces. The beneficial effects are in two aspects. On the one hand, the API interfaces whose total scores meet preset conditions are selected as the combed API interfaces. Since manual combing is not required, the combing time of the API interfaces is reduced, which is beneficial to improving the combing efficiency of the API interfaces. On the other hand, the user agent identifier of the combed API interfaces is obtained, and the combed API interfaces are classified based on the user agent identifier to generate classification results of the combed API interfaces. Since manual classification is not required, the classification time of the API interfaces is reduced, which is beneficial to improving the classification efficiency of the API interfaces. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0040] Figure 1 This is a schematic diagram of an application environment of an API interface combing method in one embodiment of the present invention;
[0041] Figure 2 A schematic diagram of a flow chart of an API interface combing method provided by an embodiment of the present invention;
[0042] Figure 3 yes Figure 2 A schematic flow chart of a specific implementation of step S23;
[0043] Figure 4 yes Figure 2 A schematic flow chart of a specific implementation of step S25;
[0044] Figure 5 yes Figure 2 A schematic flow chart of a specific implementation of step S26;
[0045] Figure 6 It is a structural schematic diagram of an API interface combing device in one embodiment of the present invention;
[0046] Figure 7 is a schematic diagram of a structure of a computer device in one embodiment of the present invention;
[0047] Figure 8 It is another structural schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0049] See also Figure 1 , Figure 1 Schematic diagram of an application environment of an API interface combing method according to an embodiment of the present invention. The API interface combing method provided by the embodiment of the present invention can be applied in the following embodiments: Figure 1 In an application environment, a client communicates with a server through a network.
[0050] The server obtains the traffic data of the target website through the client;
[0051] In the traffic data, obtain the data format of the data sent or received by the API interface to be sorted, and obtain the call request received by the API interface;
[0052] Obtain the Referer field in the call request to obtain the number of calls to the API interface;
[0053] Determine a total score of the API interface based on the data format, the call request, the Referer field, and the number of calls;
[0054] Selecting the API interface whose total score meets a preset condition as the sorted API interface, and obtaining the user agent identifier of the sorted API interface;
[0055] The combed API interfaces are classified based on the user agent identifier to generate a classification result of the combed API interfaces.
[0056] In the scheme implemented by the above-mentioned API interface combing method, device, equipment and medium, the beneficial effects are in two aspects. On the one hand, the API interface whose total score meets the preset conditions is selected as the combed API interface. Since manual combing is not required, the combing time of the API interface is reduced, which is beneficial to improving the combing efficiency of the API interface; on the other hand, the user agent identifier of the combed API interface is obtained, and the combed API interface is classified based on the user agent identifier to generate a classification result of the combed API interface. Since manual classification is not required, the classification time of the API interface is reduced, which is beneficial to improving the classification efficiency of the API interface.
[0057] The device running the client is referred to as a client device.
[0058] The device running the server is referred to as the server device.
[0059] The client devices may include but are not limited to various personal computers, laptops, smart phones, tablet computers, and portable wearable devices.
[0060] The server device can be implemented with an independent task database or a task database cluster composed of multiple task databases. The present invention is described in detail below through specific embodiments.
[0061] See also Figure 2 , Figure 2A flowchart of an API interface combing method provided by an embodiment of the present invention includes the following steps:
[0062] S21, obtaining traffic data of the target website;
[0063] The target website refers to the web page or website visited by users or businesses when conducting web browsing, searching, transactions or other online activities.
[0064] The target website includes a financial website, a technology website, or a combination thereof.
[0065] Among them, financial websites are used to provide finance-related services and information, including but not limited to online banking, stock trading, insurance services, financial news, investment analysis, and personal financial management tools, etc. These websites are usually strictly regulated to ensure the security, transparency, and compliance of transactions and meet users' needs for property security and professional guidance.
[0066] Among them, technology websites are used to report the latest technology development trends, product reviews, technological innovations, software downloads, interviews with technology figures, etc., aiming to provide users with a platform to understand technology trends and master new technologies and products.
[0067] S22, obtaining the data format of the data sent or received by the API interface to be sorted out from the traffic data, and obtaining the call request received by the API interface;
[0068] Wherein, in the traffic data, obtaining the data format of the data sent or received by the API interface to be sorted out, and obtaining the call request received by the API interface, includes:
[0069] In the traffic data, obtain the call information of the API interface to be sorted out;
[0070] In the call information, the data format of the data sent or received by the API interface is obtained, and the call request received by the API interface is obtained.
[0071] S23, obtaining the Referer field in the call request and obtaining the number of calls of the API interface;
[0072] The Referer field in Chinese is: reference page field. The Referer field plays an important role in the HTTP request header. It records the URL address of the previous page that initiated the current request, that is, which page the user jumped from to the current page. Through the Referer field, you can obtain the previous page information in the user's access path, which is of great significance for analyzing user behavior, tracking traffic sources, and optimizing website structure and content layout.
[0073] The Chinese name of HTTP request is: Hypertext Transfer Protocol Request. The English name of HTTP is: HyperText Transfer Protocol. Through HTTP request, users can browse web pages, submit forms, download files, etc., to interact with Internet resources.
[0074] S24, determining a total score of the API interface based on the data format, the call request, the Referer field, and the number of calls;
[0075] The determining of the total score of the API interface based on the data format, the call request, the Referer field, and the number of calls includes:
[0076] Obtain a first score corresponding to the data format, obtain a second score corresponding to the call request, obtain a third score corresponding to the Referer field, and obtain a fourth score corresponding to the number of calls;
[0077] The first score, the second score, the third score, and the fourth score are added together to generate a total score for the API interface.
[0078] The first score, the second score, the third score, and the fourth score are added together to generate a total score for the API interface, including:
[0079] Multiplying the first score by a first weight coefficient to obtain a modified first score;
[0080] Multiplying the second score by a second weight coefficient to obtain a modified second score;
[0081] Multiplying the third score by a third weight coefficient to obtain a modified third score;
[0082] multiplying the fourth score by a fourth weight coefficient to obtain a modified fourth score;
[0083] The modified first score, the modified second score, the modified third score, and the modified fourth score are added together to generate a total score for the API interface.
[0084] Exemplarily, obtaining a first score corresponding to the data format includes:
[0085] When the data format is a preset format, selecting a first value as a first score corresponding to the data format;
[0086] When the data format is not the preset format, selecting a second value as the first score corresponding to the data format;
[0087] The first value is greater than the second value, and the preset format includes one of the json format and the XML format or a combination thereof.
[0088] Among them, JSON format (JavaScript Object Notation) and XML format (eXtensible Markup Language) are both widely used data exchange formats.
[0089] Among them, the JSON format is easy for people to read and write, and it is also easy for machines to parse and generate.
[0090] Among them, the XML format uses tags to describe the structure and content of data, which is more descriptive and extensible.
[0091] Exemplarily, obtaining a second score corresponding to the call request includes:
[0092] When the calling request is an ajax request, the third value is selected as the second score corresponding to the calling request:
[0093] When the calling request is not the ajax request, selecting a fourth value as a second score corresponding to the calling request;
[0094] The third value is greater than the fourth value.
[0095] The full name of AJAX request is: Asynchronous JavaScript and XML. AJAX is a technology that can update part of a web page without reloading the entire web page.
[0096] Exemplarily, obtaining a third score corresponding to the Referer field includes:
[0097] When the value of the Referer field is a preset value, selecting a fifth value as a third score corresponding to the Referer field;
[0098] When the value of the Referer field is not the preset value, selecting a sixth value as a third score corresponding to the Referer field;
[0099] Wherein, the sixth value is greater than the fifth value, and the preset value includes a null value, a fixed value, or a combination thereof;
[0100] Exemplarily, obtaining a fourth score corresponding to the number of calls includes:
[0101] When the number of calls is less than the preset number, the seventh value is selected as the fourth score corresponding to the number of calls; when the number of calls is not less than the preset number, the eighth value is selected as the fourth score corresponding to the number of calls;
[0102] Wherein, the eighth value is greater than the seventh value.
[0103] S25, selecting the API interface whose total score meets a preset condition as the sorted API interface, and obtaining the user agent identifier of the sorted API interface;
[0104] S26, classifying the combed API interfaces based on the user agent identifier, and generating a classification result of the combed API interfaces.
[0105] Wherein, after classifying the combed API interfaces based on the user agent identifier to generate classification results of the combed API interfaces, the API interface combing method includes:
[0106] A first storage area and a second storage area are created, the first set is stored in the first storage area, and the second set is stored in the second storage area, wherein the first storage area and the second storage area are different storage areas.
[0107] In the embodiments of the present invention, the beneficial effects lie in two aspects. On the one hand, the API interface whose total score meets the preset conditions is selected as the combed API interface. Since manual combing is not required, the combing time of the API interface is reduced, which is beneficial to improving the combing efficiency of the API interface. On the other hand, the user agent identifier of the combed API interface is obtained, and the combed API interface is classified based on the user agent identifier to generate a classification result of the combed API interface. Since manual classification is not required, the classification time of the API interface is reduced, which is beneficial to improving the classification efficiency of the API interface.
[0108] See also Figure 3 , Figure 3 yes Figure 2 A specific implementation flow diagram of step S23 is described in detail as follows:
[0109] S31, obtaining a first read instruction and a second read instruction;
[0110] S32: read the Referer field in the call request through the first read instruction, and read the number of calls of the API interface within a preset time through the second read instruction.
[0111] In the embodiment of the present invention, by analyzing the number of calls, resource allocation can be optimized, such as caching or optimizing frequently called functions to improve the response speed of the target website.
[0112] See also Figure 4 , Figure 4 yes Figure 2 A specific implementation flow diagram of step S25 is described in detail as follows:
[0113] S41, obtaining a preset score, and selecting the API interface whose total score is greater than the preset score as the sorted API interface;
[0114] S42, obtaining the sorted proxy information of the API interface, and obtaining the user proxy identifier in the proxy information.
[0115] In the embodiment of the present invention, obtaining the user agent identifier can help developers understand the visitor's device and browser type, thereby providing a more personalized user experience.
[0116] See also Figure 5 , Figure 5 yes Figure 2 A specific implementation flow diagram of step S26 is described in detail as follows:
[0117] S51, when the user agent is identified as a browser, marking the sorted API interfaces as calling interfaces belonging to the browser, and classifying the access interfaces belonging to the browser into the first set in the classification result;
[0118] The sorted API interfaces are marked as calling interfaces belonging to the browser, and the access interfaces belonging to the browser are classified into the first set in the classification results. This can significantly improve the data interaction efficiency between the web page and the server, so that the web page can obtain and display the required data more quickly and accurately, thereby enhancing the user experience.
[0119] S52: When the user agent identifier is not the browser, the sorted API interfaces are marked as calling interfaces that do not belong to the browser, and the access interfaces that do not belong to the browser are classified into the second set in the classification result.
[0120] Among them, the calling interface that does not belong to the browser includes the calling interface used in mobile applications, desktop software or background services.
[0121] In the embodiment of the present invention, through clearly defined interface specifications, strict access control and identity authentication mechanisms can be implemented for the calling interfaces belonging to the browser to ensure that only authorized services or components can access and call these interfaces, thereby effectively preventing unauthorized access and data leakage.
[0122] See also Figure 6 , Figure 6 : is a schematic diagram of a structure of an API interface combing device in one embodiment of the present invention, such as Figure 6 As shown, the API interface combing device includes a first acquisition module 101, a second acquisition module 102, a third acquisition module 103, a determination module 104, a combing module 105, and a classification module 106. The functional modules are described in detail as follows:
[0123] The first acquisition module 101 is used to acquire traffic data of a target website;
[0124] The second acquisition module 102 is used to obtain the data format of the data sent or received by the API interface to be sorted out in the traffic data, and obtain the call request received by the API interface;
[0125] The third acquisition module 103 is used to obtain the Referer field in the call request and obtain the number of calls of the API interface;
[0126] A determination module 104, configured to determine a total score of the API interface based on the data format, the call request, the Referer field, and the number of calls;
[0127] A combing module 105, configured to select the API interfaces whose total scores satisfy a preset condition as combed API interfaces, and obtain user agent identifiers of the combed API interfaces;
[0128] The classification module 106 is used to classify the combed API interfaces based on the user agent identifiers and generate classification results of the combed API interfaces.
[0129] In one embodiment, the second acquisition module 102 includes:
[0130] A first acquisition subunit is used to acquire the call information of the API interface to be sorted out in the traffic data;
[0131] The second acquisition subunit is used to obtain the data format of the data sent or received by the API interface in the call information, and obtain the call request received by the API interface.
[0132] In one embodiment, the third acquisition module 103 includes:
[0133] A third acquisition subunit, used to acquire a first read instruction and a second read instruction;
[0134] The reading subunit is used to read the Referer field in the calling request through the first reading instruction, and read the number of calls of the API interface within a preset time through the second reading instruction.
[0135] In one embodiment, the determining module 104 includes:
[0136] a processing subunit, configured to obtain a first score corresponding to the data format, obtain a second score corresponding to the call request, obtain a third score corresponding to the Referer field, and obtain a fourth score corresponding to the number of calls;
[0137] A generating subunit is used to add the first score, the second score, the third score, and the fourth score to generate a total score for the API interface.
[0138] In one embodiment, the combing module 105 includes:
[0139] A combing subunit, used for obtaining a preset score, and selecting the API interface whose total score is greater than the preset score as the combed API interface;
[0140] The fourth acquisition subunit is used to obtain the combed proxy information of the API interface and obtain the user proxy identifier in the proxy information.
[0141] In one embodiment, the classification module 106 includes:
[0142] A first classification subunit is used for marking the sorted API interfaces as calling interfaces belonging to the browser when the user agent is identified as a browser, and classifying the access interfaces belonging to the browser into a first set in the classification result;
[0143] The second classification subunit is used to mark the sorted API interface as a calling interface that does not belong to the browser when the user agent identifier is not the browser, and classify the access interface that does not belong to the browser into the second set in the classification result.
[0144] In one embodiment, the API interface combing device further includes:
[0145] The storage module is used to create a first storage area and a second storage area, store the first set in the first storage area, and store the second set in the second storage area, wherein the first storage area and the second storage area are different storage areas.
[0146] In the embodiments of the present invention, the beneficial effects lie in two aspects. On the one hand, the API interface whose total score meets the preset conditions is selected as the combed API interface. Since manual combing is not required, the combing time of the API interface is reduced, which is beneficial to improving the combing efficiency of the API interface. On the other hand, the user agent identifier of the combed API interface is obtained, and the combed API interface is classified based on the user agent identifier to generate a classification result of the combed API interface. Since manual classification is not required, the classification time of the API interface is reduced, which is beneficial to improving the classification efficiency of the API interface.
[0147] For the specific limitations of the API interface combing device, please refer to the limitations of the API interface combing method above, which will not be repeated here.
[0148] Each module in the above-mentioned API interface combing device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0149] See also Figure 7 , Figure 7 is a schematic diagram of a computer device in one embodiment of the present invention. In one embodiment, a computer device is provided. The computer device may be a server device, and its internal structure diagram may be as shown in FIG. Figure 7 The computer device includes a processor, a memory, a network interface and a database connected through a system bus.
[0150] The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external client through a network connection. When the computer program is executed by the processor, the functions or steps of an API interface combing method based on traffic data can be implemented on the server-side device.
[0151] See also Figure 8 , Figure 8is another structural diagram of a computer device in one embodiment of the present invention. In one embodiment, a computer device is provided. The computer device may be a client device, and its internal structure diagram may be as shown in FIG. Figure 8 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external task database via a network connection. When the computer program is executed by the processor, the functions or steps of an API interface combing method based on traffic data can be implemented on a client device.
[0152] In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor.
[0153] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or computer device can refer to the relevant description in the aforementioned method embodiment. In order to avoid repetition, they will not be described one by one here.
[0154] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0155] The above description and accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent possible changes only. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. Parts and subsamples of some embodiments may be included in or replace parts and subsamples of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of a stated sub-sample, whole, step, operation, element, and / or component, but do not exclude the presence or addition of one or more other sub-samples, wholes, steps, operations, elements, components and / or groups of these. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.
[0156] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. Technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present disclosure. Technicians can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0157] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some sub-samples can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
[0158] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A method for combing API interfaces based on traffic data, characterized in that: include: Obtain traffic data of the target website; In the traffic data, obtain the data format of the data sent or received by the API interface to be sorted, and obtain the call request received by the API interface; Obtain the Referer field in the call request to obtain the number of calls to the API interface; Determine a total score of the API interface based on the data format, the call request, the Referer field, and the number of calls; Selecting the API interface whose total score meets a preset condition as the sorted API interface, and obtaining the user agent identifier of the sorted API interface; The combed API interfaces are classified based on the user agent identifier to generate a classification result of the combed API interfaces.
2. The API interface combing method according to claim 1, characterized in that: The step of obtaining the data format of the data sent or received by the API interface to be sorted out in the traffic data, and obtaining the call request received by the API interface, includes: In the traffic data, obtain the call information of the API interface to be sorted out; In the call information, the data format of the data sent or received by the API interface is obtained, and the call request received by the API interface is obtained.
3. The API interface combing method according to claim 1, characterized in that: The obtaining of the Referer field in the call request and the number of calls of the API interface include: Obtain a first read instruction and a second read instruction; The Referer field in the call request is read through the first read instruction, and the number of calls of the API interface within a preset time is read through the second read instruction.
4. The API interface combing method according to claim 1, characterized in that: The determining the total score of the API interface based on the data format, the call request, the Referer field, and the number of calls includes: Obtain a first score corresponding to the data format, obtain a second score corresponding to the call request, obtain a third score corresponding to the Referer field, and obtain a fourth score corresponding to the number of calls; The first score, the second score, the third score, and the fourth score are added together to generate a total score for the API interface.
5. The API interface combing method according to claim 1, characterized in that: The step of selecting the API interface whose total score satisfies a preset condition as the sorted API interface and obtaining the user agent identifier of the sorted API interface includes: Obtaining a preset score, and selecting the API interface whose total score is greater than the preset score as the sorted API interface; Obtain the combed proxy information of the API interface, and obtain the user proxy identifier in the proxy information.
6. The API interface combing method according to claim 1, characterized in that: The step of classifying the combed API interfaces based on the user agent identifier to generate a classification result of the combed API interfaces includes: When the user agent is identified as a browser, marking the sorted API interface as a calling interface belonging to the browser, and classifying the access interface belonging to the browser into the first set in the classification result; When the user agent identifier is not the browser, the combed API interface is marked as a calling interface that does not belong to the browser, and the access interface that does not belong to the browser is classified into the second set in the classification result.
7. The API interface combing method according to any one of claims 1 to 6, characterized in that: After classifying the combed API interfaces based on the user agent identifier to generate a classification result of the combed API interfaces, the API interface combing method includes: A first storage area and a second storage area are created, the first set is stored in the first storage area, and the second set is stored in the second storage area, wherein the first storage area and the second storage area are different storage areas.
8. An API interface combing device based on traffic data, characterized in that: include: The first acquisition module is used to acquire the traffic data of the target website; A second acquisition module is used to obtain the data format of the data sent or received by the API interface to be sorted out in the traffic data, and obtain the call request received by the API interface; The third acquisition module is used to obtain the Referer field in the call request and obtain the number of calls of the API interface; A determination module, configured to determine a total score of the API interface based on the data format, the call request, the Referer field, and the number of calls; A combing module, used for selecting the API interfaces whose total scores meet preset conditions as combed API interfaces, and obtaining user agent identifiers of the combed API interfaces; A classification module is used to classify the combed API interfaces based on the user agent identifier and generate a classification result of the combed API interfaces.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the API interface combing method as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the API interface combing method as described in any one of claims 1 to 7 are implemented.