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

By matching path parameters in the API access path tree, creating temporary wild-allocated nodes and formal wild-allocated nodes, automatic merging of API resources is realized, and the problem of low API resource processing efficiency and reliability is solved, and the efficiency of API resource integration is improved and complexity.

CN118890343APending Publication Date: 2024-11-01RIVER INFORMATION TECH SHANGHAI CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410926031.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-10
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

In the prior art, API resource processing efficiency and reliability are low, mainly due to the complex and error-prone integration of manual methods, resulting in long operation time and low efficiency.

Method used

By matching path parameters in the API access path tree, creating temporary wild-allocated nodes and formal wild-allocated nodes, automatic identification and merging of path parameters is realized, manual participation is reduced, and the merging efficiency of API resources is improved.

Benefits of technology

It realizes the rapid identification, matching and processing of API resources, improves the efficiency and reliability of API resource processing, reduces the number of API resources, simplifies the operation process, and improves the complexity and efficiency of API resource integration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118890343A_ABST
    Figure CN118890343A_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, path parameters contained in an API access path of a specified application are determined; in an access path tree of the specified application, matching a temporary general configuration node corresponding to the path parameter with a temporary general configuration path passing through the temporary general configuration node; if the matching is successful, associating the path parameter to an end node of the temporary universal path; and if the number of all the path parameters associated with the end node meets a general configuration threshold value, according to the temporary general configuration node, creating a formal general configuration node corresponding to the path parameters in the access path tree so as to form a formal general configuration path passing through the formal general configuration node.
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, so the generated application programming interface (API) resources will be very large.

[0003] Usually, API resources can be integrated manually and periodically to merge similar API resources, which makes 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] Determine the path parameters included in the API access path of the specified application;

[0007] In the access path tree of the specified application, matching the temporary wildcard node corresponding to the path parameter and the temporary wildcard path passing through the temporary wildcard node;

[0008] If the match is successful, the path parameter is associated with the end node of the temporary wildcard path;

[0009] If the number of all path parameters associated with the end node meets the wildcard threshold, a formal wildcard node corresponding to the path parameter is created in the access path tree according to the temporary wildcard node to form a formal wildcard path passing through the formal wildcard node.

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

[0011] A determination unit, used to determine path parameters included in an API access path of a specified application;

[0012] A matching unit, configured to match, in the access path tree of the specified application, a temporary wildcard node corresponding to the path parameter and a temporary wildcard path passing through the temporary wildcard node;

[0013] an associating unit, configured to associate the path parameter with the end node of the temporary wildcard path if the match is successful;

[0014] A creating unit is used to create a formal wildcard node corresponding to the path parameter in the access path tree according to the temporary wildcard node if the number of all path parameters associated with the end node meets the wildcard threshold, so as to form a formal wildcard path passing through the formal wildcard node.

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

[0016] at least one processor; and

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

[0018] 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.

[0019] 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.

[0020] 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.

[0021] It can be seen from the above technical solution that the embodiment of the present disclosure determines the path parameters contained in the API access path of the specified application, and then matches the temporary wildcard node corresponding to the path parameter and the temporary wildcard path passing through the temporary wildcard node in the access path tree of the specified application. If the match is successful, the path parameter can be associated with the end node of the temporary wildcard path. If the number of all path parameters associated with the end node meets the wildcard threshold, a formal wildcard node corresponding to the path parameter can be created in the access path tree according to the temporary wildcard node to form a formal wildcard path passing through the formal wildcard node. By creating the temporary wildcard node and the wildcard node matching method adopted by the formal wildcard node, the path parameters contained in the API access path of the specified application can be quickly identified, matched and processed, so as to effectively merge similar API resources without additional manual participation, simple operation, short processing time, and high accuracy, thereby improving the efficiency and reliability of API resource processing.

[0022] In addition, by adopting the technical solution provided by the present invention, since a wildcard node matching method is adopted, when a new API access path of a specified application is added, the path parameters contained in the API access path can be identified, matched and processed in real time, so as to effectively merge the API resource into similar API resources. There is no need to recalculate all API access paths, and the overhead is very small, thereby effectively improving the efficiency of API resource processing.

[0023] In addition, by adopting the technical solution provided by the present invention, the number of API resources can be effectively reduced by matching the API access path of the specified application to the formal wildcard node corresponding to the path parameters contained therein and the formal wildcard path passing through the formal wildcard node, thereby improving the complexity and efficiency of API resource integration.

