API gateway and operation method thereof

The method enhances API gateway stability and efficiency by parsing messages to manage route configurations and update repositories selectively, addressing the challenges of high traffic and route management in existing systems.

WO2024232462A1PCT designated stage expired Publication Date: 2024-11-14COUPANG CORP

Patent Information

Application Number
PCT/KR2023/006922
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-09
Filing Date
2023-05-22
Publication Date
2024-11-14

AI Technical Summary

Technical Problem

API gateways face structural limitations in stability, security, and efficiency when handling unexpected high traffic, leading to difficulties in managing route configurations and applying changes without affecting the entire system.

Method used

The proposed method involves parsing messages to determine the API gateway's operating state, checking route configurations, and updating repositories only when necessary, allowing for targeted updates and real-time modifications, thereby improving system stability and security.

Benefits of technology

This approach enhances system stability by controlling traffic for each request, enables independent route configuration management, and improves efficiency by allowing partial modifications without redeploying the entire code, with versioning for easy rollback in exceptional circumstances.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure KR2023006922_14112024_PF_FP_ABST
    Figure KR2023006922_14112024_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed is an API gateway operation method by which traffic can be controlled per request on basis of a spring cloud gateway.
Need to check novelty before this filing date? Find Prior Art

Description

API Gateway and How It Works

[0001] The present disclosure relates to a method of operating an API gateway capable of handling a large amount of traffic.

[0002] Multiple customers can run applications installed on their respective terminals and receive responses from the server in response to their requests. An API gateway can be designed to handle application operation based on the anticipated volume of traffic using the application. However, if traffic exceeds the anticipated amount, the API gateway may face structural limitations in terms of stability, security, and efficiency. Therefore, a technology is needed to operate an API gateway that avoids structural issues even under high traffic loads.

[0003] The disclosed embodiments disclose an API gateway and its operating method. The technical challenges to be achieved by the present embodiments are not limited to the technical challenges described above, and other technical challenges can be inferred from the following embodiments.

[0004] According to a first embodiment, a method of operating an API gateway may include: a step of parsing a message; a step of confirming whether the operating status of the API gateway is started or in operation; a step of confirming a route configuration from a file included in the parsed message in consideration of the confirmed operating status; a step of parsing the route configuration for at least one route; a step of confirming whether the at least one parsed route is managed in a repository; and a step of determining whether to proceed with an update of the repository based on whether the repository manages the route.

[0005] According to an embodiment, the step of checking whether the operating status of the API gateway is started or running may include a step of checking information related to the target server based on the parsed message when the operating status of the API gateway is checked as running.

[0006] According to an embodiment, the step of verifying information related to the target server may include: a step of verifying IP address information of the target server; and a step of verifying whether there is a correspondence between the IP address information of the target server and the IP address information verified from the parsed message.

[0007] According to an embodiment, the step of checking whether the operating status of the API gateway is started or in operation may include the step of checking the time information of the file included in the parsed message if the IP address information of the target server corresponds to the IP address information identified from the parsed message; and the step of checking whether the file is the latest file based on the time information of the file.

[0008] According to an embodiment, the step of checking whether there is a correspondence between the IP address information of the target server and the IP address information identified from the parsed message may include a step of skipping the update based on the parsed message if the IP address information of the target server and the IP address information identified from the parsed message do not correspond.

[0009] According to an embodiment, the step of determining whether the file is the latest file based on the time information of the file may include the step of skipping the update based on the parsed message if the file is not the latest file.

[0010] According to an embodiment, the step of confirming the route configuration from the file included in the parsed message in consideration of the confirmed operation status may include a step of confirming the route configuration from the file included in the parsed message when the operation status of the API gateway is confirmed as being in operation and the file is confirmed as the latest file based on the time information of the file.

[0011] According to an embodiment, the step of confirming the route configuration from the file included in the parsed message in consideration of the confirmed operation status may include the step of confirming the route configuration from the file included in the parsed message when the operation status of the API gateway is confirmed as the operation start.

[0012] According to an embodiment, the step of verifying whether the at least one parsed route is managed in a repository may include the step of verifying whether the at least one parsed route exists in the repository.

[0013] According to an embodiment, the step of checking whether the at least one parsed route is managed in the repository may include the step of checking whether the version of the at least one parsed route has changed if the at least one parsed route exists in the repository.

[0014] According to an embodiment, the step of determining whether to proceed with an update of the repository based on whether the repository is managed may include a step of proceeding with the update to add the at least one parsed route to the repository if the at least one parsed route does not exist in the repository.

