Preservation request processing method, device and equipment based on Zuul gateway and storage medium

Through the Zuul gateway receiving and forwarding of preservation requests, the problem of low efficiency in preservation request processing in the existing technology is solved, and the internal and external network access standardization and management of preservation services are realized, and the processing efficiency is improved.

CN119211337APending Publication Date: 2024-12-27PING AN HEALTH INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411148824.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The existing security management gateway solution requires restarting the gateway when the routing rules and current limiting policies are updated, and it is unable to flexibly send security requests to the corresponding service instances, resulting in low efficiency in handling security requests.

Method used

Receive safeguard requests through Zuul gateway and send them to the target microservice instance in a timely manner. When the target microservice instance generates an external service request, it is forwarded to the external microservice instance to realize two-way communication, unify the internal and external network access specifications, and reduce security. Service management complexity.

Benefits of technology

It improves the efficiency of handling protection requests, realizes standardization of internal and external network access of protection services, simplifies protection service management, and avoids downtime caused by gateway restart.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119211337A_ABST
    Figure CN119211337A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of financial science and technology, and particularly discloses a preservation request processing method and device based on a Zuu gateway, computer equipment and a storage medium. When a preservation request of a user is received, the preservation request is sent to the target micro-service instance and processed, and a first response result and to-be-processed content are obtained; and when an external domain service request generated by the target micro-service instance based on the to-be-processed content is received, sending the external domain service request to the external domain micro-service instance based on the Zuul gateway, and responding to the external domain service request to obtain a second response result. According to the application, the preservation request can be received through the Zuu gateway, the preservation request can be sent to the target micro-service instance in time, the external domain service request can be received through the Zuu gateway, and the external domain service request can be forwarded to the external domain micro-service instance, so that bidirectional communication is realized, internal and external network access specifications of the preservation service are unified, the complexity of preservation service management is reduced, and the user experience is improved. And the processing efficiency of the preservation request is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of financial technology, and in particular to a security request processing method, apparatus, computer equipment, and storage medium based on a Zuul gateway. Background Technology

[0002] With the development of computer technology, health insurance companies are gradually transforming their operations digitally. To support the expansion of their business scope, health insurance policy maintenance systems need to handle more insurance maintenance scenarios and complex processes. The outdated single-point system architecture can no longer meet these demands. Building an efficient and stable gateway system is crucial for ensuring data security and improving system performance. Current policy maintenance management gateway solutions are deployed as a single node by default, providing routing-based request forwarding, filtering, rate limiting, and circuit breaking functions. However, updating routing rules and rate limiting policies requires restarting the gateway to take effect, hindering the flexible sending of policy maintenance requests to corresponding service instances and the handling of external service requests, resulting in low processing efficiency. Therefore, improving the processing efficiency of policy maintenance requests has become an urgent problem to be solved. Summary of the Invention

[0003] This application provides a method, apparatus, computer device, and storage medium for processing security requests based on a Zuul gateway, in order to improve the processing efficiency of security requests.

[0004] Firstly, this application provides a preservation request processing method based on the Zuul gateway, the method comprising:

[0005] Upon receiving a user's security request, the security request is sent to the target microservice instance;

[0006] The preservation request is processed based on the target microservice instance to obtain the first response result of the preservation request and the content to be processed;

[0007] When a target microservice instance receives an external domain service request generated based on the content to be processed, the external domain service request is sent to the external domain microservice instance via the Zuul gateway, so that the external domain service instance responds to the external domain service request and obtains a second response result.

[0008] Based on the first response result and the second response result, the response result of the preservation request is obtained.

[0009] Secondly, this application also provides a security request processing device based on a Zuul gateway, the device comprising:

[0010] The preservation request sending module is used to send the preservation request to the target microservice instance when it receives a user's preservation request;

[0011] The first response result acquisition module is used to process the preservation request based on the target microservice instance to obtain the first response result of the preservation request and the content to be processed.

[0012] The second response result acquisition module is used to send the external domain service request to the external domain microservice instance based on the external domain service instance when the target microservice instance generates the external domain service request based on the content to be processed, so as to obtain the second response result based on the external domain service instance.

[0013] The response result acquisition module is used to obtain the response result of the preservation request based on the first response result and the second response result.

[0014] Thirdly, this application also provides a computer device, the computer device including a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and, when executing the computer program, implement the security request processing method based on the Zuul gateway as described above.