[0024] In addition, by adopting the technical solution provided by the present invention, by matching the wildcard node of the API access path of any specified application, if the number of API resources of any two specified applications meets the preset number threshold, and the similarity of the API resources of the two specified applications meets the preset similarity threshold, then the two specified applications can be determined as the same application and merged, which can effectively improve the management efficiency of the application.

[0025] 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

[0026] 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:

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

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

[0029] 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

[0030] 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.

[0031] 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.

[0032] 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.

[0033] 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.

[0034] There are a large number of API access requests in the network traffic. If they are directly added to the API resource list, the list will be very large. These API resources can be interfaces based on the HyperText Transfer Protocol (HTTP), or interfaces based on the User Datagram Protocol (TCP), or interfaces based on the 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.

[0035] Taking server programs as an example, these traffics correspond to many server instances, but the API resources under some server instances are similar. Some resource integration can be performed to merge similar API resources.

[0036] Since a server program may deploy multiple server instances to provide API services, the API resources under each server instance deployed by the same server program should be the same. In the API resource list, API resources of different applications may appear many times, so these applications also need to be merged into the same application.

[0037] Usually, API resources can be integrated manually and periodically to merge similar API resources, which makes the operation complicated, time-consuming, and error-prone, thus reducing the efficiency and reliability of API resource processing.

[0038] Therefore, there is an urgent need to provide a processing method that can quickly and reliably identify similar API resources under the same application for resource integration processing, and based on the integrated API resources, the same applications can be further merged.

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

[0040] 101. Determine path parameters included in an API access path of a specified application.

[0041] 102. In the access path tree of the designated application, match a temporary wildcard node corresponding to the path parameter and a temporary wildcard path passing through the temporary wildcard node.

[0042] 103. If the match is successful, associate the path parameter with the end node of the temporary wildcard path.

[0043] 104. If the number of all path parameters associated with the end node meets the wildcard threshold, create a formal wildcard node corresponding to the path parameter in the access path tree according to the temporary wildcard node to form a formal wildcard path passing through the formal wildcard node.

[0044] At this point, the formal wildcard node of the path parameter in the access path tree of the specified application and the formal wildcard path passing through the formal wildcard node are created. Based on the created formal wildcard node and the formal wildcard path passing through the formal wildcard node, the API resources of the specified application can be updated, for example, adding a template API (i.e., the API corresponding to the formal wildcard path), deleting an associated API (i.e., the API corresponding to the real access path where the path parameter associated to the temporary wildcard path is located), etc. By creating the wildcard node matching method used by the temporary wildcard node and the formal wildcard node, the path parameters contained in the API access path of the specified application can be quickly identified, matched and processed, so as to effectively merge similar API resources.

[0045] In this application, the word "specified" in the designated application does not have any special meaning. It is just to specify the current operation object. Therefore, the designated application is an ordinary application.

[0046] It should be noted that part or all of the execution entities of 101 to 104 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.

[0047] 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.

[0048] In this way, by determining the path parameters contained in the API access path of the specified application, and then matching the temporary wildcard node corresponding to the path parameter and the temporary wildcard path passing through the temporary wildcard node in the access path tree of the specified application, if the match is successful, the path parameter can be associated with the end node of the temporary wildcard path. If the number of all path parameters associated with the end node meets the wildcard threshold, a formal wildcard node corresponding to the path parameter can be created in the access path tree according to the temporary wildcard node to form a formal wildcard path passing through the formal wildcard node. By creating the temporary wildcard node and the wildcard node matching method used for the formal wildcard node, the path parameters contained in the API access path of the specified application can be identified, matched and processed in real time, so as to effectively merge similar API resources without additional manual participation, simple operation, short processing time, and high accuracy, thereby improving the efficiency and reliability of API resource processing.

[0049] Optionally, in a possible implementation of this embodiment, after 102, if no match is successful, a temporary wildcard node corresponding to the path parameter may be further created in the access path tree to form a temporary wildcard path passing through the temporary wildcard node.

[0050] In a specific implementation process, based on the API access path of each specified application, an access path tree can be constructed for each specified application, that is, the API access path is added to the access path tree. The API access paths in the access path tree of the specified application are traversed, and for each API access path, the path parameters contained in the API access path of the specified application can be determined.