[0015] According to an embodiment, the step of determining whether to proceed with an update of the repository based on whether the repository is managed may include a step of determining to proceed with the update by adding the at least one parsed route to the repository if the version of the at least one parsed route has changed, or determining to skip the update if the version has not changed.

[0016] According to an embodiment, the method may further include a step of determining a target route corresponding to the request based on at least one updated route.

[0017] According to an embodiment, the method may further include: checking related information corresponding to the request from a target server providing a target service based on the target route; and returning a response including the related information.

[0018] According to a second embodiment, the API gateway may include a communication unit; a memory; and a processor that parses a message, determines whether the operation status of the API gateway is started or in operation, determines a route configuration from a file included in the parsed message in consideration of the determined operation status, parses the route configuration for at least one route, determines whether the at least one parsed route is managed in a repository, and determines whether to proceed with an update of the repository based on whether the repository manages the route.

[0019] According to a third embodiment, a computer-readable recording medium includes a non-transitory recording medium having recorded thereon a program for executing the above-described method on a computer.

[0020] Specific details of other embodiments are included in the detailed description and drawings.

[0021] According to the present disclosure, traffic control can be performed on a per-request basis, thereby improving system stability. Furthermore, when modifications to certain routes are required, only those routes can be modified without having to update the entire route, thereby improving system stability. Furthermore, independent environmental security can be improved for each route configuration. Furthermore, when modifications are required in the upstream domain (the target service), only those modifications can be applied in real time without requiring full code modification and redeployment, thereby improving efficiency. Furthermore, version management for route configurations allows for easy reversion to previous versions in exceptional circumstances.

[0022] The effects of the invention are not limited to the effects mentioned above, and other effects not mentioned will be clearly understood by those skilled in the art from the description of the claims.

[0023] Figure 1 is a diagram illustrating an existing API gateway that processes requests from customers.

[0024] FIG. 2 is a drawing for explaining an API gateway of a new structure according to one embodiment.

[0025] Figure 3 is a drawing for explaining a management portal according to one embodiment.

[0026] FIG. 4 is a diagram for explaining the operation of a Route Config Loader Component module according to one embodiment.

[0027] FIG. 5 is a diagram illustrating a Spring Cloud Gateway according to an embodiment, and FIG. 6 is a diagram illustrating a predicate embedded in a Spring Cloud Gateway according to an embodiment.

[0028] FIG. 7 is a diagram for explaining a traffic control filter included in a free type filter in one embodiment.

[0029] FIG. 8 is a drawing for explaining an authentication filter included in a free type filter according to one embodiment.

[0030] FIG. 9 is a drawing for explaining a rate limit filter included in a free type filter according to one embodiment.

[0031] FIG. 10 is a diagram for explaining a blacklist filter included in a free type filter according to one embodiment.

[0032] FIG. 11 is a drawing for explaining a circuit blocking filter included in a free type filter according to one embodiment.

[0033] Figure 12 illustrates a flowchart of an operation method performed by an API gateway according to one embodiment.

[0034] FIG. 13 is a block diagram illustrating an API gateway according to one embodiment.

[0035] The terms used in the embodiments have been selected from widely used and common terms, taking into account the functions of the present disclosure. However, these terms may vary depending on the intentions of those skilled in the art, precedents, the emergence of new technologies, etc. Furthermore, in certain cases, terms may be arbitrarily selected by the applicant, in which case their meanings will be described in detail in the relevant description. Therefore, the terms used in this disclosure should not be defined simply as names of terms, but rather based on the meanings of the terms and the overall content of the present disclosure.

[0036] When a part of the specification is said to "include" a component, this does not exclude other components, but rather implies the inclusion of other components, unless otherwise specifically stated. Furthermore, terms such as "part" and "module" used in the specification mean a unit that processes at least one function or operation, which may be implemented in hardware, software, or a combination of hardware and software.

[0037] The expression "at least one of a, b, and c" described throughout the specification may encompass 'a alone', 'b alone', 'c alone', 'a and b', 'a and c', 'b and c', or 'all of a, b, and c'.

[0038] The "terminal" mentioned below may be implemented as a computer or portable terminal that can connect to a server or other terminal via a network. Here, the computer includes, for example, a notebook, desktop, laptop, etc. equipped with a web browser, and the portable terminal may include, for example, a wireless communication device that guarantees portability and mobility, and may include all types of handheld-based wireless communication devices such as communication-based terminals such as IMT (International Mobile Telecommunication), CDMA (Code Division Multiple Access), W-CDMA (W-Code Division Multiple Access), LTE (Long Term Evolution), smartphones, tablet PCs, etc.