[0015] Fourthly, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to implement the security request processing method based on the Zuul gateway as described above.

[0016] This application discloses a security request processing method, apparatus, computer device, and storage medium based on a Zuul gateway. Upon receiving a user's security request, the method sends the security request to a target microservice instance. The target microservice instance processes the security request to obtain a first response result and pending content. Upon receiving an external domain service request generated by the target microservice instance based on the pending content, the method sends the external domain service request to an external domain microservice instance via the Zuul gateway, allowing the external domain service instance to respond to the external domain service request and obtain a second response result. Based on the first and second response results, the method obtains the response result of the security request. This application can receive security requests through the Zuul gateway, promptly send security requests to the target microservice instance, and receive and forward external domain service requests to external domain microservice instances, achieving bidirectional communication. This unifies the internal and external network access specifications for security services, reduces the complexity of security service management, and thus improves the processing efficiency of security requests. Attached Figure Description

[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0018] Figure 1 This is a schematic flowchart of a first embodiment of a preservation request processing method based on a Zuul gateway provided by the embodiments of this application;

[0019] Figure 2 This is a schematic flowchart of a second embodiment of a preservation request processing method based on a Zuul gateway provided by the embodiments of this application;

[0020] Figure 3 This is a schematic flowchart of a third embodiment of a preservation request processing method based on a Zuul gateway provided in the embodiments of this application;

[0021] Figure 4 A schematic block diagram of a security request processing device based on a Zuul gateway, provided for embodiments of this application;

[0022] Figure 5 A schematic block diagram of the structure of a computer device provided for an embodiment of this application. Detailed Implementation

[0023] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0024] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.

[0025] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0026] It should also be understood that the term "and / or" as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0027] This application provides a method, apparatus, computer device, and storage medium for security request processing based on a Zuul gateway. The Zuul gateway-based security request processing method can be applied to a server. It receives security requests through the Zuul gateway, promptly sends them to the target microservice instance, and receives external domain service requests and forwards them to external domain microservice instances, achieving bidirectional communication. This unifies the internal and external network access standards for security services, reduces the complexity of security service management, and thus improves the processing efficiency of security requests. The server can be a standalone server or a server cluster.

[0028] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0029] Please see Figure 1 , Figure 1 This is a schematic flowchart illustrating a security request processing method based on a Zuul gateway, provided in an embodiment of this application. This Zuul gateway-based security request processing method can be applied to a server to receive security requests through the Zuul gateway, promptly send the security requests to the target microservice instance, and receive external domain service requests and forward them to external domain microservice instances through the Zuul gateway. This enables bidirectional communication, unifies the internal and external network access specifications for security services, reduces the complexity of security service management, and thus improves the processing efficiency of security requests.

[0030] like Figure 1 As shown, the security request processing method based on the Zuul gateway specifically includes steps S101 to S104.

[0031] S101. Upon receiving a user's security request, the security request is sent to the target microservice instance;

[0032] In one embodiment, the Zuul gateway-based security request processing method is applied to a Zuul gateway-based security request processing management system. This system includes a Zuul gateway node, a Nacos registry, an ESBX registry, and a routing configuration center. The Zuul gateway node, acting as both the system's entry and exit point, receives requests from clients, secures external requests from the microservice cluster, performs routing, filtering, and other processing, and forwards the requests to the appropriate backend service or external domain service. The Nacos registry, as the service registration and discovery center, manages the registration information of all health insurance security microservice instances in the system and provides it to the Zuul gateway for dynamic routing. The ESBX registry, as a registry compatible with external legacy systems, provides more advanced security authentication and access control functions to ensure system security and stability. The gateway service is designed to act as both a service provider and a consumer, enabling bidirectional communication. The Zuul gateway obtains service instance information from the Nacos registry or ESBX registry and routing rules from the routing configuration center based on the service's registration information, and forwards the request to the target microservice instance according to the obtained routing rules.

[0033] In one embodiment, the protection request can be initiated by a user through a client (such as a browser, mobile application, or other client). The protection request can be a request for health insurance protection services.

[0034] In one embodiment, the preservation request first reaches the Zuul gateway, which then forwards the preservation request to its corresponding target microservice instance. The Zuul gateway serves as the entry point for the microservice architecture, responsible for receiving and forwarding all incoming requests.

[0035] Zuul Gateway is an edge service that acts as a proxy for client access to backend services, and also serves as a unified access point for those services. It is responsible for routing requests to the correct backend services and handling tasks such as authentication, stress testing, and dynamic routing.