[0051] Specifically, if a certain segment of pure numbers, character strings starting with numbers, Message Digest Algorithm 5 (MD5) characters, Universally Unique Identifier (UUID) characters, etc. are monitored in an API access path, it can be determined that these monitored pure numbers, character strings starting with numbers, MD5 characters, UUID characters, etc. are path parameters contained in the API access path.

[0052] For example, in the API access path " / user / 1 / profile", the second segment "1" is a pure number, which is very likely to be a path parameter. Therefore, it can be determined that the segment of pure number "1" is the path parameter contained in the API access path, which serves as the matching object for subsequent temporary wildcard nodes and formal wildcard nodes.

[0053] In the access path tree, the temporary wildcard node corresponding to the path parameter and the temporary wildcard path passing through the temporary wildcard node are matched. If no match is successful, the temporary wildcard node corresponding to the path parameter can be further created in the access path tree to form a temporary wildcard path passing through the temporary wildcard node.

[0054] For example, after determining the path parameter "1" in the API access path " / user / 1 / profile", if the temporary wildcard node corresponding to the path parameter and the temporary wildcard path passing through the temporary wildcard node are not matched in the access path tree, a temporary wildcard node "{}" corresponding to the path parameter can be created in the path tree, thereby forming a temporary wildcard path " / user / {} / profile" passing through the temporary wildcard node.

[0055] In another specific implementation process, considering that in the current access path tree, some path parameters may have created corresponding formal wildcard nodes, thereby forming a formal wildcard path passing through the formal wildcard nodes. Then, after traversing the API access path in the access path tree of the specified application and determining the path parameters contained in the API access path of each specified application, the formal wildcard nodes corresponding to the path parameters and the formal wildcard paths passing through the formal wildcard nodes can be further matched in the access path tree. If no match is successful, a temporary wildcard node corresponding to the path parameter is then created in the access path tree to form a temporary wildcard path passing through the temporary wildcard node. If the match is successful, no additional operations are required, or the real path node and the real access path corresponding to the path parameter can be further deleted.

[0056] In another specific implementation process, it is also considered that in the current access path tree, some path parameters may have created corresponding formal wildcard nodes, thereby forming a formal wildcard path passing through the formal wildcard node. Then, it is also possible not to add the API access path containing the path parameters in the access path tree. The formal wildcard node corresponding to the path parameter and the formal wildcard path passing through the formal wildcard node can be matched in the access path tree first. If no match is successful, the API access path is then added to the access path tree, and a temporary wildcard node corresponding to the path parameter is created in the access path tree to form a temporary wildcard path passing through the temporary wildcard node. If the match is successful, no additional operations are required.

[0057] Optionally, in a possible implementation of this embodiment, in 103, multiple methods may be used to associate the path parameter with the end node of the temporary wildcard path.

[0058] In a specific implementation process, the path parameter may be recorded on the end node of the temporary wildcard path.

[0059] For example, for the API access path " / user / 1 / profile", "1" can be recorded in the end node "profile" of the temporary wildcard path " / user / {} / profile" corresponding to the path parameter, that is, "profile[1]", and the temporary wildcard path becomes " / user / {} / profile[1]". If another API access path " / user / 2 / profile" is generated, "2" can also be recorded in the end node "profile" of the temporary wildcard path " / user / {} / profile" corresponding to the path parameter, that is, "profile[1,2]", and the temporary wildcard path becomes " / user / {} / profile[1,2]". By analogy, for any successfully matched API access path, the path parameter n can be recorded in the end node "profile" of the temporary wildcard path " / user / {} / profile" corresponding to the path parameter, that is, "profile[1,2,…,n]", and the temporary wildcard path becomes " / user / {} / profile[1,2,…,n]".

[0060] In another specific implementation process, a leaf node may be created under the end node of the temporary wildcard path, and the path parameters may be recorded on the leaf node, namely, "[1]".

[0061] For example, for the API access path " / user / 1 / profile", a leaf node can be created under the end node "profile" of the temporary wildcard path " / user / {} / profile", and the path parameter can be recorded on the leaf node, that is, "[1]", and the temporary wildcard path becomes " / user / {} / profile / [1]". If another API access path " / user / 2 / profile" is generated, "2" can also be recorded on the leaf node, that is, "[1,2]", and the temporary wildcard path becomes " / user / {} / profile / [1,2]". And so on, the path parameter n in any successfully matched API access path can be recorded on the leaf node, that is, "[1,2,…,n]", and the temporary wildcard path becomes " / user / {} / profile / [1,2,…,n]".