[0039] Below, embodiments of the present disclosure are described in detail with reference to the attached drawings so that those skilled in the art can easily implement the present disclosure. However, the present disclosure may be implemented in various different forms and is not limited to the embodiments described herein.

[0040] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the drawings.

[0041] Figure 1 is a diagram illustrating an existing API gateway that processes requests from customers.

[0042] Referring to FIG. 1, multiple customers (110) can run applications installed on their respective terminals to receive responses corresponding to their requests from the server (170). For example, multiple customers (110) can make requests related to food delivery services (e.g., store information, order information, payment information, item information, review information, etc.) through applications installed on their respective terminals, and the server (170) can provide responses corresponding to the requests. At this time, traffic corresponding to the requests of the customers (110) can be automatically distributed based on a public Application Load Balancer (ALB) (130).

[0043] The API gateway (150) can identify a domain (152) based on the application layer (151). For example, the API gateway (150) can identify domains (152) such as / endpoint / , / meta / , and / abtest / by analyzing traffic through the public application load balancer (130) at the application layer (151).

[0044] The API gateway (150) includes a controller module (153), and the controller module (153) may include an endpoint handler and a controller. At this time, the endpoint handler uses the domain (152) to check the server corresponding to the request, and the related information checked by the server may be included in the response returned to the customer (110). At this time, the endpoint handler may set an AB Test related file or set a key value checked in a CMDB KV Config related operation. For reference, the endpoint handler may check the value set in the CMDB KV Config every certain period of time (e.g., 60 seconds). In addition, the information received by the endpoint handler may transmit a request to the server (170) through a rest web client (154) based on an HTTP UI. At this time, the server (170) may be a server confirmed in response to the request. That is, when a customer requests related information through an application, all requests may be transmitted to the corresponding server (170) via an endpoint handler, and response information may be returned to the customer based on the information confirmed by the server (170).

[0045] For example, a server (170) for providing a food delivery service may be divided into multiple servers to manage related information. For example, a server may manage store information, a server may manage item information, a server may manage customer information, a server may manage payment information, a server may manage order information, and a server may manage review information. Accordingly, the server (170) responding to a request from the API gateway (150) may identify related information, and a response including the identified related information may be transmitted to the customer.

[0046] However, the API gateway (150) with this structure has the following difficulties in terms of stability, security, and efficiency. For example, there was a difficulty in protecting the system by controlling traffic, such as rate limiting, circuit blocking, or anti-crawler, in response to each request. In addition, in relation to the route configuration, if some routes needed to be changed, the entire route configuration had to be updated every time, making it difficult to manage the route configuration. In addition, there was a difficulty in that some changes had to be applied to all requests because personalized functions could not be applied to each route. In the case of a change, such as adding a server to the upstream server (170) corresponding to the target server, the API gateway (150) had to change the code and redistribute it, making it difficult to efficiently modify or manage the upstream server (170). Additionally, the Endpoint Handler can check the values ​​set in the CMDB KV Config at regular intervals (e.g., 60 seconds). If modifications were required regarding the route configuration, there was a 60-second delay and difficulties in real-time reflection. In addition, since the environments were not separated, the same settings were shared across stages, making it difficult to confirm the modified contents when modifying some of the route configuration.

[0047] Therefore, when using an API gateway with a structure like that of Fig. 1, there are difficulties as described above, so an API gateway with a structure like that of Fig. 2 that can be controlled by traffic is examined in detail below.

[0048] FIG. 2 is a drawing for explaining an API gateway of a new structure according to one embodiment.

[0049] Referring to FIG. 2, the Admin Portal (210) may include a Configuration Dashboard module (211), a Route Publish module (212), and a Controller (213). The Configuration Dashboard module (211) may separately manage Predicates, Filters, and Route Configurations. That is, the Configuration Dashboard module (211) may manage Predicates, Filters, and Route Configurations based on the Predicate Plugins Management module, the Filter Plugins Management module, and the Route Configuration Management module. FIG. 2 illustrates only components related to the present embodiment. Therefore, it will be understood by those skilled in the art that other general components may be included in addition to the components illustrated in FIG. 2. Additionally, what is known in the related art may be applied to predicates, filters and routes.

[0050] The management portal (210) can store related information in storage (220), and the storage (220) can be composed of a MySQL Cluster and an S3 Bucket. The MySQL Cluster and the S3 Bucket each have storage functions, and information stored in the MySQL Cluster and information stored in the S3 Bucket can be linked to each other depending on the settings.