[0036] S102. Process the preservation request based on the target microservice instance to obtain the first response result of the preservation request and the content to be processed;

[0037] In one embodiment, the protection request is processed according to the target microservice instance to obtain a first response. This may include operations such as verifying user identity, checking the legitimacy of the request, and querying the database to obtain relevant information. After processing, a first response result is obtained, which contains a portion of the processing result of the protection request.

[0038] In one embodiment, during the process of processing the preservation request based on the target microservice instance, there may be content that the target microservice instance cannot currently process and requires further processing, which is then treated as pending processing content.

[0039] S103. When receiving an external domain service request generated by the target microservice instance based on the content to be processed, the external domain service request is sent to the external domain microservice instance based on the Zuul gateway, so as to respond to the external domain service request based on the external domain service instance and obtain a second response result.

[0040] In one embodiment, when the target microservice instance discovers content (i.e., content to be processed) that requires calling an external service (such as a third-party payment interface, SMS notification service, etc.) during processing, it will generate an external service request based on the content to be processed and the external service to be called. The request contains detailed information about the external service to be called, such as the interface address and parameters.

[0041] In one embodiment, external domain service requests are sent to the external domain microservice instance via the Zuul gateway. Upon receiving the external domain service request, the external domain microservice instance invokes the actual external service to process the content to be processed, obtains a second response result, and returns the second response result to the Zuul gateway.

[0042] Furthermore, the step of sending the external domain service request to the external domain microservice instance based on the content to be processed when the target microservice instance receives the external domain service request generated based on the content to be processed includes: sending the external domain service request to the Zuul gateway based on the remote procedure call traffic when the external domain service request is received; and sending the preservation request to the external domain microservice instance based on the Zuul gateway and the preset second routing rules.

[0043] In one embodiment, when a request for a service from an external domain is received, the request is typically sent via RPC (Remote Procedure Call). RPC is a technique that allows a program to invoke functions on a remote computer as if they were local functions. Therefore, remote procedure call traffic refers to the request and response data transmitted between the client and the server.

[0044] In one embodiment, upon receiving remote procedure call (RPC) traffic, the first step is to identify the external domain service request. This involves parsing the RPC packets to extract detailed request information, such as the target service's address, method, and parameters.

[0045] In one embodiment, after identifying an external domain service request, the request is sent to the Zuul gateway. Specifically, this involves constructing an HTTP (Hypertext Transfer Protocol) request, converting the information in the RPC data packet into an HTTP request format, and then sending this request to the Zuul gateway via the HTTP protocol.

[0046] In one embodiment, after receiving an HTTP request, the Zuul gateway forwards it to the correct external microservice instance according to a predefined second routing rule. This second routing rule is typically defined in a configuration file, specifying which URLs (Uniform Resource Locators) should be forwarded to which external microservice instances. For example, a routing rule might be "all URLs starting with / api (Application Programming Interface) / should be forwarded to external microservice instances."

[0047] In one embodiment, when a URL matches a second routing rule, the Zuul gateway forwards the external domain service request to the corresponding external domain microservice instance according to the second routing rule. The external domain microservice instance receives and processes the external domain service request, and then returns the result to the Zuul gateway.

[0048] S104. Based on the first response result and the second response result, obtain the response result of the preservation request.

[0049] In one embodiment, the second response result is merged with the first response result obtained from the target microservice to form the final response result for the preservation request. The response result contains all the necessary processing information corresponding to the preservation request and is eventually returned to the user.

[0050] The above embodiments provide a security request processing method, apparatus, computer device, and storage medium based on a Zuul gateway. Upon receiving a user's security request, the security request is sent to a target microservice instance. The security request is processed based on the target microservice instance to obtain a first response result and pending content. Upon receiving an external domain service request generated by the target microservice instance based on the pending content, the external domain service request is sent to an external domain microservice instance via the Zuul gateway. The external domain service instance responds to the external domain service request to obtain a second response result. Based on the first and second response results, the response result of the security request is obtained. This application can receive security requests via the Zuul gateway, promptly send security requests to the target microservice instance, and receive and forward external domain service requests to external domain microservice instances via the Zuul gateway, achieving bidirectional communication. This can meet complex business needs and security requirements, unify the internal and external network access standards for security services, reduce the complexity of security service management, and thus improve the processing efficiency of security requests.