[0062] Optionally, in a possible implementation of this embodiment, in 104, the number of all path parameters associated with the end node may be specifically judged to determine whether it satisfies a wildcard threshold, for example, 5, 10, etc. If the number of all path parameters associated with the end node satisfies the wildcard threshold, assuming the wildcard threshold is 5, if the temporary wildcard path at this time becomes " / user / {} / profile / [1,2,…,5]", the operation of 104 may be performed, that is, according to the temporary wildcard node, a formal wildcard node "{id}" corresponding to the path parameter may be created in the access path tree to form a formal wildcard path " / user / {id} / profile" passing through the formal wildcard node.

[0063] At this point, in the access path tree of the specified application, the formal wildcard node and its formal wildcard path are created. For an API access path of the specified application, after determining the path parameters contained in the API access path of the specified application, the formal wildcard node corresponding to the path parameter and the formal wildcard path passing through the formal wildcard node can be matched in the access path tree. If the match is successful, it means that the API access path corresponding to the path parameter has been identified as a template path (or can also be a wildcard path), and the API has been updated to the API resource list, and no additional operations are required. If the match is not successful, it means that the API access path corresponding to the path parameter has not been identified as a template path (or can also be a wildcard path), then the API access path can be added to the access path tree, and a temporary wildcard node corresponding to the path parameter can be created in the access path tree to form a temporary wildcard path passing through the temporary wildcard node, so that the temporary wildcard node corresponding to the path parameter and the temporary wildcard path passing through the temporary wildcard node can be matched in the access path tree.

[0064] In a specific implementation process, if the number of all path parameters associated with the end node meets the wildcard threshold, in addition to executing 104, a step of deleting the temporary wildcard node in the access path tree and the real path nodes corresponding to the path parameters associated with the end node can be further executed, which can further streamline the access path tree of the specified application, thereby reducing system overhead.

[0065] By adopting the technical solution provided in this embodiment, through the wildcard node matching method adopted by creating temporary wildcard nodes and formal wildcard nodes, all API access paths of currently existing designated applications can be processed offline in batches, so that the path parameters contained in the API access path of the designated application can be quickly identified, matched and processed, so as to effectively merge similar API resources. The API access path of the currently acquired designated application can also be incrementally processed in real time, so that when a new API access path of a designated application is added, the path parameters contained in the API access path can be identified, matched and processed in real time, so as to effectively merge the API resource into a similar API resource.

[0066] Optionally, in a possible implementation of the present embodiment, by matching the wildcard nodes of the API access path of any specified application, if the number of API resources of any two specified applications meets a preset number threshold, for example, 100, 200, etc., and the similarity of the API resources of the two specified applications meets a preset similarity threshold, then the two specified applications can be determined as the same application and merged.

[0067] Specifically, an existing similarity algorithm, such as a Dice coefficient, may be used to calculate the similarity between the API resources of two specified applications.

[0068] In this embodiment, by determining the path parameters contained in the API access path of the specified application, and then matching the temporary wildcard node corresponding to the path parameter and the temporary wildcard path passing through the temporary wildcard node in the access path tree of the specified application, if the match is successful, the path parameter can be associated with the end node of the temporary wildcard path. If the number of all path parameters associated with the end node meets the wildcard threshold, a formal wildcard node corresponding to the path parameter can be created in the access path tree according to the temporary wildcard node to form a formal wildcard path passing through the formal wildcard node. By creating the temporary wildcard node and the wildcard node matching method used for the formal wildcard node, the path parameters contained in the API access path of the specified application can be quickly identified, matched and processed, so as to effectively merge similar API resources without additional manual participation, simple operation, short processing time, and high accuracy, thereby improving the efficiency and reliability of API resource processing.

[0069] In addition, by adopting the technical solution provided by the present invention, since a wildcard node matching method is adopted, when a new API access path of a specified application is added, the path parameters contained in the API access path can be identified, matched and processed in real time, so as to effectively merge the API resource into similar API resources. There is no need to recalculate all API access paths, and the overhead is very small, thereby effectively improving the efficiency of API resource processing.

[0070] In addition, by adopting the technical solution provided by the present invention, the number of API resources can be effectively reduced by matching the API access path of the specified application to the formal wildcard node corresponding to the path parameters contained therein and the formal wildcard path passing through the formal wildcard node, thereby improving the complexity and efficiency of API resource integration.