[0051] When a route is changed or is running, the management portal (210) can transmit information (e.g., version) about the changed route or the running route to the API gateway (230). At this time, the controller (213) checks information about the route through the MySQL Cluster to transmit the information to the API gateway (230), and the route configuration management module can check related information through S3. Large amounts of information can be moved from the MySQL Cluster to S3 and managed. In addition, router information, predicate information, and filter information are stored in the S3 Bucket, and the MySQL Cluster only stores single router information. The S3 Bucket can store additionally generated information based on the information stored in MySQL or information whose size is greater than a certain value. The route configuration loader component can receive information managed in the S3 Bucket based on the information stored in MySQL.

[0052] The configuration dashboard module (211) can transmit relevant information to the route disclosure module (212) when a route is updated, and the route disclosure module (212) can manage the version of the updated route. That is, the route disclosure module (212) can manage the version of the updated route based on the route version management module, and thus, history information about the route version can be confirmed.

[0053] The route version management module can provide real-time route version information to the processor CONSUL, and the processor CONSUL can provide real-time information to the API gateway (230) when a route change is confirmed. Accordingly, the API gateway (230) can confirm changes in the route configuration and perform updates according to the changes.

[0054] Multiple customers (240) can access applications installed on different terminals, and at this time, traffic corresponding to the customers (240) can be automatically distributed and managed based on an Internet-facing Application Load Balancer (ALB) (250). More specifically, Nginx or Envoy is a load balancer, and traffic according to a customer request can be transmitted to a specific pod within the API gateway (230) based on a load balancer selected from among the two.

[0055] The API gateway (230) may include multiple pods, each of which may process customer requests received by each pod. In this case, each pod may correspond to a single server.

[0056] The API gateway (230) receives route change information in real time from CONSUL, and the pods included in the API gateway (230) can add or skip new routes or new versions of routes to the repository based on the Route Config Loader Component module and the Route Config Refresher module. For details on this, refer to FIG. 4 below.

[0057] The monitor (260) module can monitor the status related to the API gateway (230). Specifically, with respect to prometheus of the monitor (260) module, if the throughput in a specific pod of the API gateway (230) exceeds a reference value, an alarm message can be transmitted to the administrator in real time, and the administrator can check the abnormal status of the specific pod based on the alarm message. In addition, with respect to coutrace of the monitor (260) module, if an abnormality occurs in a customer request based on the API, it can be confirmed which API has the problem. In addition, with respect to Coumon of the monitor (260) module, whether a pod has been allocated can be confirmed, and if the expected value for the pod is exceeded, an alarm message can be transmitted accordingly.

[0058] Figure 3 is a drawing for explaining a management portal according to one embodiment.

[0059] Referring to Figure 3, an administrator can register a new predicate or filter related to route configuration in the management portal. The management portal can manage route versions, and in exceptional cases where the administrator wishes to revert to a previous version, it can easily be done through route version management. Related predicates and filters can be applied to what is known in the art. Administrators can use the management portal to manage blacklists or change servers in upstream domains. Furthermore, the RouteFilters table is configured based on the FilterFactories table, the RoutePredicates table is configured based on the PredicateFactories table, and the Service on the target server can be configured based on the ServiceGlobalFilters and ServiceGlobalPredicates tables. These can be combined to configure the Route table. Note that the RoutePredicates table may be associated with predicates applied to a specific route, and the RouteFilters table may be associated with filters applied to a specific route. Additionally, unlike the RoutePredicates table, the ServiceGlobalPredicates table is related to predicates that apply to all routes, and unlike the RouteFilters table, the ServiceGlobalFilters table may be related to filters that apply to all routes. A specific service may contain many routes, and each route may need to be configured based on many predicates or filters. If the same predicate or filter is configured for each route, it may be inefficient, so commonly applied predicates or filters can be managed in the ServiceGlobalFilters table and the ServiceGlobalPredicates table.Additionally, the RouteRequestApi table can be used to configure independent APIs within specific routes. For example, if a specific route is ~ / a, RouteRequestApi can be used to configure control over ~ / a / b or ~ / a / c. This approach can simplify the amount of code associated with the management portal, reducing the administrative burden on administrators.

[0060] FIG. 4 is a diagram for explaining the operation of a Route Config Loader Component module according to one embodiment.

[0061] Referring to FIG. 4, the Route Config Loader Component module can receive route change information from the processor Consul, and the Route Config Loader Component module can receive a message. At this time, the message can correspond to information stored in the storage S3 bucket.