[0051] Please see Figure 2 , Figure 2 This is a schematic flowchart illustrating a preservation request processing method based on a Zuul gateway, provided in an embodiment of this application. This Zuul gateway-based preservation request processing method can be applied to servers to determine the most suitable target microservice instance for a preservation request based on routing rules and the load and health status of the microservice instance, thereby improving the processing efficiency of preservation requests.

[0052] like Figure 2 As shown, step S101 of the preservation request processing method based on the Zuul gateway specifically includes steps S201 to S203.

[0053] S201. Upon receiving a user's security request, obtain the microservice registration information corresponding to the security request and the preset first routing rule;

[0054] S202. Based on the first routing rule and the microservice registration information, determine the target microservice instance;

[0055] In one embodiment, when the Zuul gateway receives a security request, it extracts relevant information from the request, such as the microservice instance name (i.e., the name of the microservice the user wants to interact with) and other routing information that may be included (such as paths, query parameters, etc.). Simultaneously, the gateway queries a service registry (such as Nacos, Eureka, etc.) for the registration information of all currently available microservices, including the instance ID, IP address, port, and health status of each service. Furthermore, based on the type and parameters of the security request, it queries the routing rule table in the configuration file or database from the routing configuration center and selects the corresponding first routing rule.

[0056] In one embodiment, based on a preset first routing rule, the gateway determines how to route the received preservation request to the backend service instance. The routing rule can include various factors, such as service name, path, load balancing strategy, and failover strategy. If the routing rule is based on the microservice instance name, the gateway searches the registry for all microservice instances matching that name. Based on the health status, load status, and other possible metrics (such as geographical location and version number) of each microservice, the gateway selects the most suitable microservice instance to handle the current request, ensuring the target microservice instance performs optimally and improving the efficiency of preservation request processing.

[0057] Further, determining the target microservice instance based on the first routing rule and the microservice registration information includes: analyzing the microservice registration information to obtain the load status and health status of each microservice instance; and determining the target microservice instance based on the first routing rule, the load status, and the health status.

[0058] In one embodiment, multiple microservice instances typically run on different servers or containers. To achieve load balancing and failover, it is necessary to monitor and analyze the load and health status of each microservice in real time, and determine the target microservice instance accordingly.

[0059] In a specific embodiment, registration information of all microservice instances is collected from a service registry (such as Nacos), which may include service name, instance ID, IP address, port number, performance metrics (including but not limited to CPU utilization, memory usage, network I / O, request response time, etc.).

[0060] In a specific embodiment, health check information is collected, such as through HTTP endpoints, TCP probes, or user-defined health check scripts, to detect whether the microservice instance is in a normal operating state.

[0061] In one embodiment, collected performance metrics are analyzed to determine the current load status of each microservice. This may include calculating average load, identifying peak load periods, and detecting abnormal load patterns.

[0062] In one embodiment, microservice instances are marked as "healthy" or "unhealthy" based on health check results. A microservice instance is considered "unhealthy" if it fails a preset threshold of consecutive health checks.

[0063] In one embodiment, a target microservice instance is selected based on a first routing rule and the load and health status analysis results of the microservice instance. Specifically, the first routing rule may include load balancing strategies, such as round-robin, random selection, or least connections, to distribute request load among multiple service instances. It may also include service instance weights; for example, if service instances are assigned different weights, the routing rule will determine request allocation based on these weights. It may also include failover logic, where requests are automatically routed to a backup instance when the preferred service instance becomes unavailable. For example, a microservice instance with a light load and meeting health requirements is selected based on the load balancing strategy to handle new requests, achieving efficient resource utilization and response time optimization. If a microservice is marked as unhealthy, requests are transferred to other healthy microservice instances according to the failover logic to ensure continuous service availability. Specific microservice instances are selected for processing based on the data characteristics of the request (such as geographical location, user type, etc.).

[0064] In one embodiment, load balancing and health check strategies can be dynamically adjusted as the system's operating state changes. For example, more resources can be added to handle traffic during peak hours, or fault recovery operations can be performed immediately when an anomaly is detected in a microservice.

[0065] In one embodiment, performance metrics and health status of all microservices are continuously monitored, and this data is used to continuously optimize routing decisions and system configuration. A feedback mechanism is also provided to allow operators to manually intervene in the routing decision process (such as manually diverting traffic to a specific backup server in an emergency).