[0071] In addition, by adopting the technical solution provided by the present invention, by matching the wildcard node of the API access path of any specified application, if the number of API resources of any two specified applications meets the preset number threshold, and the similarity of the API resources of the two specified applications meets the preset similarity threshold, then the two specified applications can be determined as the same application and merged, which can effectively improve the management efficiency of the application.

[0072] 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.

[0073] 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.

[0074] Figure 2 is a schematic diagram according to the second embodiment of the present disclosure, such as Figure 2As shown. The processing device 200 of the application program interface of this embodiment may include a determination unit 201, a matching unit 202, an association unit 203 and a creation unit 204. Among them, the determination unit 201 is used to determine the path parameters contained in the API access path of the specified application; the matching unit 202 is used to match the temporary wildcard node corresponding to the path parameter and the temporary wildcard path passing through the temporary wildcard node in the access path tree of the specified application; the association unit 203 is used to associate the path parameter to the end node of the temporary wildcard path if the match is successful; the creation unit 204 is used to create a formal wildcard node corresponding to the path parameter in the access path tree according to the temporary wildcard node if the number of all path parameters associated with the end node meets the wildcard threshold, so as to constitute a formal wildcard path passing through the formal wildcard node.

[0075] 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.

[0076] 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.

[0077] Optionally, in a possible implementation of this embodiment, the matching unit 202 may be further configured to create a temporary wildcard node corresponding to the path parameter in the access path tree if no match is successful, so as to form a temporary wildcard path passing through the temporary wildcard node.

[0078] In a specific implementation process, the matching unit 202 can be specifically used to match the formal wildcard node corresponding to the path parameter and the formal wildcard path passing through the formal wildcard node in the access path tree of the specified application; if no match is successful, a temporary wildcard node corresponding to the path parameter is created in the access path tree to form a temporary wildcard path passing through the temporary wildcard node.

[0079] Furthermore, the matching unit 202 may be further configured to not perform any operation if the matching is successful.

[0080] Optionally, in a possible implementation of this embodiment, if the number of all path parameters associated with the end node meets the wildcard threshold, the creation unit 204 can be further used to delete the real path node corresponding to the path parameters associated with the temporary wildcard node and the end node in the access path tree.

[0081] Optionally, in a possible implementation of this embodiment, the association unit 203 can be specifically used to record the path parameters on the end node of the temporary wildcard path; or create a leaf node under the end node of the temporary wildcard path and record the path parameters on the leaf node.

[0082] 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.

[0083] In this embodiment, the determination unit determines the path parameters contained in the API access path of the specified application, and then the matching unit matches the temporary wildcard node corresponding to the path parameter and the temporary wildcard path passing through the temporary wildcard node in the access path tree of the specified application. If the matching unit matches successfully, the association unit can associate the path parameter with the end node of the temporary wildcard path, so that if the number of all path parameters associated with the end node meets the wildcard threshold, the creation unit can create a formal wildcard node corresponding to the path parameter in the access path tree according to the temporary wildcard node to form a formal wildcard path passing through the formal wildcard node. By creating the wildcard node matching method used for the temporary wildcard node and the formal wildcard node, the path parameters contained in the API access path of the specified application can be quickly identified, matched and processed, so as to effectively merge similar API resources without additional manual participation, simple operation, short processing time, and high accuracy, thereby improving the efficiency and reliability of API resource processing.

[0084] In addition, by adopting the technical solution provided by the present invention, since a wildcard node matching method is adopted, when a new API access path of a specified application is added, the path parameters contained in the API access path can be identified, matched and processed in real time, so as to effectively merge the API resource into similar API resources. There is no need to recalculate all API access paths, and the overhead is very small, thereby effectively improving the efficiency of API resource processing.

[0085] In addition, by adopting the technical solution provided by the present invention, the number of API resources can be effectively reduced by matching the API access path of the specified application to the formal wildcard node corresponding to the path parameters contained therein and the formal wildcard path passing through the formal wildcard node, thereby improving the complexity and efficiency of API resource integration.

[0086] In addition, by adopting the technical solution provided by the present invention, by matching the wildcard node of the API access path of any specified application, if the number of API resources of any two specified applications meets the preset number threshold, and the similarity of the API resources of the two specified applications meets the preset similarity threshold, then the two specified applications can be determined as the same application and merged.