[0062] In step S411, the Route Config Loader Component module that receives the message can parse the message in JSON format. At this time, the Route Config Loader Component module can parse the message to check a timestamp, an instance, and a configuration file. Here, the timestamp corresponds to time information related to the message, and the instance corresponds to IP address information related to the message. At this time, the IP address information can include address information set to have a certain range.

[0063] In step S413, the Route Config Loader Component module can determine whether the application's operating status is "Started" or "Running." At this time, the "Started" status of the application refers to the case where the application has started running for the first time, which can correspond to the case where the API gateway's operating status is "Started." In other words, the case where the application has started running for the first time in a pod (i.e., server) included in the API gateway can correspond to the case where the application has started running for the first time.

[0064] If the operating status of the application or API gateway is running rather than starting, it can be confirmed in step S415 whether the target instance corresponds to an instance included in the parsed message. Specifically, if the application is running, the IP address information of the running application can be confirmed, and it can be confirmed whether the IP address information of the application is included in the instance included in the parsed message. At this time, the instance included in the parsed message can be set as a range, and it can be confirmed whether the IP address information of the application is included in the range.

[0065] If the instance included in the parsed message does not contain the IP address information of the application, the update based on the message may be skipped (step S429). Alternatively, if the instance included in the parsed message does contain the IP address information of the application, it may be determined whether the file is the most recent based on the time information identified from the parsed message in step S417.

[0066] If the file is not the most recent, the message-based update may be skipped (step S429). Alternatively, if the file is confirmed to be the most recent, the route configuration may be identified from the configuration file included in the parsed message. In step S421, the route configuration may be parsed for each route.

[0067] In step S423, the Route Config Loader Component module can check whether each route exists in the repository. If not, the route can be updated to be added to the repository in step S427.

[0068] Alternatively, if present, the route version may be checked in step S425 to determine whether it has changed. If the version has not changed, the message-based update may be skipped (step S429). Alternatively, if the version has changed, the route may be updated to be added to the repository in step S427.

[0069] FIG. 5 is a diagram illustrating a Spring Cloud Gateway according to an embodiment, and FIG. 6 is a diagram illustrating a predicate embedded in a Spring Cloud Gateway according to an embodiment.

[0070] Referring to FIG. 5, Spring Cloud Gateway can receive a request from a customer (510). With respect to the request received from the customer, the handler mapping (530) can check whether all predicates match the request and discover a predicate appropriate for the request. At this time, the handler mapping (530) can discover a target route based on the predicate that matches the request. An example of the predicate that the handler mapping (530) checks for a match can be seen in FIG. 6. The predicate is composed of a combination of field names, operators, etc., as shown in FIG. 6, and the handler mapping (530) can discover a predicate that matches the predicate included in the request. Information related to predicates can be applied to information known in the relevant technical field. For more information regarding Spring Cloud Gateway, reference can be made to information known in the relevant technical field.

[0071] Afterwards, the request may pass through the web handler (550) and filter (570) to confirm relevant information corresponding to the request from the target service (590). At this time, the request may pass through the free type filter (571) before reaching the target service (590), and when the request reaches the target service (590), a response including the relevant information may pass through the post type filter (572) and be returned to the customer.

[0072] FIG. 7 is a diagram for explaining a traffic control filter included in a free type filter in one embodiment.

[0073] Referring to FIG. 7, a request from a customer can be confirmed in step S710. In step S720, a match between the target route identified in the handler mapping and the preset route can be confirmed in response to the request from the customer based on the query. For example, a match between the target route and the preset route can be confirmed based on the ABTest SDK. Based on the match, steps S730 and S740 can be determined as True or False. If determined as True, a response can be taken if traffic control is determined to be appropriate, and if determined as False, a response can be taken if traffic control is determined to have failed.

[0074] FIG. 8 is a drawing for explaining an authentication filter included in a free type filter according to one embodiment.

[0075] Referring to FIG. 8, an authentication filter may be operated to check the customer's login status. In order to use a service provided through an application (e.g., a food delivery service), authentication is required based on an access token based on credential information, and the validity of the access token may be determined using different methods. Specifically, a request from a customer may be confirmed in step S810. In step S820, the success or failure of authentication may be determined based on the authentication filter in response to the request from the customer. At this time, the success or failure of authentication may be determined based on the validity of the access token. More specifically, the validity of the access token may be determined using an API-forge-based method or a Redis (Remote Dictionary Server)-based method. If the success or failure of authentication is confirmed in step S830, the next filter may be applied. If the authentication fails in step S840, a response notifying an invalid authentication may be returned based on the authentication failure.

[0076] FIG. 9 is a drawing for explaining a rate limit filter included in a free type filter according to one embodiment.