[0066] Further, determining the target microservice instance based on the first routing rule, the load status, and the health status includes: parsing the first routing rule to obtain a service instance selection strategy; scoring each microservice instance based on the service instance selection strategy, the load status, and the health status; and determining the microservice instance with the highest score as the target microservice instance.

[0067] In one embodiment, analyzing and parsing the first routing rule may include service version selection, service instance weight, regional preference, request allocation ratio, etc.

[0068] In one embodiment, a strategy for selecting service instances is determined based on the parsed routing rules, such as scoring criteria (e.g., weight of load metrics, impact factors of health status, response time score, etc.), round-robin, least connections, random selection, or dynamic selection based on load and health status.

[0069] In one embodiment, each microservice instance is scored according to a scoring criterion, quantifying load and health status into numerical values ​​and weighting them according to a strategy. A weighting algorithm is used to consider the importance of different metrics; for example, if stability is more important than response time, health status may have a higher weight. The scores of all microservice instances are compared, and the instance with the highest score is identified. This highest-scoring microservice instance is then determined as the target microservice instance—the instance best suited to handle the current request.

[0070] S203. Based on the first routing rule, the preservation request is sent to the target microservice instance to respond to the preservation request.

[0071] In one embodiment, the Zuul gateway forwards the request to the target microservice instance according to the first routing rule and updates its internal routing table to record this routing decision. If other requests with the same service name arrive in the future, this routing decision can be used directly for fast forwarding.

[0072] In a specific implementation, the Zuul gateway routes the preservation request to the correct microservice instance according to predefined routing rules. These routing rules can be determined based on service name, operation type, data content, or other business logic. Preservation requests correctly routed to the target microservice instance will be processed, and the microservice will return a corresponding response to the Zuul gateway. The response can be the result of a successfully executed operation, or it can be an error message or a result of handling an exception.

[0073] Furthermore, before sending the security request to the target microservice instance based on the first routing rule, the method further includes: assessing the security level of the security request to obtain its security level; dynamically updating the security verification policy of the security request based on the security level; and performing security verification on the security request based on the security verification policy, so that when the security request passes the security verification, the security request is sent to the microservice instance based on the first routing rule.

[0074] In one embodiment, the ESBX (Enterprise Service Bus) assesses the security level of preservation requests. This includes analyzing and evaluating the content of the preservation request, the sender's identity, and the security attributes contained within the request. The security level can be determined based on predefined rules or through dynamic evaluation using machine learning models.

[0075] In one embodiment, the ESBX registry dynamically updates the security verification strategy for security requests based on the identified security level. Different verification measures, such as multi-factor authentication, digital signatures, and timestamp checks, are used for security requests with different security levels.

[0076] For example, the authentication levels can be: default level zero, level one: weak verification, level two: soft verification, and level three: strong verification.

[0077] Among them, Level 0: No verification required (complete trust: internal calls to policies, customers, operation management systems, etc.);

[0078] Level 1: Verify the authenticity of the caller (only verify the existence of businessId, internal third party). Here, businessId is usually used as a unique identifier in enterprise or business systems to distinguish different business entities or business records.

[0079] Level 2: Verify system access permissions (the requester must authorize the service system on the web platform before accessing it);

[0080] Level 3: Verify access permissions to the interface (the requester must authorize the service interface on the web platform before it can be accessed).

[0081] In one embodiment, an updated security verification policy is used to perform security verification on the preservation request. If the preservation request passes verification, it is deemed trustworthy and can proceed to the next processing stage. If verification fails, the preservation request is rejected, and the relevant event can be logged for subsequent auditing or investigation.

[0082] In one embodiment, if the security request passes the security verification, the Zuul gateway will route the security request to the correct microservice instance according to predefined routing rules.

[0083] In one embodiment, a preservation request correctly routed to the target microservice instance will be processed, and the microservice will return a corresponding response to the Zuul gateway. The response can be the result of a successfully executed operation, or it can be an error message or the result of handling an exception.

[0084] In one embodiment, throughout the process, the ESBX registry center monitors the processing status and performance metrics of the preservation request, and records relevant log information for auditing, troubleshooting, and performance optimization.

[0085] In the above embodiments, the system based on the ESBX registry center can ensure a secure and manageable security request processing flow in complex distributed systems, while providing flexibility and scalability to adapt to ever-changing security and business requirements.