[0087] In the technical solution disclosed herein, the acquisition, storage and application of the API access path of the specified application involved all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0088] 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.

[0089] 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.

[0090] like Figure 3 As 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.

[0091] 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.

[0092] 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).

[0093] 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.

[0094] 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.

[0095] 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.

[0096] 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).

[0097] 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.

[0098] 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.

[0099] 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.

[0100] 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: Determine the path parameters included in the application program interface API access path of the specified application; In the access path tree of the specified application, matching the temporary wildcard node corresponding to the path parameter and the temporary wildcard path passing through the temporary wildcard node; If the match is successful, the path parameter is associated with the end node of the temporary wildcard path; If the number of all path parameters associated with the end node meets the wildcard threshold, a formal wildcard node corresponding to the path parameter is created in the access path tree according to the temporary wildcard node to form a formal wildcard path passing through the formal wildcard node.

2. The method according to claim 1, characterized in that After matching the temporary wildcard node corresponding to the path parameter and the temporary wildcard path passing through the temporary wildcard node in the access path tree of the designated application, the method further includes: If no match is successful, a temporary wildcard node corresponding to the path parameter is created in the access path tree to form a temporary wildcard path passing through the temporary wildcard node.

3. The method according to claim 2, characterized in that The step of creating a temporary wildcard node corresponding to the path parameter in the access path tree to form a temporary wildcard path passing through the temporary wildcard node includes: In the access path tree of the specified application, matching the formal wildcarded node corresponding to the path parameter and the formal wildcarded path passing through the formal wildcarded node; If no match is successful, a temporary wildcard node corresponding to the path parameter is created in the access path tree to form a temporary wildcard path passing through the temporary wildcard node.

4. The method according to claim 3, characterized in that After matching the formal wildcarded node corresponding to the path parameter and the formal wildcarded path passing through the formal wildcarded node in the access path tree of the designated application, the method further includes: If the match is successful, no action is performed.

5. The method according to claim 1, characterized in that If the number of all path parameters associated with the end node meets the wildcard threshold, the method further includes: The real path nodes corresponding to the path parameters associated with the temporary wildcard node and the end node in the access path tree are deleted.

6. The method according to any one of claims 1 to 5, characterized in that The associating the path parameter to the end node of the temporary wildcard path includes: Recording the path parameter to the end node of the temporary wildcard path; or A leaf node is created under the end node of the temporary wildcard path, and the path parameters are recorded in the leaf node.

7. A device for processing an application program interface, characterized in that: include: A determination unit, used to determine the path parameters included in the access path of the application program interface API of the specified application; A matching unit, configured to match, in the access path tree of the specified application, a temporary wildcard node corresponding to the path parameter and a temporary wildcard path passing through the temporary wildcard node; an associating unit, configured to associate the path parameter with the end node of the temporary wildcard path if the match is successful; A creating unit is used to create a formal wildcard node corresponding to the path parameter in the access path tree according to the temporary wildcard node if the number of all path parameters associated with the end node meets the wildcard threshold, so as to form a formal wildcard path passing through the formal wildcard node.

8. The device according to claim 7, characterized in that The matching unit is also used If no match is successful, a temporary wildcard node corresponding to the path parameter is created in the access path tree to form a temporary wildcard path passing through the temporary wildcard node.

9. The device according to claim 8, characterized in that The matching unit is specifically configured to match the formal wildcarded node corresponding to the path parameter and the formal wildcarded path passing through the formal wildcarded node in the access path tree of the designated application; If no match is successful, a temporary wildcard node corresponding to the path parameter is created in the access path tree to form a temporary wildcard path passing through the temporary wildcard node.

10. The device according to claim 9, characterized in that The matching unit is further configured to not perform any operation if the matching is successful.

11. The device according to claim 7, characterized in that If the number of all path parameters associated with the end node meets the wildcard threshold, the creation unit is further configured to: The real path nodes corresponding to the path parameters associated with the temporary wildcard node and the end node in the access path tree are deleted.

12. The device according to any one of claims 7 to 11, characterized in that The association unit is specifically used for Recording the path parameter to the end node of the temporary wildcard path; or A leaf node is created under the end node of the temporary wildcard path, and the path parameters are recorded in the leaf node.

13. 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 6.

14. 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-6.

15. 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 6.