[0077] Referring to FIG. 9, a rate limit filter considering a login status may operate in response to a customer request. The rate limit filter may filter out crawlers or illegal users to protect the service from excessive traffic and ensure fairness and rationality in resource usage. A request may be confirmed from a customer in step S910. Whether the customer is logged in may be confirmed in step S920, and whether the customer is a real user may be confirmed in step S930. Specifically, if the customer is logged in, the memberSrl value may be used as identification information for the rate limit to determine whether the customer is a crawler or a real user. If the customer is not logged in, the pcid value may be used as identification information for the rate limit to determine whether the customer is a crawler or a real user. If the customer is confirmed to be a real user in step S940, the following filter may be applied. If a crawling or illegal user is determined to be not a real user in step S950, the pcid value or memberSrl value can be recorded in the management portal by a Kafka message, and a response corresponding to exceeding the rate limit can be returned in response to a customer request.

[0078] FIG. 10 is a diagram for explaining a blacklist filter included in a free type filter according to one embodiment.

[0079] Referring to FIG. 10, a filter may be implemented to determine whether a customer is blacklisted. A request may be confirmed from the customer in step S1010. Whether the customer is logged in may be determined in step S1020. If the customer is logged in, the memberSrl value may be used as identification information for determining the blacklist. If the customer is not logged in, the pcid value may be used as identification information for determining the blacklist. Whether the customer is blacklisted may be determined in step S1030. The management portal may synchronize information about blacklisted users identified by other methods and information about crawlers or illegal users identified by rate limits to a database every 10 seconds. Accordingly, whether the customer is blacklisted may be determined by comparing the pcid or memberSrl value with the synchronized information in the database. If the customer is not blacklisted in step S1040, the following filter may be applied. If the customer is blacklisted in step S1050, the customer's request may be determined to be invalid and a response containing relevant information may be returned.

[0080] FIG. 11 is a drawing for explaining a circuit blocking filter included in a free type filter according to one embodiment.

[0081] Referring to Fig. 11, a circuit breaker filter is a filter that blocks a service in advance when an overload or failure occurs in relation to the service to prevent a chain of failures of other services that call the service. For example, if the number of failures exceeds a threshold, the circuit can be opened to prevent execution for a certain period of time and cause failure. Specifically, a request can be confirmed from a customer in step S1110. Whether a circuit is blocked can be confirmed in step S1120. If the circuit is not blocked, which means that no failure has occurred, the request is transmitted to the upstream service in step S1130, and relevant information corresponding to the request is confirmed from the upstream service and provided as a response to the customer. At this time, the upstream service can respond to the aforementioned target service. Alternatively, if a circuit is confirmed to be blocked, a response corresponding to the unavailability of the upstream service can be returned in step S1140.

[0082] Figure 12 illustrates a flowchart of an operation method performed by an API gateway according to one embodiment. The above description may also be applied here.

[0083] Referring to FIG. 12, a message can be parsed in step S1210.

[0084] In step S1220, it is possible to determine whether the operating status of the API gateway is in the process of starting or running. If the operating status of the API gateway is determined to be in the process of running rather than in the process of starting, information related to the target server can be determined based on the message. If the operating status of the API gateway is in the process of running, this corresponds to the case where an application is running, and the IP address information of the application can be determined. The IP address information of the running application can correspond to the IP address information of the target server (i.e., pod). Alternatively, if the operating status of the API gateway is in the process of starting, this can correspond to the case where the application is being started for the first time.

[0085] At this time, information related to the target server may include information regarding the IP address of the target server and whether there is a correspondence between the IP address information identified from the parsed message and the target server's IP address information. The IP address information identified from the message may be designated as a range, and whether the target server's IP address information is included within the range may be confirmed. If the target server's IP address information does not correspond to the IP address information identified from the parsed message, updates based on the received message may be skipped.

[0086] If the target server's IP address information matches the IP address information identified from the parsed message, the file's time information can be verified, and whether the file is up-to-date can be determined based on the file's time information. If the file is not up-to-date, the update based on the received message can be skipped.

[0087] The route configuration can be verified from the file included in the parsed message, taking into account the operation status confirmed in step S1230.

[0088] If the API gateway's operational status is confirmed as running and the file's time information indicates that it is the most recent file, the route configuration can be verified from the file included in the parsed message. If the API gateway is confirmed to be running, the route configuration can be verified from the file included in the parsed message.

[0089] In step S1240, the route configuration can be parsed for at least one route. The route configuration identified from the file included in the message can be parsed for at least one route.