[0086] Please see Figure 3 , Figure 3 This is a schematic flowchart illustrating a preservation request processing method based on a Zuul gateway, provided in an embodiment of this application. This Zuul gateway-based preservation request processing method can be applied to servers to modify routing rules based on changes in microservice instances. The updated routing rules take effect immediately without requiring a restart or reconfiguration of the Zuul gateway itself. This avoids the situation where proxy routing and rate limiting policies are configured in the application.properties file, requiring a gateway restart for each change to take effect, thus enabling the gateway service to quickly adapt to service changes and expansion requirements.

[0087] like Figure 3 As shown, before step S203 of the preservation request processing method based on the Zuul gateway, steps S301 to S302 are also included.

[0088] S301. Obtain the change information of the target microservice instance and send the change information to the Zuul gateway;

[0089] S302. Based on the Zuul gateway and the change information, generate a routing decision, and dynamically update the first routing rule based on the routing decision.

[0090] In one embodiment, specific microservice instances can be subscribed to (listened to) in the Nacos registry. Specifically, one or more listeners are set up to receive update events from Nacos, such as the addition, removal, and health status changes of service instances. For example, the security gateway integrates a self-developed configuration center, which can obtain configurations in real time and listen for configuration updates.

[0091] In one embodiment, when a change event is received, such as a new microservice instance registering with Nacos or an instance's state changing (e.g., from healthy to unhealthy), this information is captured and processed.

[0092] In one embodiment, the captured change information typically includes metadata about the service, such as the service name, version, instance ID, IP address, port, and health status. This change information is then sent to the Zuul gateway via a message queue, HTTP call, or some internal communication mechanism.

[0093] In one embodiment, after receiving information about microservice instance changes from Nacos, the Zuul gateway generates new routing decisions based on this information. These routing decisions consider factors such as load balancing, failover, and service versioning. Based on these routing decisions, Zuul dynamically updates its internal routing rules. Specifically, it creates or updates a route mapping table that defines how each request should be routed to the backend microservice instance.

[0094] In one embodiment, the updated routing rules take effect immediately without requiring a restart or reconfiguration of the Zuul gateway itself. When a target microservice instance fails, preservation requests are promptly transferred, ensuring timely processing. This avoids the situation where proxy routing and rate limiting policies are configured in the application.properties file, requiring a gateway restart for each change to take effect. This allows the gateway service to quickly adapt to service changes and expansion needs, improving the efficiency of preservation request processing and the stability of preservation service management.

[0095] Please see Figure 4 , Figure 4 This application provides a schematic block diagram of a security request processing device based on a Zuul gateway, which is used to execute the aforementioned security request processing method based on a Zuul gateway. The security request processing device based on a Zuul gateway can be configured on a server.

[0096] like Figure 4 As shown, the security request processing device 400 based on the Zuul gateway includes:

[0097] The preservation request sending module 401 is used to send the preservation request to the target microservice instance when it receives a user's preservation request;

[0098] The first response result acquisition module 402 is used to process the preservation request based on the target microservice instance to obtain the first response result of the preservation request and the content to be processed.

[0099] The second response result acquisition module 403 is used to send the external domain service request to the external domain microservice instance based on the external domain service instance based on the external domain service instance when the target microservice instance generates the external domain service request based on the content to be processed, so as to obtain the second response result.

[0100] The response result acquisition module 404 is used to obtain the response result of the preservation request based on the first response result and the second response result.

[0101] Furthermore, the preservation request sending module 401 includes:

[0102] The routing rule acquisition submodule is used to acquire the microservice registration information corresponding to the security request and the preset first routing rule when a user's security request is received;

[0103] The service instance determination submodule is used to determine the target microservice instance based on the first routing rule and the microservice registration information;

[0104] The preservation request sending submodule is used to send the preservation request to the target microservice instance based on the first routing rule in order to respond to the preservation request.

[0105] Furthermore, the preservation request sending module 401 also includes:

[0106] The security level assessment submodule is used to assess the security level of the preservation request and obtain the security level of the preservation request.

[0107] The verification strategy update submodule is used to dynamically update the security verification strategy of the preservation request based on the security level.

[0108] The security verification submodule is used to perform security verification on the preservation request based on the security verification policy, so that when the preservation request passes the security verification, the preservation request is sent to the microservice instance based on the first routing rule.

[0109] Furthermore, the preservation request sending module 401 also includes:

[0110] The change information acquisition submodule is used to acquire change information of the target microservice instance and send the change information to the Zuul gateway;

[0111] The routing rule update submodule is used to generate routing decisions based on the Zuul gateway and the change information, and dynamically update the first routing rule based on the routing decisions.

