Access request processing method and device, equipment and storage medium
By providing an access request processing method in the SCG, the target routing address is dynamically determined based on access information and preset routing rules, the problem of difficulty in adapting to changes in the prior art is solved, the routing accuracy and flexibility of access requests are improved, and the stability and scalability of the system are ensured.
Patent Information
- Application Number
- CN202411998294.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-18
AI Technical Summary
The existing Spring-Cloud-Gateway (SCG) routing rules are difficult to seamlessly adapt to new needs, resulting in business interruptions in the microservice cluster system during the upgrade process, affecting the routing of access requests and affecting the stability of business processing.
It provides an access request processing method, which allows you to route the access request to the target application system by receiving access requests, obtaining access information, and determining the target routing address based on the access information and preset routing rules. This method can match preset routing rules based on access information and dynamically adjust routing rules to adapt to splitting and changes of the application system.
It improves the routing accuracy and flexibility of access requests, ensures that the application system has no service interruption during the splitting and upgrading process, maintains stable routing of access requests, and improves the scalability and stability of the system.
Smart Images

Figure CN119854207A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an access request processing method, apparatus, device and storage medium. Background Art
[0002] With the rapid development of computer technology, Spring-Cloud-Gateway (SCG for short) has become a core component in the microservice cluster architecture. As a bridge between service nodes, SCG is responsible for managing and routing access requests in and out of the microservice cluster, providing strong support for building a flexible and scalable microservice cluster system.
[0003] As the business volume grows, the microservice cluster system will also change rapidly, so users will gradually need to route access requests according to more complex rules. However, the current SCG routing rules are difficult to seamlessly adapt to new needs, which may cause business interruptions in the microservice cluster system during the upgrade process and affect the routing of access requests. Obviously, this will have a great impact on the stability of business processing. Summary of the invention
[0004] Based on this, it is necessary to provide an access request processing method, apparatus, computer device, computer-readable storage medium and computer program product that can improve the routing accuracy and flexibility of access requests in response to the above technical problems.
[0005] In a first aspect, the present application provides a method for processing an access request. The method comprises:
[0006] receiving an access request and obtaining access information in the access request;
[0007] Determine the target routing address of the access request based on the access information and the target routing rule, where the target routing rule is determined based on the matching result between the preset routing rule and the access information;
[0008] Routing the access request to the target application system according to the target routing address;
[0009] The target application system includes a target sub-application system in at least two corresponding sub-application systems after the application system is split.
[0010] In a second aspect, the present application also provides an access request processing device. The device comprises:
[0011] A receiving module, used for receiving an access request and obtaining access information in the access request;
[0012] A determination module, used to determine a target routing address of the access request according to the access information and the target routing rule, wherein the target routing rule is determined based on a matching result between a preset routing rule and the access information;
[0013] A routing module is used to route the access request to the target application system according to the target routing address;
[0014] The target application system includes a target sub-application system in at least two corresponding sub-application systems after the application system is split.
[0015] In a third aspect, the present application further provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements some or all of the steps described in any method of the first aspect of the present application.
[0016] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements some or all of the steps described in any method of the first aspect of the present application.
[0017] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements part or all of the steps described in any method of the first aspect of the embodiment of the present application.
[0018] The access request processing method, device, computer equipment, storage medium and computer program product described above receive an access request and obtain access information in the access request; determine the target routing address of the access request according to the access information and the target routing rule, the target routing rule is determined based on the matching result between the preset routing rule and the access information; and route the access request to the target application system according to the target routing address; wherein the target application system includes a target sub-application system in at least two sub-application systems corresponding to the application system after the splitting. The access request processing method provided by the present application is provided with a preset routing rule, so that the target routing rule matching the access information in the preset routing rule can be determined according to the access information, so as to determine the target routing address of the access request based on the access information and the target routing rule, so as to route the access request to the target application system according to the target routing address, and further, even if the application system is split, the preset routing rule can be changed to adapt to the new routing rule, and different routing rules can be set according to different actual routing addresses. Therefore, the present embodiment can improve the routing accuracy and flexibility of the access request. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1An application environment diagram of an access request processing method in an embodiment;
[0020] Figure 2 A flowchart of a method for processing an access request is shown;
[0021] Figure 3 A flowchart of a method for processing an access request is shown;
[0022] Figure 4 A schematic diagram of a flow chart of an access request processing method in one embodiment;
[0023] Figure 5 A schematic diagram of a flow chart of an access request processing method in one embodiment;
[0024] Figure 6 A schematic diagram of a flow chart of an access request processing method in one embodiment;
[0025] Figure 7 A schematic diagram of a flow chart of an access request processing method in one embodiment;
[0026] Figure 8 A schematic diagram of a flow chart of an access request processing method in one embodiment;
[0027] Fig. 9 is a structural block diagram of an access request processing device in one embodiment;
[0028] Fig.10 is an internal structure diagram of a computer device in one embodiment;
[0029] Fig.11 FIG. 4 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0031] It should be noted that in the following description, the terms "first, second and third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first, second and third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
[0032] The access request processing method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown, the terminal 102 communicates with the server 104 through a network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers.
[0033] The terminal 102 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, an IoT device, and a portable wearable device. The IoT device may be a smart speaker, a smart TV, a smart air conditioner, and a smart vehicle-mounted device, etc. The portable wearable device may be a smart watch, a smart bracelet, a head-mounted device, etc.
[0034] The server 104 may be an independent physical server or a service node in a blockchain system. A peer-to-peer (P2P) network is formed between the service nodes in the blockchain system. The P2P protocol is an application layer protocol running on top of the Transmission Control Protocol (TCP).
[0035] In addition, server 104 can also be a server cluster composed of multiple physical servers, and can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), as well as big data and artificial intelligence platforms.
[0036] The terminal 102 and the server 104 may be connected via Bluetooth, USB (Universal Serial Bus) or a network or other communication connection methods, which are not limited in this application.
[0037] This application is made by the inventor based on the recognition and research of the following issues:
[0038] like Figure 2 As shown in the figure, this is the most basic access request routing method in the SCG cluster. It can be seen that at this time, one access domain name (such as www.aa.com) corresponds to one routing address (such as www.aa-x.com). Therefore, at this time, the number of routing rules required to be set is the same as the number of external access domain names of the application system, and there is a one-to-one correspondence between the routing address and the routing rule. Figure 3As shown, after the application system has released the grayscale function, it is necessary to split the application system into two sub-application systems, one sub-application system for grayscale function release, and the other sub-application system for formal function release. Therefore, the same request domain name needs to be set with grayscale routing rules and formal routing rules so that the access request of the same access domain name: www.order.com can be routed by the SCG cluster to the sub-application system gray-API for grayscale function release or the sub-application system ga-API for formal function release, where the grayscale routing address corresponding to the grayscale routing rule is www.gray.orde.com, and the formal routing address corresponding to the formal routing rule is www.ga.order.com.
[0039] Based on this, we can see that if an application system is not well planned in the early stage, or as the business grows, several problems will arise: 1. The application system becomes larger and larger, and becomes a large single unit with a huge space occupation. During each launch and iteration of the application system, there are historical traces of parallel development of multiple versions. Therefore, in the process of multi-person collaboration, it is easy to cause a series of major problems such as code merge conflicts, forgotten code merges, routing rule configurations not modified, forgotten to modify routing rules, or routing rule configuration modifications errors, which will lead to a sharp increase in the probability of production accidents; 2. As the application system becomes larger and larger, the application system bears more and more functions, which will lead to the concurrency of the application system. And stability drops sharply. If there are large-scale file operations in this application system, the memory of the application system JVM and the CPU of the virtual machine will be exhausted when performing large object operations, thereby blocking the remaining interfaces and causing the application system to be unable to provide services and hang up, and then, causing production accidents; 3. As the application system becomes larger and larger, more and more domain models will be mixed in. In the field of microservices, if the domain boundaries of the application system are not clear, it will cause problems such as disordered application system structure and unclear logic. As a result, developers will develop the application system arbitrarily due to difficulty in grasping the domain boundaries of the application system, and then, it will cause code logic confusion and unclear domains, resulting in major production accidents.
[0040] In order to avoid major production accidents when the scale of the application system is expanded, it is necessary to split the application system horizontally, vertically, grayscale functionally, or other system splitting methods, and expand the routing rules.
[0041] like Figure 4 As shown, illustratively, to facilitate understanding of the specific implementation ideas of the access request processing method provided in this embodiment, the following is a detailed description taking the application system split into four sub-application systems as an example.
[0042] Assume that the application system includes two functional modules, the first functional module and the second functional module. The domain name for accessing the application system is: www.order.com, the interface path corresponding to calling the first functional module of the application system is / aaa and the interface path corresponding to calling the second functional module of the application system is / ccc. Correspondingly, the external access path for accessing the first functional module is: www.order.com / aaa, and the external access path for accessing the second functional module is: www.order.com / ccc.
[0043] At this time, the application system is split into four sub-application systems according to needs, including: the sub-application system that performs grayscale function release on the first functional module as the first sub-application system, the sub-application system that performs formal function release on the first functional module as the second sub-application system, the sub-application system that performs grayscale function release on the second functional module as the third sub-application system, and the sub-application system that performs formal function release on the second functional module as the fourth sub-application system.
[0044] It should be noted that, based on the principle that the external access path of the application system (that is, the access domain name and interface path) cannot be modified or changed after release, before the application system was split, the external access path only included www.order.com / aaa and www.order.com / ccc, and based on the "one-to-one" routing access rules, such as accessing the first functional module of the application system through the external access path www.order.com / aaa, and accessing the second functional module of the application system through the external access path www.order.com / ccc, only based on the external access path and access rules before the application system was split, it cannot meet the access requirements of accessing the four sub-application systems separately after the application system is split into four sub-application systems.
[0045] Assume that the application system is split into 4 sub-application systems, the actual access path of the first sub-application system is www.gray.order.com / aaa, the actual access path of the second sub-application system is www.ga.order.com / aaa, the actual access path of the third sub-application system is www.gray.order.com / ccc, and the actual access path of the fourth sub-application system is www.ga.order.com / ccc. Based on the principle that the external access path of the application system (that is, the access domain name and interface path) cannot be modified or changed after being released, and in order to meet the access requirements of accessing the 4 sub-application systems separately after the application system is split into 4 sub-application systems, it can be understood that, that is, on the premise that the external access path only includes www.order.com / aaa and www.order.com / ccc, it is necessary to achieve the purpose of accurately accessing the 4 sub-application systems after the application system is split, and at the same time, the existing routing rules of the application system must be seamlessly connected to achieve no perception by external users and smooth upgrade of internal development.
[0046] Specifically, the following is a description of the specific solution ideas:
[0047] When the external access path is determined, the user identifier in the access information corresponding to the access request is used to determine whether the access request is accessing the sub-application system corresponding to the grayscale function release, such as the first sub-application system or the third sub-application system, or the sub-application system for the formal function release, such as the second sub-application system or the fourth sub-application system. Exemplarily, the external access path is www.order.com / aaa. If the user identifier in the access information matches the preset user identifier, the first sub-application system corresponding to the grayscale function release is accessed, and the actual access path is www.gray.order.com / aaa; if the user identifier in the access information does not match the preset user identifier, or if the user identifier does not exist in the access information, the second sub-application system corresponding to the formal function release is accessed, and the actual access path is www.ga.order.com / aaa.
[0048] Based on this, in order to achieve the purpose of accurate access to the first sub-application system based on the external access path www.order.com / aaa, the access request is routed according to the actual access path www.gray.order.com / aaa to access the first sub-application system, or, based on the same external access path www.order.com / aaa, the purpose of accurate access to the second sub-application system is achieved, the access request is routed according to the actual access path www.ga.order.com / aaa to access the second sub-application system. At this time, when the user identifier is used to determine whether the access request is accessing the sub-application system corresponding to the grayscale function release, or the sub-application system for the formal function release, the target routing address for routing the access request can be determined by rewriting the external access path.
[0049] Exemplarily, the external access path is www.order.com / aaa. If the user identifier in the access information matches the preset user identifier, www.order.com / aaa is rewritten as the actual access address www.gray.order.com / aaa, and the actual access address is determined as the target routing address. The access request is routed according to the actual access path www.gray.order.com / aaa to accurately access the first sub-application system; if the user identifier in the access information does not match the preset user identifier, or the user identifier does not exist in the access information, www.order.com / aaa is rewritten as the actual access address www.ga.order.com / aaa, and the actual access address is determined as the target routing address. The access request is routed according to the actual access path www.ga.order.com / aaa to accurately access the second sub-application system.
[0050] In addition, since accessing the third sub-application system or the fourth sub-application system based on the same external access path such as www.order.com / ccc is the same as accessing the first sub-application system or the second sub-application system based on the same external access path such as www.order.com / aaa, no specific description will be given here for accessing the third sub-application system or the fourth sub-application system through an external access path such as www.order.com / ccc.
[0051] It can be understood that in the above example, corresponding to the specific implementation process of the access request processing method provided in the present application, the external access path refers to the access path contained in the access information in the access request, and the access path and / or user identifier in the access information are used as routing forwarding conditions for matching preset routing rules to jointly determine the target sub-application system to be accessed. In essence, the access path is rewritten into the actual access path to determine the target routing address, and then the access request is routed according to the target routing address to accurately access the target sub-application system.
[0052] Optionally, rewriting the access path to the actual access path to determine the target routing address can be achieved by setting a filter. Exemplarily, the access request processing method provided in the present application is applied to an SCG cluster, and a filter can be set in the SCG cluster to achieve the purpose of rewriting the access path to the actual access path to determine the target routing address through the filter.
[0053] Optionally, the actual access address may be regarded as the actual routing address.
[0054] In one embodiment, Figure 5 As shown, a method for processing an access request is provided, which can be Figure 1 The method is performed by a server or a terminal in the embodiment, or by a server and a terminal in collaboration. Figure 1 The server execution in is taken as an example to illustrate, including the following steps:
[0055] Step 502: Receive an access request and obtain access information in the access request.
[0056] Among them, an access request refers to a message containing request information sent by a client (such as a browser, mobile application, etc.) to a server. For example, if you enter a URL in the browser address bar to access the web page corresponding to the URL, the browser will first send a request to the server corresponding to the URL. After receiving the request, the server returns a response message containing the web page content. The purpose of the access request can be that the client requests the server to access resources, submit data, trigger services or other operations.
[0057] Optionally, the access information may include an access path and / or a user ID. The access path refers to the path that the access request needs to go through to access the target application system, and the access path is usually represented by a URL; the user ID refers to an ID used to uniquely identify a user in the application system, and the user ID is represented by a string or a number. For example, if the access request is used to request access to www.xxx.com, then www.xxx.com is the access path of the access request.
[0058] Further optionally, the access path may include an access domain name and an interface path. For example, if the access request is to access www.order.com / aaa, then www.order.com is the access domain name of the access request, and / aaa is the interface path. For example, UserId in the access information represents a user identifier.
[0059] It is understandable that in an access request, the client will send a series of necessary access information to the server, including the request method, the requested URL (Uniform Resource Locator), the request header, and the request body. Among them, the request method is such as GET, POST, etc., the requested URL, that is, the target address, and the request header contains the interaction information between the client and the server, such as the user ID, the type of request, version, content type, etc., and the possible request body, such as the data to be sent to the server, such as form data. After receiving the request, the server will process it according to the content of the request and return the corresponding response message, including the response status code, response header, and response body. Based on the access request, the access information in the access request, such as the access path and / or user ID, can be directly obtained.
[0060] Optionally, the server used in the embodiment of the present application may be a Spring-Cloud-Gateway (SCG) cluster.
[0061] Step 504: determine the target routing address of the access request according to the access information and the target routing rule, wherein the target routing rule is determined based on a matching result between a preset routing rule and the access information.
[0062] Among them, the preset routing rules refer to a set of predefined routing rules for guiding the server's routing behavior for access requests. It is understandable that the number of routing rules set in the preset routing rules includes at least one. The preset routing rules determine to which target routing address the access request should be routed based on the access information in the access request, so that the access request can reach the target application system corresponding to the target routing address. By setting the preset routing rules, the server can flexibly route different access requests to the correct target routing address according to different business needs and traffic management strategies. The preset routing rules include a preset access path and a preset user identifier.
[0063] Specifically, the access information of the access request matches the target routing rule, indicating that the access request meets the matching condition of being routed to the target application system corresponding to the target routing address.
[0064] Specifically, the target routing rule is determined based on the matching result between the preset routing rule and the access information, which means that the preset routing rule will be pre-set based on the information that may be included in the access information. Exemplarily, the access information includes an access path and a user identifier. Then, at least one routing rule included in the preset routing rule can be set based on the combination of different access paths and different user identifiers. The corresponding relationship is set so that each group of access paths and user identifiers can correspond to one routing rule in the preset routing rules.
[0065] It should be noted that the target routing rules include but are not limited to gray routing rules and formal routing rules, and the preset routing rules may correspond to the routing forwarding conditions of the gray routing rules, or may correspond to the routing forwarding conditions of the formal routing rules, which is not limited in this embodiment. Among them, the routing forwarding conditions include a preset access path and / or a preset user identifier.
[0066] Exemplarily, assuming that the preset routing rule corresponds to the routing forwarding condition of the grayscale routing rule, the target routing rule is determined based on the matching result between the preset routing rule and the access information. Specifically, if there is a routing rule in the preset routing rule that matches the access information, that is, the access path in the access information is the same as the preset access path, and the user identifier in the access information is the same as the preset user identifier, the matching result is a match, and the target routing rule is determined according to the grayscale routing rule; if there is no routing rule in the preset routing rule that matches the access information, the matching result is a mismatch, and the target routing rule is determined according to the formal routing rule.
[0067] Among them, there is no routing rule matching the access information in the preset routing rules, which may be that the access path is different from the preset access path, or the access path is the same as the preset access path and the user identifier does not match the first preset user identifier, or the access path is the same as the preset access path and the access information does not contain the user identifier.
[0068] Optionally, determining the target routing address of the access request according to the access information and the target routing rule includes:
[0069] Determine an access modification rule according to the target routing rule, update the access information according to the access modification rule, and determine the target routing address of the access request according to the updated access information; and / or determine an access identifier according to the target routing rule, and determine the target routing address of the access request according to the access information and the access identifier.
[0070] It should be noted that the target routing address can be determined by updating the access information according to the access address update method determined by the target routing rule. Among them, the access information is such as the access path, and the access address update method determined by the target routing rule includes updating the access information based on the access modification rule, and / or determining the target routing address based on the access information and the access identifier. In this embodiment, the specific implementation method of updating the access information based on the access modification rule to determine the target routing address, and / or the specific implementation method of determining the target routing address based on the access information and the access identifier will be described in detail in the subsequent content, and will not be described in detail here.
[0071] Step 506, routing the access request to the target application system according to the target routing address;
[0072] The target application system includes a target sub-application system in at least two corresponding sub-application systems after the application system is split. Optionally, the target application system also includes an application system that has not been split into sub-application systems.
[0073] Optionally, the application system may be an application cluster, and the sub-application system may be a sub-application cluster. The sub-application cluster includes at least one service node. Each sub-application system split from the application system may be deployed on at least one service node to form a sub-application cluster. It is understandable that at least two corresponding sub-application systems after the application system is split include a target sub-application system, that is, a target sub-application cluster.
[0074] When the target routing address is determined, the access request is routed and forwarded to the target routing address to access the target application system.
[0075] It should be noted that at least two sub-application systems can be obtained by horizontal splitting, vertical splitting, gray-scale functional splitting or other system splitting methods. Horizontal splitting refers to splitting the data set of the application system into at least two sub-application systems according to a certain data rule, and each sub-application system is responsible for a group of related data. For example, the application system includes two groups of data, user data of area 1 and user data of area 2. After the application system is horizontally split, one sub-application system is responsible for the user data of area 1, and the other sub-application system is responsible for the user data of area 2. Vertical splitting refers to further refining and splitting the business module or functional module of the application system into at least two sub-application systems, and each sub-application system is responsible for a group of related functions. For example, the application system includes two groups of functions, user management and order management. After the application system is vertically split, one sub-application system is responsible for the user management function, and the other sub-application system is responsible for the order management function. Grayscale function splitting refers to splitting the grayscale functions and formal functions of the application system into at least two sub-application systems, so that one sub-application system is used for grayscale function release, and one sub-application system is used for non-grayscale function release, that is, formal function release.
[0076] In the actual application process, the application system is split into at least two sub-application systems. The application system can be split into at least two sub-application systems according to business modules or functional modules, wherein at least two sub-application systems are sub-application systems corresponding to the official function release; or the application system can be split into at least one sub-application system corresponding to the official function release, and at least one sub-application system corresponding to the grayscale function release, and there is no limitation on this.
[0077] Optionally, the application system is split into at least one sub-application system corresponding to a formal function release and at least one sub-application system corresponding to a grayscale function release. There may or may not be a sub-application system combination pair with the same functional modules between the at least one sub-application system corresponding to the formal function release and the at least one sub-application system corresponding to the grayscale function release. The sub-application system combination pair with the same functional modules refers to the functional modules corresponding to the sub-application system corresponding to the formal function release being the same as the functional modules corresponding to the sub-application system corresponding to the grayscale function release.
[0078] Exemplarily, assume that the application system includes three functional modules, where the domain name for accessing the application system is: www.order.com, and the interface paths corresponding to calling the three functional modules of the application system are / aaa, / bbb and / ccc respectively. At this time, optionally, in an actual application scenario, the application system is split into at least two sub-application systems, and the two functional modules corresponding to the interface paths / aaa and / bbb are divided into a first sub-application system, and the functional module corresponding to the interface path / ccc is divided into a second sub-application system. In this application scenario, the first sub-application system and the second sub-application system are both sub-application systems corresponding to the formal function release.
[0079] Optionally, in an actual application scenario, the application system is split into at least two sub-application systems, which can be split into a first sub-application system for formal function release and a second sub-application system for grayscale function release, and then the second sub-application system for formal function release is added. In this application scenario, the second sub-application system for grayscale function release and the second sub-application system for formal function release can be regarded as a sub-application system combination pair with the same functional modules, and the first sub-application system for formal function release can be regarded as a case where there is no sub-application system combination pair.
[0080] Optionally, in an actual application scenario, the application system is split into at least two sub-application systems, which may be splitting the application system into a first sub-application system for grayscale function release and a first sub-application system for formal function release.
[0081] As an optional implementation, the access request processing method provided by the present application further includes:
[0082] When receiving an instruction to add a routing rule, adding the routing rule to the preset routing rule to update the preset routing rule;
[0083] The routing rule corresponding to the adding instruction is determined according to the application system being split into at least two sub-application systems.
[0084] In this embodiment, when an instruction to add a routing rule is received, the routing rule is added to the preset routing rule to update the preset routing rule. Thus, in some application scenarios, assuming that the preset routing rule corresponds to a routing forwarding condition with a grayscale routing rule, and the application system splits out a sub-application system for grayscale function release, then at this time, it is only necessary to add a routing rule of the sub-application system corresponding to the grayscale function release to the preset routing rule, without the need to make large-scale routing rule modifications to the entire preset routing rule. It can be seen that in this embodiment, when a new sub-application system for grayscale function release or a new sub-application system for formal function release is introduced, it is only necessary to add an additive update to the routing rule of the new sub-application system in the preset routing rule, without the need to redefine all routing rules. Obviously, this embodiment significantly improves the flexibility and adaptability of the preset routing rule in the face of system splitting.
[0085] Optionally, the preset routing rules are updated and the updated preset routing rules can be reloaded from Redis based on the SCG cluster dynamic refresh mechanism.
[0086] In the access request processing method described above, an access request is received, and access information in the access request is obtained; a target routing address of the access request is determined according to the access information and a target routing rule in a preset routing rule that matches the access information; and the access request is routed to the target application system according to the target routing address; wherein the target application system includes a target sub-application system in at least two sub-application systems corresponding to the application system after the splitting. The access request processing method provided by the present application is provided with a preset routing rule, so that the target routing rule in the preset routing rule that matches the access information can be determined according to the access information, so as to determine the target routing address of the access request based on the access information and the target routing rule, so as to route the access request to the target application system according to the target routing address. Furthermore, even if the application system is split, the preset routing rule can be changed to adapt to the new routing rule, and different routing rules can be set according to different actual routing addresses. Therefore, this embodiment can improve the routing accuracy and flexibility of the access request.
[0087] In an exemplary embodiment, determining the target routing address of the access request according to the access information and the target routing rule in the preset routing rules that matches the access request includes:
[0088] Determining an access modification rule according to the target routing rule, updating access information according to the access modification rule, and determining a target routing address of the access request according to the updated access information; and / or,
[0089] The access identifier is determined according to a target routing rule in a preset routing rule that matches the access information, and the target routing address of the access request is determined according to the access information and the access identifier.
[0090] It should be noted that the target routing rules include but are not limited to grayscale routing rules and formal routing rules. At least two target routing rules can be set. Different target routing rules have different access modification rules or access identifiers, and the final target routing addresses are also different. Therefore, when the external access path is determined and cannot be changed or the number is limited, the need to access at least two actual access paths based on the same external access path can be met.
[0091] As an optional implementation, a method for determining the target routing address of the access request is: determining the access modification rule according to the target routing rule, updating the access information according to the access modification rule, and determining the target routing address of the access request according to the updated access information.
[0092] In this embodiment, when the external access path is determined and cannot be changed or is limited in number, in order to meet the requirement of accessing at least two actual access paths separately based on the same external access path, this is achieved by rewriting and updating the access path in the access request (i.e., the external access path).
[0093] Access modification rules refer to the requirements for the update method or update operation of access information. Access modification rules are used to modify or rewrite access information, and the updated access information is obtained by modifying or rewriting the access information. The target routing address of the access request is then determined based on the updated access information, so that the access request can be routed to the target routing address to correctly access the target application system.
[0094] It should be noted that the access modification rule can be set to add an access identifier to the access path in the access information, wherein the access identifier is a unique identifier based on the same access path and used to distinguish at least two actual access paths. The access identifier includes a grayscale access identifier and a formal access identifier. Optionally, the access modification rule also includes a preset update identifier, wherein the preset update identifier can be pre-set to locate the addition position of the access identifier in the access path, wherein the addition position can be regarded as an update identifier. Optionally, the access identifier and the preset update identifier can both be expressed in the form of a string.
[0095] Since the target routing rules include grayscale routing rules and formal routing rules, in this embodiment, the access modification rules are determined according to the target routing rules, and the correspondence between the target routing rules and the access modification rules can be set in advance. For example, when the target routing rules are grayscale routing rules, the access modification rules can be set to add a grayscale access identifier to the access path. When the target routing rules are formal routing rules, the access modification rules can be set to add a formal access identifier to the access path.
[0096] Optionally, adding an access identifier to the access path may be performed by determining an update identifier in the access path that matches a preset update identifier, adding the access identifier to the update identifier, and determining a target routing address of the access request according to the updated access path. Exemplarily, assuming that the access request meets the routing forwarding conditions corresponding to the grayscale routing rules, the access path is www.order.com / aaa, the target routing address actually accessed is www.gray.order.com / aaa, and the access modification rule is to add a grayscale access identifier to the access path, the grayscale access identifier is gray, and the preset update identifiers are www and order. Determine the update identifier bit in the access path (www.order.com / aaa) that matches the preset update identifier (www and order), that is, the position between www and order, add the grayscale access identifier to the update identifier bit, and obtain the updated access path, that is, www.gray.order.com / aaa. At this time, the target routing address is www.gray.order.com / aaa. Based on this, www.order.com / aaa is rewritten and updated to the actual routing address www.gray.order.com / aaa.
[0097] For another example, assuming that the access request meets the routing forwarding conditions corresponding to the formal routing rules, the access path is www.order.com / aaa, and the actual access target routing address is www.order.ga.com / aaa. The access modification rule is to add a formal access identifier to the access path, the formal access identifier is ga, and the preset update identifiers are order and com. Determine the update identifier position in the access path (www.order.com / aaa) that matches the preset update identifier (order and com), that is, the position between order and com, add the formal access identifier to the update identifier position, and obtain the updated access path, that is, www.order.ga.com / aaa. At this time, the target routing address is www.order.ga.com / aaa. Based on this, www.order.com / aaa is rewritten and updated to the actual routing address www.order.ga.com / aaa.
[0098] Specifically, the access request processing method provided by the present embodiment, when applied in the SCG cluster, can determine the target routing address of the access request based on the access information and the target routing rule that matches the access information in the preset routing rule, so as to route the access request to the target application system according to the target routing address. Therefore, the access request processing method provided by the present embodiment, because it can rewrite and update the access path in the access information, overcomes the technical defect that the existing SCG cluster can only implement one-to-one routing for access requests based on the one-to-one correspondence between the access path and the application cluster. At the same time, since the external access domain name and interface path of the application system cannot be modified and changed once released, after the application system is split into at least two sub-application systems, there is no need to modify and change the external access domain name and interface path to achieve routing of the same external access path to different routing addresses. Therefore, targeted and flexible routing based on the access path is achieved without the client's awareness, and compatibility with routing rules for upgrades and modifications of the application system can be achieved without destroying the native rules of the SCG cluster.
[0099] As an optional implementation, another way to determine the target routing address of the access request is to determine the access identifier according to the target routing rule, and determine the target routing address of the access request according to the access information and the access identifier.
[0100] An access identifier refers to an access identifier that is a unique identifier used to distinguish at least two actual access paths based on the same access path, so that the access request can be routed to the target routing address to accurately access the target application system.
[0101] It should be noted that the association relationship between the target routing rule and the access identifier can be preset. For example, when the target routing rule is a gray routing rule, the gray access identifier can be set to gray, and when the target routing rule is a formal routing rule, the formal access identifier can be set to ga. Based on the association relationship between the target routing rule and the access identifier, the access identifier corresponding to the target routing rule is obtained.
[0102] The target routing address of the access request is determined according to the access information and the access identifier. The mapping relationship between the access path, the access identifier and the target routing address in the access information can be preset. For example, when the access path is www.order.com / aaa and the grayscale access identifier is gray, the target routing address is www.gray.order.com / aaa; when the access path is www.order.com / aaa and the access identifier is ga, the target routing address is www.ga.order.com / aaa. Based on the mapping relationship between the access path, the access identifier and the target routing address, the target routing address corresponding to the access path and the access identifier is obtained.
[0103] Optionally, in the case of a large number of access requests, two methods of determining the access modification rule according to the target routing rule and determining the access identifier according to the target routing rule can be simultaneously adopted, which can improve the flexibility of the access request routing by realizing the selectivity of the method of determining the target routing address, and ultimately improve the routing efficiency of the access request. Thus, in an exemplary embodiment, the above-mentioned determination of the target routing address of the access request according to the access information and the target routing rule includes: when the total number of access requests is greater than or equal to the preset number threshold, for the access requests corresponding to the first preset number, determining the corresponding access modification rule according to the target routing rule matching the access information in the preset routing rule, updating the access information according to the access modification rule, and determining the target routing address of the access request according to the updated access information; for the access requests of the second preset number, determining the access identifier according to the target routing rule matching the access information in the preset routing rule, and determining the target routing address of the access request according to the access information and the access identifier. Wherein, the number of access requests is equal to the sum of the first preset number and the second preset number.
[0104] Optionally, different methods for determining the target routing address of the access request can be adopted according to different routing policies. Thus, in an exemplary embodiment, the routing policy includes an accuracy priority policy or an efficiency priority policy. The above-mentioned determination of the target routing address of the access request according to the access information and the target routing rule includes: when the routing policy is an accuracy priority policy, determining the access modification rule according to the target routing rule, updating the access information according to the access modification rule, and determining the target routing address of the access request according to the updated access information. Since the target routing rule contains more detailed information than the access identifier and corresponds to the latest user data, it is possible to ensure that the routing of the access request has a higher accuracy. When the routing policy is an efficiency priority policy, determining the access identifier according to the target routing rule, and determining the target routing address of the access request according to the access information and the access identifier. Since the target routing address is quickly matched by identifying the key access identifier, the calculation and processing time required for the server to make conditional decisions during the access request routing process can be reduced. Thus, it is possible to ensure that the routing of the access request has a higher efficiency.
[0105] In this embodiment, the determination of the target routing address can be finally determined by determining the corresponding access modification rule through the target routing rule that matches the access information in the preset routing rule, or can be finally determined by determining the access identifier through the target routing rule that matches the access information in the preset routing rule, thereby improving the routing accuracy and flexibility of the access request; at the same time, since the access modification rule or the access identifier can be determined based on the target routing rule, so as to further finally determine the target routing address that the access request actually needs to reach based on the access modification rule or the access identifier, this embodiment can meet the needs of accessing at least two actual access paths separately based on the same external access path in some application scenarios, so that the application system can have high scalability without affecting the client's perception.
[0106] In an exemplary embodiment, the access information includes an access path and / or a user identifier, the preset routing rule includes a first preset access path and a first preset user identifier, and the access modification rule is determined according to the target routing rule. The method includes:
[0107] When the access path is the same as the first preset access path and the user identifier matches the first preset user identifier, determining a corresponding access modification rule according to the first grayscale routing rule;
[0108] When the access path is different from the first preset access path, or the access path is the same as the first preset access path and the user identifier does not match the first preset user identifier, or the access path is the same as the first preset access path and the access information does not contain the user identifier, the corresponding access modification rule is determined according to the first formal routing rule.
[0109] Among them, the first preset access path and the first preset user identifier included in the preset routing rule are preset routing rules or routing forwarding conditions. The first preset user identifier can be set as needed. Different user identifiers indicate that the users who initiate the access request are different. It can be understood that in the case of a sub-application system with grayscale function release after the application system is split, the number of preset user identifiers is at least one. Conversely, in the case of a sub-application system without grayscale function release after the application system is split, there may be no preset user identifier. Exemplarily, the preset user identifier can be UserId=2, UserId=3, UserId=9, etc., and the preset user identifier can also be UserId with other values, wherein the preset user identifier includes the first preset user identifier. The preset access path includes the first preset access path.
[0110] In this embodiment, the grayscale routing rule may be selected as the first grayscale routing rule, and the formal routing rule may be selected as the first formal routing rule. When the access path is the same as the first preset access path, and the user identifier matches the first preset user identifier, the routing forwarding condition of the grayscale routing rule is satisfied, indicating that the access request is to access the sub-application system or sub-application cluster corresponding to the grayscale function release after the application system is split. The corresponding access modification rule is determined according to the first grayscale routing, that is, the access modification rule corresponding to the first grayscale routing access is obtained, and the grayscale access identifier is added to the access path. At this time, the access path is updated according to the access modification rule, and the updated access path is determined as the target routing address of the access request.
[0111] Exemplarily, assuming that the access path in the access request is www.order.com / aaa, the user identifier is 2, the preset access path includes www.order.com / aaa, and the preset user identifier includes 2. At this time, the routing forwarding conditions of the grayscale routing rule are met, and a grayscale access identifier such as gray is added to the access path based on the access modification rule, that is, the access path "www.order.com / aaa" is modified and updated to "www.gray.order.com / aaa", and the target routing address of the access request is determined according to the updated access path, that is, the target routing address is: www.gray.order.com / aaa.
[0112] When the access path is the same as the first preset access path and the user identifier does not match the first preset user identifier, or the access path is the same as the first preset access path and the access information does not contain the user identifier, the routing forwarding conditions of the formal routing rules are met, indicating that the access request is to access the sub-application system or sub-application cluster corresponding to the formal function release after the application system is split. The corresponding access modification rule is determined according to the first formal route, the access modification rule corresponding to the first formal routing rule is obtained, and the formal access identifier is added to the access path. At this time, the access path is updated according to the access modification rule, and the updated access path is determined as the target routing address of the access request.
[0113] Exemplarily, assuming that the access path in the access request is www.order.com / aaa, the user identifier is 8, the preset access path includes www.order.com / aaa, and the preset user identifier does not include 8. At this time, the routing forwarding conditions of the formal routing rules are met, and based on the access modification rules, a formal access identifier such as ga is added to the access path, that is, the access path "www.order.com / aaa" is modified and updated to "www.ga.order.com / aaa", and the target routing address of the access request is determined according to the updated access path, that is, the target routing address is: www.ga.order.com / aaa.
[0114] In this embodiment, in order to be compatible with the original "one-to-one" routing access rules to be compatible, the routing access rules to be compatible that have been stored in the history are compatible and adapted to the scenario of access to the application system that has not undergone system splitting. One implementation method may be to adapt the routing access rules to be compatible to the first formal routing rule adjustment. For example, assuming that the external access path of the application system that has not undergone system splitting is: www.order.com / ddd, after adapting to the first formal routing rule adjustment, it is necessary to modify and update the external access path to determine the corresponding target routing address, that is, the actual access address is: www.ga.order.com / ddd, so as to achieve the purpose of being compatible with the "one-to-one" routing access rules to be compatible; another implementation method is: if the original "one-to-one" routing access rules to be compatible have a "one-to-one" routing mapping relationship between the external access path and the actual access path, wherein the routing mapping relationship can be obtained through routing The table records the association between each external access path and the actual access path, such as the routing mapping relationship between www.order.com / ddd and www.ga.order.com / ddd, which can be directly adapted to the routing rules to be compatible. Based on the routing rules to be compatible, the first formal routing rule is generated. By way of example, assuming that the external access path of the application system that has not been split is: www.order.com / ddd, based on the first formal routing rule, the external access path is modified and updated to determine the corresponding target routing address, that is, the actual access address is: www.ga.order.com / ddd, so as to achieve the purpose of compatibility with the "one-to-one" routing access rules to be compatible.
[0115] It can be understood that the first formal routing rule is different from the routing rule to be compatible. The routing rule to be compatible directly sets a "one-to-one" routing mapping relationship between the external access path and the actual access path. When the external access path is known, the actual access path corresponding to the external access path is directly obtained. When the first formal routing rule determines the actual access path, it is necessary to rewrite and update the external access path.
[0116] When the access path is different from the first preset access path, the routing forwarding condition corresponding to the formal routing rule is met, indicating that the access request is for accessing an application system that has not been split into systems. The corresponding access modification rule is determined according to the first formal routing rule, and the access modification rule corresponding to the first formal routing rule is obtained. A formal access identifier is added to the access path. At this time, the access path is updated according to the access modification rule, and the updated access path is determined as the target routing address of the access request.
[0117] Exemplarily, assuming that the access path in the access request is www.order.com / ddd, and the preset access path does not include www.order.com / ddd, at this time, the routing forwarding conditions of the formal routing rules are met, and based on the access modification rules, a formal access identifier such as ga is added to the access path, that is, the access path "www.order.com / ddd" is modified and updated to "www.ga.order.com / ddd", and the target routing address of the access request is determined according to the updated access path, that is, the target routing address is: www.ga.order.com / ddd.
[0118] In this embodiment, it is only necessary to clarify the matching result between the access information in the access request and the routing forwarding condition of the preset routing rule to determine whether the target routing rule is a formal routing rule or a gray routing rule. In essence, it is only necessary to perform a routing rule matching operation between the access information and the preset routing rule once. Compared with at least two routing rule matching operations, the maintenance cost is lower, the response speed is faster, and the application system complexity is lower. Among them, at least two routing rule matching operations refer to determining a first matching result between the access information and the first routing rule, and then determining a second matching result based on the first matching result and the second routing rule, wherein the preset routing rule is different from the first routing rule and the second routing rule, respectively.
[0119] As an optional implementation, in this embodiment, two routers, a first router and a second router, can be set, and a preset routing rule can be set on one of the two routers (such as the first router), wherein the preset routing rule can correspond to the routing forwarding condition of the gray routing rule (such as the first gray routing rule), and can also correspond to the routing forwarding condition of the formal routing rule (such as the first formal routing rule), which is not limited in this embodiment.
[0120] Exemplarily, the server applied in this embodiment takes the Spring-Cloud-Gateway (SCG) cluster as an example to illustrate the process of determining the access modification rule according to the first grayscale routing rule or the first formal routing rule. It is assumed that the SCG cluster is provided with two routers, and the preset routing rule is selected to be set on the first router. The preset routing rule corresponds to the routing forwarding condition of the first grayscale routing rule.
[0121] like Figure 6As shown, the preset access path set in the preset routing rule includes www.order.com / aaa, and the preset user identifier includes 2. Assuming that the access path in the access request is www.order.com / aaa, and the user identifier is 2, it indicates that the routing forwarding condition of the gray routing rule is met, and the access request is routed and forwarded through the first router. The corresponding access modification rule can be determined based on the first router according to the first gray routing rule. At this time, according to the access modification rule corresponding to the first formal routing rule, the access path "www.order.com / aaa" is modified and updated to "www.gray.order.com / aaa", and the target routing address of the access request is determined according to the updated access path, that is, the target routing address The address is: www.gray.order.com / aaa; assuming that the access path in the access request is www.order.com / aaa, when there is no user identifier, it indicates that the routing forwarding conditions of the formal routing rule are met, and the access request is routed and forwarded through the second router. The corresponding access modification rule can be determined based on the second router according to the first formal routing rule. At this time, according to the access modification rule corresponding to the first formal routing rule, the access path "www.order.com / aaa" is modified and updated to "www.ga.order.com / aaa", and the target routing address of the access request is determined according to the updated access path, that is, the target routing address is: www.ga.order.com / aaa.
[0122] It can be understood that the SCG is provided with two routers. When starting operation, the SCG cluster loads the two routers and the routing related information of the preset routing rules, and then based on the SCG cluster loaded with the routing related information, implements the step of determining the corresponding access modification rule according to the target routing rule matching the access information in the preset routing rules in this embodiment.
[0123] In this embodiment, by setting a preset routing rule on one of the two routers (such as the first router), all routing rules in the preset routing rules (including gray routing rules and formal routing rules) are centrally managed on one router, which can simplify the configuration method of the routing rules. Furthermore, when the preset routing rules need to be changed in some application scenarios, the implementation difficulty will be greatly reduced.
[0124] As an optional implementation, in this embodiment, two routers can be set, a first router and a second router, and routing rules can be pre-set in the first router and the second router respectively, such as setting the routing forwarding conditions of the grayscale routing rule (such as the first grayscale routing rule) in the first router, and setting the routing forwarding conditions of the formal routing rule (such as the first formal routing rule) in the second router.
[0125] like Figure 6 As shown, assuming that the preset access path set in the routing forwarding condition of the grayscale routing rule includes www.order.com / aaa, the preset user identifier includes 2 and does not include 8, and when the access path in the access request is www.order.com / aaa and the user identifier is 2, it indicates that the routing forwarding condition of the grayscale routing rule is met, and the access request is routed and forwarded through the first router. The corresponding access modification rule can be determined based on the first router according to the first grayscale routing rule; assuming that the preset access path set in the routing forwarding condition of the formal routing rule includes www.order.com / aaa, the preset user identifier includes 8, and when the access path in the access request is www.order.com / aaa and the user identifier is 8, it indicates that the routing forwarding condition of the formal routing rule is met, and the access request is routed and forwarded through the second router. The corresponding access modification rule can be determined based on the second router according to the first formal routing rule.
[0126] In this embodiment, the grayscale routing rules and the formal routing rules are respectively set on different routers, that is, the two routers are respectively dedicated to one type of access request routing, thereby being able to more effectively isolate access requests for the grayscale routing rules and access requests for the formal routing rules, and being able to improve the matching efficiency of routing rules to improve the routing efficiency of access requests. Furthermore, since different types of routing rules are set on different routers, when one of the routers fails, the access requests can continue to be routed based on another router, thereby improving the stability of the application system.
[0127] Specifically, it can be seen from the above exemplary embodiments that the present embodiment is applicable to application scenarios in which an application system is split into at least two sub-application systems, wherein at least two sub-application systems may both be sub-application systems or sub-application clusters corresponding to a formal function release; or the application system may be split into at least one sub-application system or sub-application cluster corresponding to a formal function release, and at least one sub-application system or sub-application cluster corresponding to a grayscale function release.
[0128] As an optional implementation, in some practical application scenarios, two routers may be set when the number of external access paths is less than or equal to a preset threshold, so as to route and forward access requests through the two routers. Thus, in a simple scenario with a small number of external access paths or a small number of routing rules, only two routers may be set to route access requests, so as to simplify the configuration of routing rules. At the same time, it can also avoid the problem of high costs caused by setting too many routers, saving the deployment cost of routers.
[0129] In this embodiment, the preset routing rules include a first preset access path and a first preset user identifier, so that the access modification rules are determined based on the access path and / or the user identifier, and different access modification rules can be determined according to different routing rules in different application scenarios. The access information is updated based on different access modification rules to determine the target routing address corresponding to the access request. The matching mechanism of the first preset access path enables the access request to be correctly routed to the corresponding sub-application system. At the same time, since the matching mechanism of the first preset user identifier is set, the access request of the same external access path can be correctly routed to the target sub-application system for grayscale function release or formal function release. Obviously, this embodiment can meet the needs of accessing at least two actual access paths separately based on the same external access path, and thus, can improve the routing accuracy and flexibility of the access request.
[0130] In addition, in this embodiment, since the access modification rules are determined based on the access path and / or user identification, this embodiment can flexibly adapt to various routing forwarding scenarios. The flexibility based on the target routing address can not only meet the needs of routing forwarding scenarios in which the application system is split into at least two sub-application systems, but also meet the needs of routing forwarding scenarios in which the application is not split.
[0131] In an exemplary embodiment, the access information includes an access path and / or a user identifier, the preset routing rule includes a second preset access path and a second preset user identifier, and the access modification rule is determined according to the target routing rule. The method includes:
[0132] When the access path is the same as the second preset access path and the user identifier matches the second preset user identifier, determining a corresponding access modification rule according to the second grayscale routing rule;
[0133] When the access path is the same as the second preset access path and the user identifier does not match the second preset user identifier, or the access information does not include the user identifier, determining a corresponding access modification rule according to the second formal routing rule;
[0134] When the access path is different from the second preset access path, a corresponding access modification rule is determined according to the closing routing rule.
[0135] The second preset access path and the second preset user identifier included in the preset routing rule are preset routing rules or routing forwarding conditions. The second preset user identifier can be set as needed. Different user identifiers indicate that different users initiate access requests. The preset user identifier includes the second preset user identifier. The preset access path includes the second preset access path.
[0136] In this embodiment, the grayscale routing rule may be selected as the second grayscale routing rule, and the formal routing rule may be selected as the second formal routing rule. When the access path is the same as the second preset access path, and the user identifier matches the second preset user identifier, the routing forwarding condition of the grayscale routing rule is satisfied, indicating that the access request is to access the sub-application system or sub-application cluster corresponding to the grayscale function release after the application system is split. The corresponding access modification rule is determined according to the second grayscale routing, that is, the access modification rule corresponding to the second grayscale routing access is obtained, and the grayscale access identifier is added to the access path. At this time, the access path is updated according to the access modification rule, and the updated access path is determined as the target routing address of the access request.
[0137] When the access path is the same as the second preset access path and the user identifier does not match the second preset user identifier, or the access path is the same as the second preset access path and the access information does not contain the user identifier, the routing forwarding conditions of the formal routing rules are met, indicating that the access request is to access the sub-application system or sub-application cluster corresponding to the formal function release after the application system is split. The corresponding access modification rule is determined according to the second formal route, the access modification rule corresponding to the second formal routing rule is obtained, and the formal access identifier is added to the access path. At this time, the access path is updated according to the access modification rule, and the updated access path is determined as the target routing address of the access request.
[0138] In this embodiment, due to the existence of the closed routing rule, it is compatible with the original "one-to-one" routing access rules to be compatible, and compatible with the historically stored routing access rules to be compatible, and is suitable for the scenario of accessing the application system that has not been split. Specifically, exemplarily, assuming that the external access path of the application system that has not been split is: www.order.com / ddd, and the external access path does not match the second preset routing rule, then the corresponding access modification rule is determined according to the closed routing rule, that is, the actual access address is: www.ga.order.com / ddd, so as to achieve the purpose of being compatible with the "one-to-one" routing access rules to be compatible.
[0139] When the access path is different from the second preset access path, it indicates that the access request is for accessing the application system that has not been split. The corresponding access modification rule is determined according to the closing routing rule, and the access modification rule corresponding to the closing routing rule is obtained to access the access modification rule. A closing access identifier is added to the access path. The closing access identifier can be the same as the formal access identifier, which is ga. At this time, the access path is updated according to the access modification rule, and the updated access path is determined as the target routing address of the access request.
[0140] Exemplarily, assuming that the access path in the access request is www.order.com / ddd, and the second preset access path does not include www.order.com / ddd, at this time, the routing forwarding conditions of the closing routing rule are met, and based on the access modification rule, a formal access identifier such as ga is added to the access path, that is, the access path "www.order.com / ddd" is modified and updated to "www.ga.order.com / ddd", and the target routing address of the access request is determined according to the updated access path, that is, the target routing address is: www.ga.order.com / ddd.
[0141] The closing routing rule is used to determine the access modification rule for the access information when the access path is different from the second preset access path. Optionally, when the access path is different from the second preset access path, the access modification rule corresponding to the closing routing rule may be to keep the original destination of the access request unchanged, thereby routing the access request to the target application system corresponding to the access information based on the access path in the access information, that is, the access request is routed to the target application system to which the access request wishes to access.
[0142] Optionally, the second grayscale routing rule and the second formal routing rule can correspond to the two sub-application systems after the application system is split. Specifically, the second grayscale routing rule corresponds to the sub-application system with grayscale function release, and the second formal routing rule corresponds to the sub-application system with formal function release. The closed routing rule corresponds to the application system that has not been split. Optionally, there can be at least two application systems that have not been split. That is to say, in this application scenario, the number of external access paths can be relatively large.
[0143] Optionally, the routing forwarding conditions that comply with the second grayscale routing rule can be forwarded by the third router, the routing forwarding conditions that comply with the second formal routing rule can be forwarded by the fourth router, and the routing forwarding conditions that comply with the closed routing rule can be forwarded by the fifth router. Thus, in an exemplary embodiment, the above-mentioned determination of the corresponding access modification rule according to the second grayscale routing rule includes: determining the corresponding access modification rule according to the second grayscale routing rule based on the third router; the above-mentioned determination of the corresponding access modification rule according to the second formal routing rule includes: determining the corresponding access modification rule according to the second formal routing rule based on the fourth router; the above-mentioned determination of the corresponding access modification rule according to the closed routing rule includes: determining the corresponding access modification rule according to the closed routing rule based on the fifth router.
[0144] Optionally, a preset routing rule can be set on one of the three routers (such as the third router), wherein the preset routing rule can correspond to the routing forwarding condition of the grayscale routing rule (such as the second grayscale routing rule), or can correspond to the routing forwarding condition of the formal routing rule (such as the second formal routing rule), which is not limited in this embodiment.
[0145] For example, Figure 7 As shown, the access request processing method provided in this embodiment is applied to the SCG cluster. It is assumed that there are three application systems, one application system is split into a sub-application system 3 for grayscale function release and a sub-application system 4 for formal function release, that is, a total of two sub-application systems, and one application system 5 is not system split, wherein the external access path of the application system after system splitting is: www.order.com / aaa; the SCG cluster is configured with a third router, a fourth router and a fifth router, the sub-application system 3 corresponds to the third router and the second grayscale routing rule, the sub-application system 4 corresponds to the fourth router and the second formal routing rule, and the application system 5 corresponds to the fifth router and the closing routing rule. It is assumed that the preset routing rule includes the routing forwarding condition of the second grayscale routing rule that the second preset access path is www.order.com / aaa and the second preset user identifier is UserId=2;
[0146] When the access path in the access request is www.order.com / aaa, determine whether the user identifier in the access request is UserId=2. If so, determine the corresponding access modification rule based on the third router according to the second grayscale routing rule. The filter modifies the access path www.order.com / aaa to www.gray.new.order.com / aaa based on the access modification rule corresponding to the second grayscale routing rule to obtain new access information. Thus, determine the target routing address of the access request according to the updated access information, and route the access request to the sub-application system 3 according to the target routing address.
[0147] If the access path in the access request is www.order.com / aaa, and the user identifier UserId in the access request is ≠2 or the user identifier does not exist in the access request, then the fourth router determines the corresponding access modification rule according to the second formal routing rule, and the filter modifies the access path www.order.com / aaa to www.ga.new.order.com / aaa based on the access modification rule corresponding to the second formal routing rule to obtain new access information, thereby determining the target routing address of the access request according to the updated access information, and routing the access request to the sub-application system 4 according to the target routing address;
[0148] If the access path in the access request is www.aaaa.com, www.xxx.com or others, and the access path does not match the second preset access path, the fifth router determines the corresponding access modification rule based on the closing routing rule, and the filter modifies www.aaaa.com to www.ga.aaaa.com, and modifies www.xxx.com to www.ga.xxx.com... based on the access modification rule corresponding to the closing routing rule to obtain new access information, thereby determining the target routing address of the access request according to the updated access information, and routing the access request to the application system 5 according to the target routing address.
[0149] It can be understood that the SCG is provided with three routers. When starting operation, the SCG cluster loads the routing-related information of the three routers and the preset routing rules, and then based on the SCG cluster loaded with the routing-related information, implements the step of determining the corresponding access modification rule according to the target routing rule matching the access information in the preset routing rules in this embodiment.
[0150] Optionally, in one embodiment, the routing forwarding conditions of the second grayscale routing rule, the routing forwarding conditions of the second formal routing rule, and the routing forwarding conditions of the closing routing rule can be set in the third router, the fourth router, and the fifth router, respectively. The specific implementation is the same as the embodiment of setting two routers in the above example, and is not described in detail here.
[0151] In this embodiment, the preset routing rules include a second preset access path and a second preset user identifier, so that the access modification rule is determined based on the access path and / or the user identifier, and different access modification rules can be determined according to different routing rules in different application scenarios. The access information is updated based on different access modification rules to determine the target routing address corresponding to the access request. The matching mechanism of the second preset access path enables the access request to be correctly routed to the sub-application system corresponding to the second preset routing rule. At the same time, since the matching mechanism of the second preset user identifier is set, the access request can be correctly routed to the sub-application system for grayscale function release or the sub-application system for formal function release corresponding to the second preset routing rule. When the access path is different from the second preset access path, the corresponding access modification rule is determined according to the closing routing rule. Obviously, this embodiment can meet the demand of accessing at least two actual access paths separately based on the same external access path. Furthermore, regardless of whether the access path can match the second preset access path, the access request can be correctly routed to the corresponding sub-application system, which can significantly improve the routing accuracy and flexibility of the access request.
[0152] It can be seen that this embodiment routes and forwards access requests by setting three routers, which is suitable for scenarios with a large number of external access paths and a large number of routing rules. Among them, one router is compatible with unsplit application systems, and the other two routers correspond to sub-application systems that have been split by the system. At the same time, since three routers are set, this embodiment can also flexibly adapt to a variety of routing and forwarding scenarios. It can not only meet the routing and forwarding scenarios in which the application system is split into at least two sub-application systems, but also is compatible with routing and forwarding scenarios in which the application is not split, which significantly improves the adaptability of access requests in different routing and forwarding scenarios.
[0153] In an exemplary embodiment, the access information includes an access path and / or a user identifier, the preset routing rule includes a third preset access path and a third preset user identifier, and the access modification rule is determined according to the target routing rule. The method includes:
[0154] When the access path is the same as the third preset access path and the user identifier matches the third preset user identifier, determining a corresponding access modification rule according to the third grayscale routing rule;
[0155] When the access path is the same as the third preset access path and the user identifier does not match the third preset user identifier, or when the access path is the same as the third preset access path and the access information does not include the user identifier, determining a corresponding access modification rule according to the third formal routing rule;
[0156] When the access path is different from the third preset access path and the user identifier matches the third preset user identifier, determining a corresponding access modification rule according to the fourth grayscale routing rule;
[0157] When the access path is different from the third preset access path and the user identifier does not match the third preset user identifier, or the access path is different from the third preset access path and the access information does not contain the user identifier, the corresponding access modification rule is determined according to the fourth formal routing rule.
[0158] The third preset access path and the third preset user identifier included in the preset routing rule are preset routing rules or routing forwarding conditions. The third preset user identifier can be set as needed. Different user identifiers indicate that different users initiate access requests. The preset user identifier includes the third preset user identifier. The preset access path includes the third preset access path.
[0159] In this embodiment, in addition to being adapted to the scenario of accessing the application system that has been split, it is also necessary to be compatible with the original "one-to-one" routing access rules to be compatible, compatible with the historically stored routing access rules to be compatible, and adapted to the scenario of accessing the application system that has not been split.
[0160] For the system splitting scenario in which an application system that has been split is accessed, the routing forwarding conditions of the third grayscale routing rule are met to access the sub-application system or sub-application cluster corresponding to the grayscale function release after the system split, and the routing forwarding conditions of the third formal routing rule are met to access the sub-application system or sub-application cluster corresponding to the formal function release after the system split; for the system unsplit scenario in which an application system that has not been split is accessed, the routing forwarding conditions of the fourth grayscale routing rule are met to access the application system or application cluster corresponding to the grayscale function release in the unsplit application system, and the routing forwarding conditions of the fourth formal routing rule are met to access the application system or application cluster corresponding to the formal function release in the unsplit application system.
[0161] In this embodiment, the grayscale routing rules include a third grayscale routing rule and a fourth grayscale routing rule, and the formal routing rules include a third formal routing rule and a fourth formal routing rule.
[0162] Optionally, when the grayscale routing rules are different, the access modification rules may be the same, and then the grayscale access identifiers added to the access path based on the access modification rules are the same. Alternatively, the access modification rules may be different, and then the grayscale access identifiers added to the access path based on the access modification rules are also different. For example, the third grayscale routing rule is different from the fourth grayscale routing rule, which can also be understood as the routing forwarding conditions corresponding to the third grayscale routing rule are different from the routing forwarding conditions corresponding to the fourth grayscale routing rule. The access modification rules corresponding to the third grayscale routing rule and the fourth grayscale routing rule may be the same or different. Similarly, when the formal routing rules are different, the access modification rules may be the same or different.
[0163] In this embodiment, in order to be compatible with the original "one-to-one" routing access rules to be compatible, the routing access rules to be compatible that have been stored in the compatible history are adapted to the scenario of accessing the application system that has not been split into systems, wherein the application system that has not been split into systems is such as the application system for grayscale function release and the application system for formal function release. One implementation method may be to adapt the routing access rules to be compatible to the third grayscale routing rule adjustment to obtain a fourth grayscale routing rule, wherein the routing access rules to be compatible are used to access the application system for grayscale function release, or to adapt the routing access rules to be compatible to the third formal routing rule adjustment to obtain a fourth formal routing rule, wherein the routing access rules to be compatible are used to access the application system for formal function release.
[0164] It can be understood that, at this time, the access modification rules corresponding to the third grayscale routing rule and the fourth grayscale routing rule are the same, and the access modification rules corresponding to the third formal routing rule and the fourth formal routing rule are the same.
[0165] For example, assuming that the external access path of the application system that has not been split is: www.order.com / ddd, after the third formal routing rule is adjusted, it is necessary to modify and update the external access path to determine the corresponding target routing address, that is, the actual access address is: www.ga.order.com / ddd, so as to achieve the purpose of compatibility with the "one-to-one" routing access rule to be compatible;
[0166] Another implementation method is: if the original "one-to-one" routing access rule to be compatible has a "one-to-one" routing mapping relationship between the external access path and the actual access path, wherein the routing mapping relationship can record the association relationship between each external access path and the actual access path through the routing table, such as the routing mapping relationship between www.order1.com / ddd and www.ya.order1.com / ddd, which is used to implement access to the application system for formal function release, such as the routing mapping relationship between www.order2.com / ddd and www.yray.order2.com / ddd, which is used to implement access to the application system for grayscale function release, it can be directly adapted to the routing rule to be compatible, and based on the routing rule to be compatible, a fourth grayscale routing rule or a fourth formal routing rule is generated. It can be understood that at this time, the access modification rules corresponding to the third grayscale routing rule and the fourth grayscale routing rule can be different, and the access modification rules corresponding to the third formal routing rule and the fourth formal routing rule can also be different.
[0167] Exemplarily, assuming that the external access path of the application system that has not been split is: www.order1.com / ddd, based on the fourth formal routing rule, the external access path is modified and updated to determine the corresponding target routing address, that is, the actual access address is: www.ya.order1.com / ddd, so as to achieve the purpose of compatibility with the "one-to-one" compatible routing access rules.
[0168] It can be understood that the third grayscale routing rule, the third formal routing rule, the fourth grayscale routing rule, and the fourth formal routing rule are different from the routing rules to be compatible. The routing rules to be compatible directly set a "one-to-one" routing mapping relationship between the external access path and the actual access path. When the external access path is known, the actual access path corresponding to the external access path is directly obtained. When the third grayscale routing rule, the fourth grayscale routing rule, the third formal routing rule or the fourth formal routing rule determines the actual access path, it is necessary to rewrite and update the external access path.
[0169] It should be noted that, in order to facilitate understanding of this embodiment, the following is explained with examples. Figure 8 As shown, the server applied in this embodiment takes the Spring-Cloud-Gateway (SCG) cluster as an example, and explains the process of determining the access modification rule according to the third grayscale routing rule, the third formal routing rule, the fourth grayscale routing rule or the fourth formal routing rule. It is assumed that the SCG cluster is provided with four routers, namely: the sixth router, the seventh router, the eighth router and the ninth router, and the preset routing rule is selected to be set on the sixth router. The preset routing rule corresponds to the routing forwarding condition of the grayscale routing rule (such as the third grayscale routing rule) after the application system is split.
[0170] When the access path is the same as the third preset access path and the user identifier matches the third preset user identifier, the routing forwarding condition of the third grayscale routing rule is met, indicating that the access request is to access the sub-application system or sub-application cluster corresponding to the grayscale function release after the application system is split. The corresponding access modification rule is determined according to the third grayscale routing, that is, the access modification rule corresponding to the third grayscale routing access is obtained, and the grayscale access identifier is added to the access path. At this time, the access path is updated according to the access modification rule, and the updated access path is determined as the target routing address of the access request.
[0171] For example, Figure 8As shown, assuming that the access path in the access request is www.order.com / aaa, the user identifier is 2, the preset access path includes www.order.com / aaa, and the preset user identifier includes 2. At this time, the routing forwarding condition of the third grayscale routing rule is met, and a grayscale access identifier such as gray is added to the access path based on the access modification rule, that is, the access path "www.order.com / aaa" is modified and updated to "www.gray.order.com / aaa", and the target routing address of the access request is determined according to the updated access path, that is, the target routing address is: www.gray.order.com / aaa, so as to access the sub-application system 6 corresponding to the grayscale function release after the application system is split through the target routing address.
[0172] When the access path is the same as the third preset access path and the user identifier does not match the third preset user identifier, or the access path is the same as the third preset access path and the access information does not contain the user identifier, the routing forwarding condition of the third formal routing rule is met, indicating that the access request is to access the sub-application system or sub-application cluster corresponding to the formal function release after the application system is split. The corresponding access modification rule is determined according to the third formal routing, the access modification rule corresponding to the third formal routing rule is obtained, and the formal access identifier is added to the access path. At this time, the access path is updated according to the access modification rule, and the updated access path is determined as the target routing address of the access request.
[0173] For example, Figure 8 As shown, assuming that the access path in the access request is www.order.com / aaa, the user identifier is 8, the preset access path includes www.order.com / aaa, and the preset user identifier does not include 8. At this time, the routing forwarding condition of the third formal routing rule is met, and a formal access identifier such as ga is added to the access path based on the access modification rule, that is, the access path "www.order.com / aaa" is modified and updated to "www.ga.order.com / aaa", and the target routing address of the access request is determined according to the updated access path, that is, the target routing address is: www.ga.order.com / aaa, so as to access the sub-application system 7 corresponding to the formal function release after the application system is split through the target routing address.
[0174] When the access path is different from the third preset access path and the user identifier matches the third preset user identifier, the routing forwarding condition of the fourth grayscale routing rule is met, indicating that the access request is to access the application system or application cluster corresponding to the grayscale function release in the unsplit application system. The corresponding access modification rule is determined according to the fourth grayscale routing, that is, the access modification rule corresponding to the fourth grayscale routing access is obtained, and the grayscale access identifier is added to the access path. At this time, the access path is updated according to the access modification rule, and the updated access path is determined as the target routing address of the access request.
[0175] For example, Figure 8 As shown, assuming that the access path in the access request is www.order.com / ccc, the user identifier is 8, the preset access path does not include www.order.com / ccc, and the preset user identifier includes 8. At this time, the routing forwarding condition of the fourth grayscale routing rule is met, and the grayscale access identifier such as gray.new is added to the access path based on the access modification rule, that is, the access path "www.order.com / ccc" is modified and updated to "www.gray.new.order.com / ccc", then the target routing address of the access request is determined according to the updated access path, that is, the target routing address is: www.gray.new.order.com / ccc, so as to access the application system 8 corresponding to the grayscale function release after the unsplit application system is split through the target routing address.
[0176] When the access path is different from the third preset access path and the user identifier does not match the third preset user identifier, or the access path is different from the third preset access path and the access information does not contain the user identifier, the routing forwarding condition of the fourth formal routing rule is met, indicating that the access request is to access the application system or application cluster corresponding to the formal function release in the unsplit application system, determine the corresponding access modification rule according to the fourth formal routing, obtain the access modification rule corresponding to the fourth formal routing rule access, add the formal access identifier to the access path, and at this time, update the access path according to the access modification rule, and determine the updated access path as the target routing address of the access request.
[0177] For example, Figure 8As shown, assuming that the access path in the access request is www.order.com / ccc, there is no user identifier, the preset access path does not include www.order.com / ccc, and the preset user identifiers include 2 and 8. At this time, the routing forwarding condition of the fourth formal routing rule is met, and a formal access identifier such as ga.new is added to the access path based on the access modification rule, that is, the access path "www.order.com / ccc" is modified and updated to "www.ga.new.order.com / ccc", and the target routing address of the access request is determined according to the updated access path, that is, the target routing address is: www.ga.new.order.com / ccc, so as to access the application system 9 corresponding to the formal function release after the application system is split through the target routing address.
[0178] Optionally, in this embodiment, four routers can be set: a sixth router, a seventh router, an eighth router and a ninth router, and preset routing rules can be set on one of the four routers (such as the sixth router), wherein the preset routing rules can correspond to the routing forwarding conditions of the grayscale routing rules (such as the third grayscale routing rules) after the application system is split, and can also correspond to the routing forwarding conditions of the formal routing rules (such as the third formal routing rules) after the application system is split, and can also correspond to the routing forwarding conditions of the grayscale routing rules (such as the fourth grayscale routing rules) of the unsplit application system, and can also correspond to the routing forwarding conditions of the formal routing rules (such as the fourth formal routing rules) of the unsplit application system. This embodiment does not limit this.
[0179] Optionally, the routing forwarding conditions that comply with the third grayscale routing rule can be forwarded by the sixth router, the routing forwarding conditions that comply with the third formal routing rule can be forwarded by the seventh router, the routing forwarding conditions that comply with the fourth grayscale routing rule can be forwarded by the eighth router, and the routing forwarding conditions that comply with the fourth formal routing rule can be forwarded by the ninth router. In an exemplary embodiment, the above-mentioned determination of the corresponding access modification rule according to the third grayscale routing rule includes: determining the corresponding access modification rule according to the third grayscale routing rule based on the sixth router; the above-mentioned determination of the corresponding access modification rule according to the third formal routing rule includes: determining the corresponding access modification rule according to the third formal routing rule based on the seventh router; the above-mentioned determination of the corresponding access modification rule according to the fourth grayscale routing rule includes: determining the corresponding access modification rule according to the fourth grayscale routing rule based on the eighth router; the above-mentioned determination of the corresponding access modification rule according to the fourth formal routing rule includes: determining the corresponding access modification rule according to the fourth formal routing rule based on the ninth router.
[0180] It can be understood that the SCG is provided with four routers. When starting operation, the SCG cluster loads the routing related information of the four routers and the preset routing rules, and then based on the SCG cluster loaded with the routing related information, the step of determining the corresponding access modification rule according to the target routing rule matching the access information in the preset routing rules in this embodiment is implemented.
[0181] Optionally, in one embodiment, the routing forwarding conditions of the third grayscale routing rule, the routing forwarding conditions of the third formal routing rule, the routing forwarding conditions of the fourth grayscale routing rule, and the routing forwarding conditions of the fourth formal routing rule can be set on the sixth router, the seventh router, the eighth router, and the ninth router, respectively. The specific implementation is the same as the embodiment of setting two routers or setting three routers in the above examples, and is not described in detail here.
[0182] In an optional implementation, whether in a system split scenario or a system unsplit scenario, when the user identifier matches the third preset user identifier, it indicates that the access request accesses a sub-application system after the application system corresponding to the grayscale function release is split, or an application system without system splitting. Since the compatibility scenario is for accessing an application system without system splitting, the routing forwarding conditions of the routing rules to be compatible already include the third preset user identifier. Assuming that the preset routing rules correspond to the routing forwarding conditions of the grayscale routing rules (such as the third grayscale routing rules) after the application system is split, the routing forwarding conditions include the third preset access path and / or the third preset user identifier. At this time, the third preset user identifier in the routing forwarding conditions of the third routing rules can be synchronously obtained from the routing rules to be compatible without configuring the third preset user identifier, so that the configuration of the preset routing rules is simpler, and only the existing third preset user identifier in the routing forwarding conditions of the routing rules to be compatible needs to be reused and maintained, thereby ensuring the synchronization of the objects released when the grayscale function is released. Among them, the third preset user identifier in the routing forwarding conditions of the routing rules to be compatible can be set to forward the ninth router that meets the routing forwarding conditions of the fourth grayscale routing rule.
[0183] In an optional implementation, if there is an application system that has not been split into a system and is split or a sub-application system is split again, if the preset routing rule corresponds to the routing forwarding condition of the third grayscale routing rule, that is, based on the third routing rule, the sub-application system or sub-application cluster corresponding to the grayscale function release after the application system is split can be accessed. If the split sub-application system is released for the grayscale function, it is only necessary to add a grayscale routing rule to the preset routing rule, that is, add a grayscale routing rule based on the new preset access path and the new preset user identifier, and if the split sub-application system is released for the formal function, there is no need to change the preset routing rule. It can be seen that this embodiment has high flexibility in routing rule configuration and the routing rule configuration is simple.
[0184] In this embodiment, the preset routing rule includes a third preset access path and a third preset user identifier, so that the access modification rule is determined based on the access path and / or the user identifier, and different access modification rules can be determined according to different routing rules in different routing forwarding scenarios, and the access information is updated based on different access modification rules to determine the target routing address corresponding to the access request. The matching mechanism of the third preset access path enables the access request to be correctly routed to the sub-application system after the corresponding application system is split, and different access modification rules can be determined according to different routing rules in different application scenarios, and the access information is updated based on different access modification rules to determine the target routing address corresponding to the access request. At the same time, since the matching mechanism of the third preset user identifier is set The matching mechanism enables the access request to be correctly routed to the sub-application system for grayscale function release or the sub-application system for formal function release corresponding to the third preset routing rule. When the access path is different from the third preset access path, then similarly, based on the matching result between the user identifier and the third preset user identifier, it is determined whether the corresponding access modification rule is determined based on the fourth grayscale routing rule or the fourth formal routing rule. Obviously, this embodiment can meet the demand of accessing at least two actual access paths separately based on the same external access path. Furthermore, regardless of whether the access path can match the third preset access path, the access request can be correctly routed to the corresponding sub-application system, which can significantly improve the routing accuracy and flexibility of the access request.
[0185] It can be seen that this embodiment routes and forwards access requests by setting four routers, two of which are suitable for sub-application systems after system splitting (including sub-application systems for grayscale function release and sub-application systems for formal function release), and two routers are suitable for application systems that have not undergone system splitting (including application systems for grayscale function release and application systems for formal function release). Therefore, this embodiment can flexibly adapt to a variety of routing and forwarding scenarios, not only meeting the routing and forwarding scenarios in which the application system is split into at least two sub-application systems, but also being compatible with routing and forwarding scenarios in which the application system has not been split, significantly improving the adaptability of access requests in different routing and forwarding scenarios.
[0186] ,In addition, this embodiment is applicable to the scenario where there are a large number of external access paths and a large number of routing rules are configured.
[0187] This embodiment is also in an exemplary embodiment. The access request processing method provided by this embodiment is applied to an SCG cluster. The SCG cluster may include a filter, a preset routing rule and at least two routers. The access information includes an access path and / or a user identifier. The preset routing rule includes a third preset access path and a third preset user identifier. A target routing address determined based on a matching result between the preset routing rule and the access information is determined according to the access information. An access modification rule is determined according to the target routing rule. The access information is updated according to the access modification rule based on the filter. The target routing address of the access request is determined according to the updated access information to route the access request to the target application system according to the target routing address.
[0188] In this embodiment, through the cooperation of the filter, the preset routing rules and at least two closing routers, any one of the at least two routers can send the access request to the filter. Since the access request corresponds to a routing rule matching result in the preset routing rule, the filter can determine the corresponding access modification rule based on the routing rule matching result, so as to update the access information based on the access modification rule, thereby ensuring that each access request can be accurately routed to the target application system according to the target routing address.
[0189] In an exemplary embodiment, the preset routing rules are configured in at least two routers.
[0190] Wherein, at least two routers are of the same type. Exemplarily, the above-mentioned preset routing rules can be configured in at least two sixth routers, can also be configured in at least two seventh routers, can also be configured in at least two eighth routers, can also be configured in at least two ninth routers.
[0191] It should be noted that the preset routing rules can be set in one router or in at least two routers. The more routing rules set in the preset routing rules, the more flexible the server can be for access requests from more different destinations, and the more routing addresses can be routed. However, the more routing rules set in the preset routing rules, the more routing rules the server needs to traverse, and the more time the server spends matching access information, which will lead to reduced routing efficiency, especially when there are a large number of routing rules, such as hundreds of routing rules. The impact on routing efficiency is more significant. Therefore, routing flexibility and routing efficiency are mutually constrained, and the number of routing rules in the preset routing rules should be reasonably configured.
[0192] In addition, it can be understood that the number of routing rules set for each router is limited, and when the total number of routing rules of the preset routing rules on the router is greater than or equal to the preset number, it indicates that there are too many routes set on the router and there is a problem of low routing efficiency. The preset routing rules can be configured in at least two routers, and the number of routing rules configured in each router is respectively configured. Exemplarily, assuming that the preset routing rules are configured in two routers such as two sixth routers, the first number of routing rules in the preset routing rules can be configured in one sixth router, and the second number of routing rules can be configured in another sixth router, wherein the sum of the first number and the second number is equal to the total number of routing rules, and the first number and the second number are both less than the preset number. At this time, it is easy to understand that the number of routes configured with preset routing rules is negatively correlated with the routing efficiency of the access request. Exemplarily, the more routes configured with preset routing rules on the router, the more time it takes to match the access information, and the lower the routing efficiency of the access request.
[0193] Optionally, when the total number of routing rules preset on the router is less than the preset number, they can be set in one router as needed, or in at least two routers, and there is no limitation on this.
[0194] In this embodiment, the preset routing rules are configured in at least two routers. Therefore, when the server receives a large number of batch access requests, it can efficiently complete the correct routing of each access request through the collaborative parallel processing of at least two routers, so that each access request can be routed to the target sub-application system in a timely and accurate manner; at the same time, when the number of routers is large, the preset routing rules are configured in at least two routers, and the routing efficiency of the access requests can be improved through the collaborative parallel processing of at least two routers.
[0195] In an exemplary embodiment, the method further includes:
[0196] In response to the application system splitting signal, determining at least one newly added sub-application system after the application system is split;
[0197] Based on the system type of each newly added sub-application system, determine the routing rules of each newly added sub-application system; the routing rules of each newly added sub-application system correspond to the access information one by one;
[0198] The historical routing rules are updated based on the routing rules of each newly added sub-application system to obtain the preset routing rules.
[0199] The application system split signal is generated based on the application system split situation. Optionally, the application system split situation may include the situation where the application system splits into a new project system including at least one sub-application system, the situation where the application system splits into a new sub-application system for processing grayscale functions, and the situation where the application system splits into a new project system including at least two sub-application systems, wherein one sub-application system is used to process grayscale functions and the other sub-application system is used to process formal functions.
[0200] Specifically, the one-to-one correspondence between each routing rule and the access information is to avoid confusion between different routing rules and to ensure that access requests for accessing a newly added sub-application system can be correctly routed to the corresponding target sub-application system.
[0201] Exemplarily, when the access information includes an access path and a user identifier, if the system type of the newly added sub-application system is an application system for implementing a grayscale function, the preset user identifier of the corresponding value can be set as the routing rule of the newly added sub-application system.
[0202] In this embodiment, when the application system is split, the corresponding routing rules are determined based on the system types of different newly added sub-application systems, and ultimately preset routing rules are obtained that can assist different access requests in being routed to the correct target sub-application system. Therefore, even if the application system is split, the server can reconfigure the preset routing rules to adapt to the new split application system. Through the dynamic adjustment of the routing rules, the application system can achieve seamless connection between the new routing rules and the application system without affecting the client's perception, thereby enabling the application system to flexibly adapt to different system splitting situations.
[0203] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0204] Based on the same inventive concept, the embodiment of the present application also provides an access request processing device for implementing the access request processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more access request processing device embodiments provided below can refer to the limitations on the access request processing method above, and will not be repeated here.
[0205] In one embodiment, Fig. 9 As shown, an access request processing device is provided, including: a receiving module 902, a determining module 904 and a routing module 906, wherein:
[0206] A receiving module 902 is used to receive an access request and obtain access information in the access request;
[0207] A determination module 904, configured to determine a target routing address of the access request according to the access information and a target routing rule in a preset routing rule that matches the access information;
[0208] Routing module 906, used to route the access request to the target sub-application cluster according to the target routing address;
[0209] The target sub-application cluster is a target sub-application system in at least two corresponding sub-application systems after the application system is split.
[0210] In an exemplary embodiment, the above-mentioned determination module 904 is also used to determine the corresponding access modification rule according to the target routing rule that matches the access information in the preset routing rule, update the access information according to the access modification rule, and determine the target routing address of the access request according to the updated access information; or, determine the access identifier according to the target routing rule that matches the access information in the preset routing rule, and determine the target routing address of the access request according to the access information and the access identifier.
[0211] In an exemplary embodiment, the access information includes an access path and / or a user identifier, and the preset routing rules include a first preset access path and a first preset user identifier. The above-mentioned determination module 904 is also used to determine the corresponding access modification rule according to the first grayscale routing rule when the access path is the same as the first preset access path and the user identifier matches the first preset user identifier; when the access path is different from the first preset access path, or the access path is the same as the first preset access path and the user identifier does not match the first preset user identifier, or the access path is the same as the first preset access path and the access information does not contain the user identifier, determine the corresponding access modification rule according to the first formal routing rule.
[0212] In an exemplary embodiment, the access information includes an access path and / or a user identifier, and the preset routing rules include a second preset access path and a second preset user identifier. The above-mentioned determination module 904 is also used to determine the corresponding access modification rule according to the second grayscale routing rule when the access path is the same as the second preset access path and the user identifier matches the second preset user identifier; when the access path is the same as the second preset access path and the user identifier does not match the second preset user identifier, or the access information does not include the user identifier, determine the corresponding access modification rule according to the second formal routing rule; when the access path is different from the second preset access path, determine the corresponding access modification rule according to the closed routing rule.
[0213] In an exemplary embodiment, the access information includes an access path and / or a user identifier, and the preset routing rules include a third preset access path and a third preset user identifier. The above-mentioned determination module 904 is also used to determine the corresponding access modification rule according to the third grayscale routing rule when the access path is the same as the third preset access path and the user identifier matches the third preset user identifier; when the access path is the same as the third preset access path and the user identifier and the user identifier do not match the third preset user identifier, or the access path is the same as the third preset access path and the access information does not contain the user identifier, determine the corresponding access modification rule according to the third formal routing rule; when the access path is different from the third preset access path and the user identifier matches the third preset user identifier, determine the corresponding access modification rule according to the fourth grayscale routing rule; when the access path is different from the third preset access path and the user identifier and the user identifier do not match the third preset user identifier, or the access path is different from the third preset access path and the access information does not contain the user identifier, determine the corresponding access modification rule according to the fourth formal routing rule.
[0214] In an exemplary embodiment, the preset routing rules are configured in at least two routers.
[0215] In an exemplary embodiment, Fig. 9 As shown, the above-mentioned device also includes an update module 908, which is used to: when receiving an instruction to add a routing rule, add the routing rule to the preset routing rule to update the preset routing rule; wherein the routing rule corresponding to the addition instruction is determined according to the application system being split into at least two sub-application systems.
[0216] In an exemplary embodiment, Fig. 9 As shown, the above-mentioned device also includes a configuration module 910, which is used to respond to the application system splitting signal to determine at least one new sub-application system after the application system is split; based on the system type of each new sub-application system, determine the routing rules of each new sub-application system; there is a one-to-one correspondence between the routing rules of each new sub-application system and the access information; based on the routing rules of each new sub-application system, the historical routing rules are updated to obtain preset routing rules.
[0217] Each module in the access request processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0218] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.10 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store routing rule data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an access request processing method is implemented.
[0219] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.11As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, an access request processing method is implemented. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.
[0220] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0221] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0222] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0223] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0224] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0225] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0226] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0227] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for processing an access request, characterized in that: The method comprises: Receiving an access request, and obtaining access information in the access request; Determine a target routing address of the access request according to the access information and a target routing rule, wherein the target routing rule is determined based on a matching result between a preset routing rule and the access information; Routing the access request to the target application system according to the target routing address; The target application system includes a target sub-application system in at least two corresponding sub-application systems after the application system is split.
2. The method according to claim 1, characterized in that Determining the target routing address of the access request according to the access information and the target routing rule includes: Determine an access modification rule according to the target routing rule, update the access information according to the access modification rule, and determine a target routing address of the access request according to the updated access information; and / or, An access identifier is determined according to the target routing rule, and a target routing address of the access request is determined according to the access information and the access identifier.
3. The method according to claim 2, characterized in that The access information includes an access path and / or a user identifier, the preset routing rule includes a first preset access path and a first preset user identifier, the target routing rule is determined based on a matching result between the preset routing rule and the access information, and the access modification rule is determined according to the target routing rule including: When the access path is the same as the first preset access path and the user identifier matches the first preset user identifier, determining a corresponding access modification rule according to the first grayscale routing rule; When the access path is different from the first preset access path, or the access path is the same as the first preset access path and the user identifier does not match the first preset user identifier, or the access path is the same as the first preset access path and the access information does not contain the user identifier, the corresponding access modification rule is determined according to the first formal routing rule.
4. The method according to claim 2, characterized in that: The access information includes an access path and / or a user identifier, the preset routing rule includes a second preset access path and a second preset user identifier, and determining the access modification rule according to the target routing rule includes: When the access path is the same as the second preset access path and the user identifier matches the second preset user identifier, determining a corresponding access modification rule according to the second grayscale routing rule; When the access path is the same as the second preset access path and the user identifier does not match the second preset user identifier, or the access information does not include the user identifier, determining a corresponding access modification rule according to the second formal routing rule; When the access path is different from the second preset access path, a corresponding access modification rule is determined according to the closed routing rule.
5. The method according to claim 2, characterized in that: The access information includes an access path and / or a user identifier, the preset routing rule includes a third preset access path and a third preset user identifier, and determining the access modification rule according to the target routing rule includes: When the access path is the same as the third preset access path and the user identifier matches the third preset user identifier, determining a corresponding access modification rule according to the third grayscale routing rule; When the access path is the same as the third preset access path and the user identifier does not match the third preset user identifier, or when the access path is the same as the third preset access path and the access information does not include the user identifier, determining a corresponding access modification rule according to the third formal routing rule; When the access path is different from the third preset access path and the user identifier matches the third preset user identifier, determining a corresponding access modification rule according to the fourth grayscale routing rule; When the access path is different from the third preset access path and the user identifier does not match the third preset user identifier, or when the access path is different from the third preset access path and the access information does not contain the user identifier, the corresponding access modification rule is determined according to the fourth formal routing rule.
6. The method according to claim 5, characterized in that The preset routing rules are configured in at least two routers.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: When receiving an instruction to add a routing rule, adding the routing rule to the preset routing rule to update the preset routing rule; The routing rule corresponding to the adding instruction is determined according to the application system being split into at least two sub-application systems.
8. An access request processing device, characterized in that: The device comprises: A receiving module, configured to receive an access request and obtain access information in the access request; A determination module, configured to determine a target routing address of the access request according to the access information and a target routing rule, wherein the target routing rule is determined based on a matching result between a preset routing rule and the access information; A routing module, used for routing the access request to a target application system according to the target routing address; The target application system includes a target sub-application system in at least two corresponding sub-application systems after the application system is split.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.