[0090] It can be confirmed whether at least one route parsed in step S1250 is managed in the repository, and whether to proceed with updating the repository based on whether it is managed in the repository in step S1260.

[0091] For each parsed route, whether it exists in the repository can be checked, and whether to proceed with an update can be determined based on whether it exists in the repository. In addition, if it exists in the repository, whether the version of at least one parsed route has changed can be checked, and whether to proceed with an update can be determined based on the check. If it exists in the repository but the version has changed, the update can be performed to add at least one route to the repository. If the version has not changed, the update can be skipped. Alternatively, if it does not exist in the repository, the update can be performed to add at least one route to the repository.

[0092] Thereafter, after a target route corresponding to the request is determined based on at least one updated route, relevant information corresponding to the request can be confirmed from a target server providing a target service by passing through at least one free type filter. A response including relevant information corresponding to the request can be returned to the customer after passing through a post type filter. At this time, details regarding the free type filter and the post type filter are described above. The free type filters described in FIGS. 7 to 11 can be selectively applied in response to a request, and the order in which the filters are applied can be set differently depending on the request.

[0093] FIG. 13 is a block diagram illustrating an API gateway according to one embodiment.

[0094] According to one embodiment, the API gateway (1300) may include a communication unit (1310), a memory (1320), and a processor (1330). The API gateway (1300) illustrated in FIG. 13 only includes components related to the present embodiment. Therefore, those skilled in the art will understand that, in addition to the components illustrated in FIG. 13, other general-purpose components may be included.

[0095] The API gateway (1300) can perform operations processed in the process of providing a response in response to a request from a customer. The communication unit (1310) can transmit and receive related information through a network. The network includes a Local Area Network (LAN), a Wide Area Network (WAN), a Value Added Network (VAN), a mobile radio communication network, a satellite communication network, and a combination thereof, and is a comprehensive data communication network that enables the network components described in this specification to communicate smoothly with each other, and may include wired Internet, wireless Internet, and mobile radio communication networks. Wireless communication may include, but is not limited to, wireless LAN (Wi-Fi), Bluetooth, Bluetooth low energy, Zigbee, Wi-Fi Direct (WFD), ultra wideband (UWB), infrared communication (IrDA, infrared Data Association), NFC (Near Field Communication), etc., for example.

[0096] The processor (1330) can control the overall operation of the API gateway (1300) and process data and signals. The processor (1330) can include at least one hardware unit. In addition, the processor (1330) can operate by one or more software modules generated by executing program code stored in the memory (1320). The processor (1330) can control the overall operation of the API gateway (1300) and process data and signals by executing the program code stored in the memory (1320). In addition, in an embodiment, the processor (1330) can include at least one processor.

[0097] The processor (1330) can parse a message, determine whether the operation status of the API gateway is started or in operation, determine a route configuration from a file included in the parsed message in consideration of the determined operation status, parse the route configuration for at least one route, determine whether the at least one parsed route is managed in a repository, and determine whether to proceed with an update of the repository based on whether the repository manages the route.

[0098] The API gateway or terminal according to the above-described embodiments may include a processor, a memory for storing and executing program data, permanent storage such as a disk drive, a communication port for communicating with an external device, a purchaser interface device such as a touch panel, a key, a button, etc. The methods implemented as software modules or algorithms may be stored on a computer-readable recording medium as computer-readable codes or program instructions executable on the processor. Here, the computer-readable recording medium includes a magnetic storage medium (e.g., read-only memory (ROM), random-access memory (RAM), floppy disk, hard disk, etc.) and an optical reading medium (e.g., CD-ROM, DVD: Digital Versatile Disc)). The computer-readable recording medium may be distributed to computer systems connected to a network, so that the computer-readable code may be stored and executed in a distributed manner. The medium may be readable by a computer, stored in a memory, and executed on a processor.

[0099] The present embodiment may be represented by functional block configurations and various processing steps. These functional blocks may be implemented by various hardware and / or software configurations that perform specific functions. For example, the embodiment may employ direct circuit configurations such as memory, processing, logic, look-up tables, etc., which may perform various functions under the control of one or more microprocessors or other control devices. Similarly, the present embodiment may be implemented in a programming or scripting language such as C, C++, Java, assembler, etc., including various algorithms implemented as a combination of data structures, processes, routines, or other programming configurations. Functional aspects may be implemented as algorithms that execute on one or more processors. Furthermore, the present embodiment may employ conventional techniques for electronic configuration, signal processing, and / or data processing. Terms like "mechanism," "element," "means," and "composition" can be used broadly and are not limited to mechanical or physical components. These terms can also encompass a series of software routines, such as those associated with a processor.