[0112] Furthermore, the service instance determination submodule includes:

[0113] The status acquisition unit is used to analyze the microservice registration information to obtain the load status and health status of each microservice instance.

[0114] The service instance determination unit is used to determine the target microservice instance based on the first routing rule, the load status, and the health status.

[0115] Furthermore, the service instance determination sub-unit includes:

[0116] The selection strategy obtains a sub-unit, which is used to parse the first routing rule and obtain the service instance selection strategy;

[0117] The service instance scoring subunit is used to score each microservice instance based on the service instance selection strategy, the load status, and the health status.

[0118] The service instance determination subunit is used to determine the microservice instance with the highest score as the target microservice instance.

[0119] Further, the second response result obtaining module 403 includes:

[0120] The external domain service request receiving unit is used to send the external domain service request to the Zuul gateway based on the remote procedure call traffic when it receives the external domain service request;

[0121] The external domain service request sending unit is used to send the security request to the external domain microservice instance based on the Zuul gateway and the preset second routing rules.

[0122] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the above-described apparatus and modules can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0123] The aforementioned device can be implemented as a computer program, which can be used in, for example... Figure 5 It runs on the computer device shown.

[0124] Please see Figure 5 , Figure 5 This is a schematic block diagram illustrating the structure of a computer device according to an embodiment of this application. The computer device may be a server.

[0125] See Figure 5The computer device includes a processor, memory, and network interface connected via a system bus, wherein the memory may include non-volatile storage media and internal memory.

[0126] The non-volatile storage medium can store the operating system and computer program. The computer program includes program instructions that, when executed, cause the processor to perform any of the Zuul gateway-based security request processing methods.

[0127] The processor provides computing and control capabilities, supporting the operation of the entire computer device.

[0128] The internal memory provides an environment for the execution of computer programs in non-volatile storage media. When the computer program is executed by the processor, it enables the processor to perform any security request processing method based on the Zuul gateway.

[0129] This network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0130] It should be understood that the processor can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, a general-purpose processor can be a microprocessor or any conventional processor.

[0131] In one embodiment, the processor is configured to run a computer program stored in memory to perform the following steps:

[0132] Upon receiving a user's security request, the security request is sent to the target microservice instance;

[0133] The preservation request is processed based on the target microservice instance to obtain the first response result of the preservation request and the content to be processed;

[0134] When a target microservice instance receives an external domain service request generated based on the content to be processed, the external domain service request is sent to the external domain microservice instance via the Zuul gateway, so that the external domain service instance responds to the external domain service request and obtains a second response result.

[0135] Based on the first response result and the second response result, the response result of the preservation request is obtained.

[0136] In one embodiment, when the processor receives a user's security request and sends the security request to the target microservice instance, it is configured to:

[0137] Upon receiving a user's security request, obtain the microservice registration information corresponding to the security request and the preset first routing rule;

[0138] Based on the first routing rule and the microservice registration information, the target microservice instance is determined;

[0139] Based on the first routing rule, the preservation request is sent to the target microservice instance to respond to the preservation request.

[0140] In one embodiment, before the processor sends the preservation request to the target microservice instance based on the first routing rule, it is further configured to implement:

[0141] The security level of the preservation request is assessed to obtain the security level of the preservation request;

[0142] The security verification strategy for the preservation request is dynamically updated based on the security level.

[0143] The security verification policy is used to perform security verification on the preservation request, so that when the preservation request passes the security verification, the preservation request is sent to the microservice instance based on the first routing rule.

[0144] In one embodiment, before the processor implements sending the preservation request to the target microservice instance based on the first routing rule in response to the preservation request, it is further configured to implement:

[0145] Obtain change information of the target microservice instance and send the change information to the Zuul gateway;

[0146] Based on the Zuul gateway and the change information, a routing decision is generated, and the first routing rule is dynamically updated based on the routing decision.

[0147] In one embodiment, when the processor determines the target microservice instance based on the first routing rule and the microservice registration information, it is configured to:

[0148] The microservice registration information is analyzed to obtain the load status and health status of each microservice instance;

[0149] The target microservice instance is determined based on the first routing rule, the load status, and the health status.

[0150] In one embodiment, when the processor determines the target microservice instance based on the first routing rule, the load status, and the health status, it is configured to:

[0151] The first routing rule is parsed to obtain the service instance selection strategy;

[0152] Each microservice instance is scored based on the service instance selection strategy, the load status, and the health status.

[0153] The microservice instance with the highest score is identified as the target microservice instance.

[0154] In one embodiment, when the processor receives an external domain service request generated by the target microservice instance based on the content to be processed, and sends the external domain service request to the external domain microservice instance via the Zuul gateway, it is configured to:

[0155] Upon receiving the external domain service request, the request is sent to the Zuul gateway based on the remote procedure call traffic;

[0156] Based on the Zuul gateway and the preset second routing rules, the security request is sent to the external domain microservice instance.

[0157] The embodiments of this application also provide a computer-readable storage medium storing a computer program, the computer program including program instructions, and the processor executing the program instructions to implement any of the security request processing methods based on the Zuul gateway provided in the embodiments of this application.

[0158] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiments, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, SmartMedia Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device.

[0159] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for processing security requests based on Zuul gateway, characterized in that: Methods include: When receiving a security request from a user, sending the security request to a target microservice instance; Processing the security request based on the target microservice instance to obtain a first response result of the security request and content to be processed; Upon receiving the external domain service request generated by the target microservice instance based on the to-be-processed content, based on the Zuul gateway, the external domain service request is sent to the external domain microservice instance, so as to respond to the external domain service request based on the external domain service instance to obtain a second response result; A response result of the preservation request is obtained based on the first response result and the second response result.

2. According to the Zuul gateway-based security request processing method of claim 1, it is characterized in that: When receiving a security request from a user, sending the security request to a target microservice instance includes: Upon receiving a security request from a user, obtaining microservice registration information corresponding to the security request and a preset first routing rule; Determine the target microservice instance based on the first routing rule and the microservice registration information; Based on the first routing rule, the security request is sent to the target microservice instance to respond to the security request.

3. According to the Zuul gateway-based security request processing method of claim 2, it is characterized in that: Before sending the security request to the target microservice instance based on the first routing rule, the method further includes: Identifying the security level of the preservation request to obtain the security level of the preservation request; Dynamically update the security verification policy of the preservation request based on the security level; The security request is security verified based on the security verification policy, so that when the security request passes the security verification, the security request is sent to the microservice instance based on the first routing rule.

4. According to the Zuul gateway-based security request processing method according to claim 2, it is characterized in that: Before sending the security request to the target microservice instance based on the first routing rule to respond to the security request, the method further includes: Obtain change information of the target microservice instance, and send the change information to the Zuul gateway; Based on the Zuul gateway and the change information, a routing decision is generated, and the first routing rule is dynamically updated based on the routing decision.

5. According to the Zuul gateway-based security request processing method of claim 2, it is characterized in that: The determining the target microservice instance based on the first routing rule and the microservice registration information includes: Analyze the microservice registration information to obtain the load status and health status of each microservice instance; The target microservice instance is determined based on the first routing rule, the load status, and the health status.

6. The Zuul gateway-based security request processing method according to claim 5, characterized in that: The determining the target microservice instance based on the first routing rule, the load status, and the health status includes: Parsing the first routing rule to obtain a service instance selection strategy; Scoring each of the microservice instances based on the service instance selection strategy, the load status, and the health status; The microservice instance with the highest score is determined as the target microservice instance.

7. The Zuul gateway-based security request processing method according to any one of claims 1 to 6, characterized in that: When receiving the external domain service request generated by the target microservice instance based on the content to be processed, sending the external domain service request to the external domain microservice instance based on the Zuul gateway includes: When receiving the external domain service request, based on the remote procedure call traffic, sending the external domain service request to the Zuul gateway; Based on the Zuul gateway and the preset second routing rule, the security request is sent to the external domain microservice instance.

8. A security request processing device based on Zuul gateway, characterized in that: include: A security request sending module is used to send the security request to the target microservice instance upon receiving the security request from the user; A first response result obtaining module, used to process the preservation request based on the target microservice instance, and obtain a first response result of the preservation request and content to be processed; A second response result obtaining module is used to, when receiving an external domain service request generated by the target microservice instance based on the content to be processed, send the external domain service request to the external domain microservice instance based on the Zuul gateway, so as to respond to the external domain service request based on the external domain service instance to obtain a second response result; A response result obtaining module is used to obtain a response result of the preservation request based on the first response result and the second response result.

9. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is used to execute the computer program and implement the Zuul gateway-based security request processing method as described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the Zuul gateway-based security request processing method as described in any one of claims 1 to 7.