[0100] The above-described embodiments are merely examples, and other embodiments may be implemented within the scope of the claims set forth below.

Claims

1. Regarding the operation method of the API gateway, Step of parsing the message; A step of checking whether the operation status of the above API gateway is started or in operation; A step of confirming a route configuration from a file included in the parsed message by considering the confirmed operation status; A step of parsing the above route configuration for at least one route; A step of checking whether at least one of the parsed routes is managed in the repository; and Including a step of determining whether to proceed with an update of the repository based on whether the repository is managed. How API Gateway works.

2. In paragraph 1, The step of checking whether the operation status of the above API gateway is started or running is as follows: If the operation status of the API gateway is confirmed as being in operation, a step of confirming information related to the target server based on the parsed message is included. How API Gateway works.

3. In paragraph 2, The step of checking information related to the above target server is: A step of checking the IP address information of the target server; and A step of checking whether there is a correspondence between the IP address information of the target server and the IP address information identified from the parsed message, How API Gateway works.

4. In paragraph 3, The step of checking whether the operation status of the above API gateway is started or running is as follows: A step of checking the time information of the file included in the parsed message when the IP address information of the target server corresponds to the IP address information confirmed from the parsed message; and A step of checking whether the file is the latest file based on the time information of the file, How API Gateway works.

5. In paragraph 3, The step of checking whether there is a correspondence between the IP address information of the target server and the IP address information confirmed from the parsed message is as follows: Including a step of skipping the update based on the parsed message when the IP address information of the target server and the IP address information confirmed from the parsed message do not correspond. How API Gateway works.

6. In paragraph 4, Based on the time information of the above file, the step of checking whether it is the latest file is: Comprising a step of skipping the update based on the parsed message if the file is not the latest, How API Gateway works.

7. In paragraph 4, The step of checking the route configuration from the file included in the parsed message considering the above-determined operation status is: Including a step of confirming the route configuration from the file included in the parsed message, when the operation status of the API gateway is confirmed as being in operation and the file is confirmed as the latest file based on the time information of the file. How API Gateway works.

8. In paragraph 2, The step of checking the route configuration from the file included in the parsed message considering the above-determined operation status is: If the operation status of the API gateway is confirmed as the start of the operation, a step of confirming the route configuration from the file included in the parsed message is included. How API Gateway works.

9. In paragraph 1, The step of checking whether at least one of the above parsed routes is managed in the repository is: A step of checking whether at least one parsed route exists in the repository, How API Gateway works.

10. In paragraph 9, The step of checking whether at least one of the above parsed routes is managed in the repository is: If at least one parsed route exists in the repository, a step of checking whether the version of at least one parsed route has changed is included. How API Gateway works.

11. In paragraph 9, The step of determining whether to proceed with an update of the above repository based on whether it is managed in the above repository is as follows: Including the step of performing the update to add the at least one parsed route to the repository if the at least one parsed route does not exist in the repository. How API Gateway works.

12. In paragraph 10, The step of determining whether to proceed with an update of the above repository based on whether it is managed in the above repository is as follows: Including a step of determining to proceed with the update to add the at least one parsed route to the repository if the version of the at least one parsed route has changed, or to skip the update if the version has not changed. How API Gateway works.

13. In paragraph 1, Further comprising a step of determining a target route corresponding to the request based on the above repository. How API Gateway works.

14. In paragraph 13, A step of confirming relevant information corresponding to the request from a target server providing a target service based on the target route; Further comprising the step of returning a response including the above related information, How API Gateway works.

15. As an API gateway, Department of Communications; memory; and A processor comprising: a processor for parsing a message, determining whether the operation status of the API gateway is started or running, determining a route configuration from a file included in the parsed message in consideration of the determined operation status, parsing the route configuration for at least one route, determining whether the at least one parsed route is managed in a repository, and determining whether to proceed with an update of the repository based on whether the repository manages the route. API gateway.

Citation Information

Patent Citations

  • Logical router using multiple routing components

    JP6908525B2

  • Method and Apparatus for Routing Traffic Based on Service in Network Environment

    KR1020170044314A

  • Graphene quantum dots as treating agent for diseases related fibrosis or aggregation of neural proteins

    KR1020200005501A

  • Device for Planting Seedling Using Drone

    KR1020230048202A

  • Gateway device for API integration processing and operation method thereof

    KR102483310B1

Cited By

  • Dynamic routing configuration method and system based on Spring Cloud Gateway

    CN120583025A