Access processing method and apparatus
By pre-storing the server-side access information and constructing a second access request within the same domain in the processing unit of the first server, the problem of high resource consumption and maintenance costs in cross-domain access is solved, achieving efficient cross-domain access and cookie information management.
Patent Information
- Application Number
- CN202310979894.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-04
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-08-04
AI Technical Summary
In cross-domain access scenarios, due to the same-origin policy, existing technologies require configuring nginx configuration information for each accessed entity, leading to increased resource consumption and maintenance costs. This is especially true in application cluster scenarios where cookie information is prone to being overwritten.
The first server's processing unit pre-stores access information from other servers, constructs a second access request using the service identifier, and forwards it to the corresponding server, thus avoiding direct cross-domain requests and reducing nginx configuration.
It enables cross-domain access under the same-origin policy, reduces resource consumption and server maintenance costs, and avoids the problem of cookie information being overwritten.
Smart Images

Figure CN117014531B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of computer technology, and in particular to an access processing method. This specification also relates to an access processing apparatus, a computing device, and a computer-readable storage medium. Background Technology
[0002] In current software development, scenarios requiring cross-domain access are frequently encountered. Cross-domain access typically involves a user or server initiating access to resources on different domains, ports, or protocols. However, due to the same-origin policy, cross-domain access is blocked by default to prevent malicious attacks on the initiator and to protect user privacy.
[0003] To enable cross-origin access under the same-origin policy, a proxy server is typically configured using nginx (a reverse proxy server). This proxy server has the same domain name as the initiator of the cross-origin access and acts as an intermediary for the initiator to access the recipient of the cross-origin access, thus achieving cross-origin access.
[0004] However, when cross-domain access involves multiple users, each additional user requires configuring Nginx settings. Since Nginx configuration is manually maintained, the more users access the system, the greater the additional resource consumption and maintenance costs. Therefore, a method to reduce resource consumption is urgently needed for handling cross-domain access. Summary of the Invention
[0005] In view of this, embodiments of this specification provide an access processing method. This specification also relates to an access processing apparatus, a computing device, and a computer-readable storage medium to address the technical deficiencies existing in the prior art.
[0006] According to a first aspect of the embodiments of this specification, an access processing method is provided, applied to a processing unit of a first server, the processing unit including a cache space, the cache space pre-stores access information registered by other servers, the method comprising:
[0007] Receive the first access request sent by the user client;
[0008] Parse the first access request, and if the service identifier of the second server is obtained, search for the target access information of the second server in the cache space based on the service identifier;
[0009] Construct a second access request based on the target access information;
[0010] The second access request is sent to the second server so that the second server can respond to the second access request.
[0011] According to a second aspect of the embodiments of this specification, an access processing apparatus is provided, applied to a processing unit of a first server, the processing unit including a cache space, the cache space pre-stores access information registered by other servers, the apparatus comprising:
[0012] The receiving module is used to receive the first access request sent by the user client;
[0013] The parsing module is used to parse the first access request, and, if the service identifier of the second server is obtained, to search for the target access information of the second server from the cache space based on the service identifier;
[0014] The construction module is used to construct a second access request based on the target access information;
[0015] The forwarding module is used to send the second access request to the second server so that the second server can respond to the second access request.
[0016] According to a third aspect of the embodiments of this specification, a computing device is provided, comprising:
[0017] Memory and processor;
[0018] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the following method:
[0019] Receive the first access request sent by the user client;
[0020] Parse the first access request, and if the service identifier of the second server is obtained, search for the target access information of the second server in the cache space based on the service identifier;
[0021] Construct a second access request based on the target access information;
[0022] The second access request is sent to the second server so that the second server can respond to the second access request.
[0023] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores computer-executable instructions that, when executed by a processor, implement the steps of the access processing method.
[0024] The access processing method provided in this specification is applied to a processing unit of a first server. The processing unit includes a cache space, in which access information registered by other servers is pre-stored. The method includes: receiving a first access request sent by a user; parsing the first access request; and, if a service identifier of a second server is obtained, searching for target access information of the second server in the cache space based on the service identifier; constructing a second access request based on the target access information; and sending the second access request to the second server so that the second server responds to the second access request.
[0025] One embodiment of this specification uses access information registered by the second server pre-stored in the processing unit of the first server. It constructs a second access request based on a first access request carrying the service identifier of the second server, and then forwards the second access request to the second server. On one hand, this ensures that the front-end of the first server only initiates requests to the back-end of the first server. Since the front-end and back-end of the first server are in the same domain, it avoids cross-domain issues caused by the front-end directly initiating requests to the second server. On the other hand, in scenarios with multiple second servers, only the service identifier of each second server needs to be used to construct the corresponding second access request, thus eliminating the need to configure nginx response for each second server, reducing resource consumption and server maintenance costs. Attached Figure Description
[0026] Figure 1 This is a schematic diagram of the interaction flow of an access processing system architecture provided in one embodiment of this specification;
[0027] Figure 2 This is a flowchart illustrating an access processing method provided in one embodiment of this specification;
[0028] Figure 3 This is a flowchart illustrating the process of applying an access processing method provided in one embodiment of this specification to display the interface of application B on the front-end page of application A.
[0029] Figure 4 This is a schematic diagram of the structure of an access processing device provided in one embodiment of this specification;
[0030] Figure 5 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation
[0031] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0032] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0033] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "in response to information," or "in determination."
[0034] First, the terms and concepts used in one or more embodiments of this specification will be explained.
[0035] A cookie is a small text file stored on a user's computer to store information that websites collect when a user visits the site. When a user visits a website, the website sends a cookie containing information about the user to the user's browser and stores it on the user's computer. Later, when the user visits the website again, the browser sends the cookie back to the server so that the server can recognize the user and provide personalized services.
[0036] iframe: or inline frame, is an HTML (HyperText Markup Language) tag that creates an inline frame within the current webpage. It can be used to embed another webpage or various content such as advertisements, maps, videos, and audio.
[0037] Cookie samesite: This refers to the samesite attribute of a cookie, which defines whether the cookie should be sent with cross-domain access requests. It is used to restrict third-party cookies and thus reduce security risks.
[0038] Same-Origin Policy: The same-origin policy is a security mechanism that restricts a webpage to interacting only with resources from the same origin (origin refers to resources that share the exact same protocol, domain name, and port number). Due to this restriction, if a webpage attempts to access a resource from a different origin, the request will be considered a cross-origin request.
[0039] Cross-domain access: The act of accessing a resource whose protocol, port, or domain name is different from its own is called cross-domain access.
[0040] A URL (Uniform Resource Locator) is a string used to locate and identify resources on the Internet. URLs are used to locate resources on the Web (World Wide Web), such as web pages, images, videos, and files.
[0041] HTTP (Hypertext Transfer Protocol): Used to transmit information between web browsers and web servers. The HTTP protocol sends content in plaintext and does not provide any form of data encryption. If an attacker intercepts the transmission messages between the web browser and the web server, they can directly read the information. Therefore, the HTTP protocol is not suitable for transmitting sensitive information.
[0042] HTTPS (Hypertext Transfer Protocol Secure): To address the issues raised by the HTTP protocol, engineers use the SSL (Secure Socket Layer) protocol to encrypt data transmitted via HTTP, providing security support for data communication.
[0043] Nginx is an open-source, high-performance HTTP and reverse proxy server. It can be used as a lightweight, efficient web server, or as a reverse proxy server for load balancing, caching, and accelerating static files. Nginx excels in handling concurrent connections and high-load network environments, and is therefore widely used by many large websites and internet companies.
[0044] Application Clusters: As businesses grow rapidly, a single application server cannot handle a large number of user requests. To address this, many companies combine multiple servers to provide a single service, which appears to the user as a single server; this is known as an application cluster.
[0045] Cookie write overwriting: In application cluster use cases, cookie information generated by each server needs to be written to the user's client. However, since multiple servers work together to provide a service, the names and paths of the cookies generated by each server may be the same, but the values may differ. Because the user's client only stores one cookie value under a given cookie path or name, application cluster use cases can cause cookie information generated by each server to overwrite each other when written to the user's client, retaining only the last cookie value written.
[0046] In current software development, scenarios requiring cross-domain access are frequently encountered. Cross-domain access typically involves a user or server initiating an attempt to access resources on different domains, ports, or protocols. However, due to the same-origin policy, cookie information is not allowed in cross-domain requests, and cross-domain access is blocked by default to prevent malicious attacks on the initiator and to protect user privacy.
[0047] To enable cross-domain access under the same-origin policy, existing technologies first adjust the way cookies are used, transmitting cookie information via URL. However, for many applications that have already been developed, changing the way cookies are used will have a significant impact, requiring many cookie-related functions to be redeveloped, which consumes a lot of manpower and resources.
[0048] Without changing how cookies are used, existing technologies have adopted a solution that changes the network mode of both parties in a cross-domain access process. For example, both parties in a cross-domain access process use the HTTPS protocol and set the samesite attribute of the cookie information to none, thus turning the cross-domain access into a same-domain access. However, such changes are not allowed for the accessing or being accessed end running on an intranet.
[0049] Without changing the way cookies are used or the network patterns of the two parties accessing the domain, existing technologies employ a reverse proxy server (such as nginx) to configure a proxy to forward cross-domain access requests. In this way, the proxy server's domain name is the same as the domain name of the cross-domain request initiator. The proxy server receives the cross-domain access request and forwards it to the actual accessed party, thus achieving cross-domain access. However, when cross-domain access involves multiple accessed parties, such as in an application cluster scenario, each accessed party needs to be configured with nginx response settings, leading to additional resource consumption. Especially when the accessed party is an application cluster with multiple nodes sharing the same domain name and path, it can cause cookie overwriting issues when writing cookies.
[0050] Based on this, an access processing method is provided in this specification. This specification also relates to an access processing apparatus, a computing device, and a computer-readable storage medium, which will be described in detail in the following embodiments.
[0051] Reference Figure 1 As shown, Figure 1 This diagram illustrates the interaction flow of an access processing system architecture according to an embodiment of this specification. The access processing system includes a user terminal and at least two servers. The user terminal initiates a request from a first server to access a second server and receives a response. The first server translates the request initiated by the user terminal and forwards it to the second server. The second server responds to the request. Specifically, the second server first registers its target access information and service identifier with the processing unit of the first server, and then sends its second user login information to the first server. The processing unit of the first server encrypts this information into first user login information and stores a mapping table between the first and second user login information in the cache space of the processing unit. The user terminal sends a first access request to the first server, which includes the first user login information and the service identifier. After receiving the first access request, the processing unit of the first server parses the request to obtain the service identifier of the second server and retrieves the target access information of the second server from the cache space based on the service identifier. The processing unit of the first server parses the first access request to obtain the first user login information, and converts the first user login information into the second user login information in the conversion table of first user login information and second user login information stored in the cache space. Based on the target access information and the second user login information, the processing unit constructs a second access request and sends the second access request to the second server so that the second server can respond to the second access request.
[0052] This access processing system uses access information pre-stored in the processing unit of the first server to register the second server. It then constructs a second access request based on a first access request carrying the service identifier of the second server, and forwards the second access request to the second server. On one hand, this ensures that the front-end of the first server only sends requests to the back-end of the first server. Since the front-end and back-end of the first server are in the same domain, it avoids cross-domain issues caused by the front-end directly sending requests to the second server. On the other hand, in scenarios with multiple second servers, it only needs to construct corresponding second access requests for the service identifiers of different second servers, thus eliminating the need for nginx response configuration for each second server, reducing resource consumption and server maintenance costs.
[0053] Figure 2A flowchart of an access processing method according to an embodiment of this specification is shown, which specifically includes the following steps:
[0054] Step 202: Receive the first access request sent by the user.
[0055] The first access request can be a request initiated by the user client for the front end of the first server to access resources of the second server. The first and second servers belong to different domains. In this case, the user client will add the service identifier of the second server to the first access request when constructing it. The first access request can also be a request initiated by the user client for the first server to access its own resources. In this case, the first access request is a non-cross-domain access request, and the user client does not need to add the service identifier of other servers to the first access request.
[0056] In practical applications, after the user constructs the first access request, it sends the first access request to the first server, which is received by the processing unit of the first server. The processing unit includes a cache space, which pre-stores access information registered by other servers.
[0057] In a specific embodiment of this specification, taking application A as the first server, application B as the second server, and a proxy gateway as the processing unit, when the first access request is for application A to access application B, the first access request will carry the service identifier of application B. When the first access request is for application A to access its own resources, the first access request will not contain the service identifier of application B. The user client sends the first access request to the first server, which is received by the proxy gateway of the first server.
[0058] Furthermore, in order to construct a second access request containing target access information, before receiving the first access request sent by the user terminal, the method further includes: in response to a registration request sent by the second server, obtaining the target access information and service identifier of the second server; and storing the target access information and the service identifier in the cache space.
[0059] The registration request is a request from the second server to register its own routing identifier and target access information with the processing unit of the first server. Since there is a correspondence between the routing identifier and the target access information of the second server, the processing unit needs to associate and store the service identifier and target access information of the second server in its own cache space.
[0060] In practical applications, if the second server detects that no target access information has been registered with the processing unit, it generates a service identifier for the second server and obtains the target access information for the second server. Based on the service identifier and target access information of the second server, it generates a registration request and sends it to the processing unit of the first server. The processing unit of the first server may receive registration requests from other servers besides the second server, such as the service identifier and target access information of a third server. Therefore, to facilitate accurate subsequent lookup of the corresponding target access information based on the service identifier, the processing unit of the first server associates the service identifiers and target access information of each server and stores them in the processing unit's cache space.
[0061] In a specific embodiment of this specification, taking application A as the first server, application B as the second server, a proxy gateway as the processing unit, an instance manager as the cache space, a route identifier as the service identifier, and port, IP address, and protocol as the target access information, as an example, application B, upon detecting that it has not registered its port, IP address, and protocol with application A's proxy gateway, generates its own route identifier and obtains its port, IP address, and protocol. Based on the route identifier and the port, IP address, and protocol, it generates a registration request and sends it to application A's proxy gateway. Upon receiving the registration request, application A's proxy gateway parses the request, obtains application B's route identifier and its port, IP address, and protocol, and associates and stores these attributes in the proxy gateway's instance manager.
[0062] Based on this, it is ensured that the subsequent processing unit of the first server can accurately query and obtain the target access information of the second server based on the service identifier of the second server.
[0063] Further, obtaining the target access information and service identifier of the second server includes: reading the target access information and service identifier of the second server from the registration file; or, reading the target access information and service identifier of the second server from the registration data table; or, receiving the target access information and service identifier input by the second server through the registration interface.
[0064] The registration file is used to record the target access information and service identifier written by the second server when initiating the registration request. The registration data table is used to record the target access information and service identifier written by the second server when initiating the registration request.
[0065] In practical applications, when the second server sends its service identifier and target access information, it can do so by writing these two pieces of information to a specified file, a specified data table, or directly inputting them through the registration interface. Therefore, the processing unit of the first server can obtain the second server's service identifier and target access information by reading from a specified registration file, reading from a specified data table, or receiving input from the second server through the registration interface.
[0066] In a specific embodiment of this specification, taking application A as the first server, application B as the second server, a proxy gateway as the processing unit, an instance manager as the cache space, a routing identifier as the service identifier, and port, IP address, and protocol as the target access information as an example, application B can write its routing identifier, port, IP address, and protocol into a file specified in the processing unit. The corresponding proxy gateway of application A can read application B's routing identifier, port, IP address, and protocol from that specified file. Application B can also write its routing identifier, port, IP address, and protocol into a data table specified in the processing unit. The corresponding proxy gateway of application A can read application B's routing identifier, port, IP address, and protocol from that specified data table. Application B can input its routing identifier, port, IP address, and protocol into application A's proxy gateway through a registration interface. The corresponding proxy gateway of application A can receive application B's routing identifier, port, IP address, and protocol from the second server through the registration interface.
[0067] Based on this, the second server can register its service identifier and target access information with the processing unit of the first server, further ensuring that the processing unit of the first server can accurately query and obtain the target access information of the second server based on its service identifier.
[0068] Step 204: Parse the first access request. If the service identifier of the second server is obtained, search for the target access information of the second server in the cache space based on the service identifier.
[0069] The service identifier serves as a unique identifier for the second server. The cache space stores the target access information of the second server. The processing unit of the first server can find the target access information of the second server in the cache space based on the service identifier of the second server.
[0070] In practical applications, after receiving the first access request, the processing unit of the first server first parses the request to determine whether it carries the service identifiers of other servers. If the processing unit obtains the service identifier of the second server from the parsed request, it searches its own cache for the target access information of the second server, which is pre-registered in the processing unit's cache. If the processing unit does not obtain the service identifiers of other servers from the parsed request, it can access the resource indicated by the first access request.
[0071] In a specific embodiment of this specification, taking application A as the first server, application B as the second server, a routing identifier as the service identifier, and the target access information as the IP address, port number, and protocol of application B, a proxy gateway as the processing unit, and the instance manager of the proxy gateway as the cache space, as an example: When the proxy gateway of application A parses the first access request and obtains the routing identifier of application B, it searches for the IP address, port number, and protocol of application B in the instance manager of the proxy gateway based on the routing identifier of application B. These IP addresses, port numbers, and protocols of application B are pre-registered by application B in the instance manager of the proxy gateway. When the proxy gateway of application A does not obtain the routing identifier of application B or any other application from the first access request, the first access request is a request from the first server to access its own resources, and the proxy gateway can access the resources indicated by the first access request based on this first access request.
[0072] Step 206: Construct a second access request based on the target access information.
[0073] The second access request is a request initiated by the user client to access resources of the second server from the first server, constructed by the processing unit of the first server. Unlike the first access request, the second access request is constructed based on the target access information of the second server.
[0074] In practical applications, after the processing unit of the first server obtains the target access information of the second server, it constructs a second access request based on the target access information. It is worth noting that the first access request is an access request sent from the front end of the first server to the processing unit of the first server, while the second access request is an access request sent from the processing unit of the first server to the second server. The first access request does not include the target access information of the second server, but only includes the service identifier of the second server; while the second access request is constructed by the processing unit in the first server based on the target access information of the second server. The processing unit can send the second access request to the second accessing server while ensuring the same-origin policy.
[0075] In a specific embodiment of this specification, taking application A as the first server, application B as the second server, the target access information as the IP address, port number, and protocol of application B, and a proxy gateway as the processing unit, the proxy gateway in application A constructs a second access request based on the IP address, port number, and protocol of application B.
[0076] Furthermore, when the second server is a cluster, it can lead to cookie overwriting issues when writing cookies. To ensure the same-origin policy, the first access request carries cookie information and is transmitted to the second server. The first access request includes access information from the first server and first user login information. The step of constructing the second access request based on the target access information includes: reading the first user login information from the first access request; finding the second user login information corresponding to the first user login information; and constructing the second access request based on the target access information and the second user login information.
[0077] There is a corresponding conversion relationship between the first user login information and the second user login information.
[0078] In practical applications, the first access information includes the first user login information. To prevent the first user login information with the same name and path from overwriting each other, it is necessary to convert the first user login information. The processing unit's cache space pre-stores the corresponding conversion relationship between the first user login information and the second user login information. After receiving the first access request, it first reads the first user login information from the first access request, then obtains the second user login information according to the corresponding conversion relationship between the first and second user login information, and finally constructs the second access request based on the second user login information and the target access information.
[0079] In a specific embodiment of this specification, taking application A as the first server, application cluster B as the second server, the target access information as the IP address, port number, and protocol of application cluster B, a proxy gateway as the processing unit, and encrypted cookie information as the first user login information and unencrypted cookie information as the second user login information as an example, the instance manager of the proxy gateway of application A pre-stores the correspondence between unencrypted cookie information and encrypted cookie information. After receiving the first access request, it first reads the encrypted cookie information from the first access request, then obtains the unencrypted cookie information according to the correspondence between encrypted and unencrypted cookie information, and finally constructs the second access request based on the unencrypted cookie information and the IP address, port number, and protocol of application cluster B.
[0080] Based on this, by converting the first user login information, it is ensured that the first user login information can be sent to the second server.
[0081] Further, the first user login information includes a first user login name and a first user login value, and the second user login information includes a second user login name and a second user login value; the step of searching for the second user login information corresponding to the first user login information includes: based on the first user login name, searching for the second user login name corresponding to the first user login name from the login name relationship table; based on the first user login value, searching for the second user login value corresponding to the first user login value from the login value relationship table.
[0082] The login name relationship table is constructed based on the transformation of login names accessing the second server, and the login value relationship table is constructed based on the transformation of login values accessing the second server.
[0083] In practical applications, the processing unit's cache space pre-stores the correspondence between the first user's login information and the second user's login information. This correspondence further includes a login name relationship table and a login value relationship table. The processing unit finds the second login name corresponding to the first login name based on the login name relationship table, and finds the second login value corresponding to the first login value based on the login value relationship table.
[0084] In a specific embodiment of this specification, taking the processing unit as a proxy gateway, the first login name as b_route_121314abc, the second login name as 121314abc, the first login value as 50, and the second login value as 101 as an example, the proxy gateway finds the corresponding 121314abc for b_route_121314abc according to the login name relationship table, and finds the corresponding 101 for 50 according to the login value relationship table.
[0085] Based on this, the conversion between the first login name and the first login value was completed.
[0086] Furthermore, the first user login information also includes a first user login path, and the second user login information also includes a second user login path; the method further includes: parsing the first user login path to obtain the second user login path.
[0087] The first user login path is obtained by converting the login path for accessing the second server.
[0088] In practical applications, the first user login path includes a second user login path, and the first login path can be converted into the second user login path. The processing unit parses the first login path to obtain the second login path.
[0089] In a specific embodiment of this specification, taking the processing unit as a proxy gateway, and the first login path as / proxy / b_route / webapp / Test / aa / bb, and the second login path as webapp / Test / aa / bb as an example, the proxy gateway parses / proxy / b_route / webapp / Test / aa / bb to obtain the second user login path webapp / Test / aa / bb.
[0090] Based on this, the conversion of the first login path was completed.
[0091] Furthermore, if the cache space of the first server's processing unit does not contain a login name relationship table and a login value relationship table, in order for subsequent processing units to convert the first user login name and the first user login value, before searching for the second user login name corresponding to the first user login name from the login name relationship table based on the first user login name, the method further includes: receiving response information from the second server in response to the third access request; reading the second user login name and the second user login value from the response information; converting the second user login name to obtain the first user login name, and converting the second user login value to obtain the first user login value; storing the first user login name and the second user login name in the login name relationship table, and storing the first user login value and the second user login value in the login value relationship table.
[0092] The third access request is a request initiated by the first server to the second server to obtain the second user's login name and login value. The response information of the third access request carries the second user's login name and login value.
[0093] In practical applications, when the first server detects that the username and login value tables are missing from the processing unit's cache, it sends a third access request to the second server. The second server responds to the third access request, retrieves the second user's username and login value, writes them into a response message, and returns it to the first server. Upon receiving the response message containing the second user's username and login value, the first server converts the second username and login value to obtain the first user's username and login value, stores the first and second usernames in the username table, and stores the first and second login values in the login value table.
[0094] In a specific embodiment of this specification, taking application A as the first server, application B as the second server cluster, a proxy gateway as the processing unit, an instance manager as the cache space, and the first user login name as b_route_121314abc, the second user login name as 121314abc, the first user login value as 50, and the second user login value as 101 as an example, when application A detects that there is no login name relationship table or login value relationship table in the instance manager of the proxy gateway, it sends a third access request to application B cluster. In response to the third access request, application B cluster obtains the second user login name 121314abc and the second user login value 50, writes 121314abc and 50 into the response information, and returns it to application A. After receiving the response information containing the second user's login name and login value, application A converts 121314abc and 50 to obtain b_route_121314abc and 101, and stores b_route_121314abc and 121314abc in the login name relationship table, and stores 101 and 50 in the login value relationship table.
[0095] Based on this, the login name relationship table and login value relationship table were constructed.
[0096] Further, the step of converting the second user login name to obtain the first user login name includes: obtaining the service identifier and target access information of the second server; concatenating the service identifier, the target access information and the second user login name, and encrypting the concatenated string to obtain the first user login name.
[0097] In practical applications, not only can the service identifier, target access information, and second user login name be concatenated and encrypted to obtain the first user login name, but other strings can also be obtained and concatenated with the second user login name to obtain the first user login name.
[0098] In a specific embodiment of this specification, taking the second user login name 121314abc, the route identifier as b_route, and the target access information as 2.2.2.2:8082 as an example, the first user login name obtained by the processing unit is b_route2.2.2.2_8082121314abc.
[0099] Based on this, the login name relationship table was constructed in a more detailed manner.
[0100] Further, the step of converting the second user login value to obtain the first user login value includes: encrypting the second user login value to obtain the first user login value.
[0101] In practical applications, the second user login value can be encrypted using a preset encryption function or other methods; this application does not impose any restrictions on this.
[0102] In a specific embodiment of this specification, taking the conversion method of the first login value and the second login value as MD5 (Message-digest Algorithm 5) as an example, the processing unit encrypts the second user login value to obtain the first user login value.
[0103] Based on this, the login value relationship table was constructed in more detail. In the scenario of cross-domain access between the second server cluster and the first server, the attributes such as the name and path of the user login information were transformed to avoid the problem of user login information overlapping when the names, paths, and other attributes of user login information are the same on multiple second servers.
[0104] Furthermore, since the user terminal needs to use the first user login information when generating the first access request, after converting the second user login name to obtain the first user login name and converting the second user login value to obtain the first user login value, the method further includes: determining the first user login information based on the first user login name and the first user login value, and writing the first user login information into the response information; and feeding back the response information to the user terminal so that the user terminal stores the first user login name and the first user login value required to access the second server.
[0105] In practical applications, when the client generates the first access request, it needs to add the first user login information to the first access request. The first user login information is generated on the first server, so the first server needs to return the first user login information to the first client.
[0106] In a specific embodiment of this specification, taking application A as the first user terminal and encrypted cookie information as the first user login information as an example, the encrypted cookie information is determined based on the encrypted cookie name and encrypted cookie value, and the encrypted cookie information is written into the response information. The response information is then fed back to the user terminal, so that the user terminal stores the encrypted cookie name and encrypted cookie value required to access the application cluster B.
[0107] Based on this, the client obtains the first user login information, which supports the subsequent generation of the first access request.
[0108] Furthermore, to prevent user login information writing failure due to different transmission protocols, before feeding back the response information to the user terminal, the method further includes: obtaining the transmission protocol used by the first server; if the transmission protocol is a secure transmission protocol, setting the security attribute of the first user login information to a first state; if the transmission protocol is a non-secure transmission protocol, setting the security attribute of the first user login information to a second state.
[0109] The first state allows users to transmit login information only through a secure transmission protocol, while the second state allows users to transmit login information through a non-secure transmission protocol.
[0110] In practical applications, the failure to write user login information due to differences in transmission protocols at different ends is mainly because when the security attribute of the user login information is set to the first state, only user login information is allowed to be transmitted via a secure transmission protocol. If the end writing the user login information uses an insecure transmission protocol, then when requesting the first server, the server will be unable to carry the login information set to the first state because it is using an insecure transmission protocol.
[0111] In a specific embodiment of this specification, HTTPS is used as the secure transmission protocol, HTTP as the insecure transmission protocol, cookie information as the first user login information, and the cookie secure attribute as the security attribute. The first state is true, and the second state is false. The transmission protocol used by the first server is obtained. If the first server uses HTTPS, the cookie secure attribute is set to true, meaning the cookie can be transmitted via HTTPS or written to the first server. If the first server uses HTTP, the cookie secure attribute is set to false, meaning the cookie can be transmitted via HTTP or written to the first server.
[0112] This prevents user login information transmission failures due to different transmission protocols.
[0113] Step 208: Send the second access request to the second server so that the second server can respond to the second access request.
[0114] In this process, after the first server's processing unit constructs the second access request, it sends the second access request to the second server, and the second server responds after receiving the second access request.
[0115] In practical applications, after the first server's processing unit sends the second access request to the second server, the second server first receives the request and parses it to extract various information, including request headers, request body, request method, and URL. Secondly, based on the information in the request, the second server executes the corresponding process, which may include executing business logic, data processing, and database access. Depending on the specific circumstances, the second server may need to interact with other systems or other endpoints. Then, during the request processing, the second server generates response data, including response status codes, response headers, and a response body. The response body typically contains data or other content generated based on the request processing results. Finally, the second server returns the response to the first server.
[0116] In a specific embodiment of this specification, taking application A as the first server, a proxy gateway as the processing unit, and application cluster B as the second server, and the second access request as an application A's request to access resources of application cluster B as an example, after the proxy gateway in application A sends the request to application cluster B, application cluster B first receives the request and parses it to obtain the request header, request body, request method, and URL, etc.; secondly, application cluster B queries the resource corresponding to the request based on the content in the request body; then, application cluster B generates response data during the request processing, including response status code, response header, and response body, the response body including the resource requested by application A; finally, application cluster B returns the response to application A's proxy gateway.
[0117] One embodiment of this specification uses access information registered by the second server pre-stored in the processing unit of the first server. It constructs a second access request based on a first access request carrying the service identifier of the second server, and then forwards the second access request to the second server. On one hand, this ensures that the front-end of the first server only initiates requests to the back-end of the first server. Since the front-end and back-end of the first server are in the same domain, it avoids cross-domain issues caused by the front-end directly initiating requests to the second server. On the other hand, in scenarios with multiple second servers, only the service identifier of each second server needs to be used to construct the corresponding second access request, thus eliminating the need for nginx response configuration for each second server, reducing resource consumption and server maintenance costs.
[0118] The following is in conjunction with the appendix Figure 3 Taking the example of displaying the interface of application B on the front-end page of application A using the access processing method provided in this specification, the access processing method will be further explained. Figure 3 This specification illustrates a flowchart of an access processing method for displaying the interface of application B on the front-end page of application A, according to an embodiment of this specification. The method specifically includes the following steps:
[0119] Step 302: Receive the first access request.
[0120] In one possible implementation, the user initiates an action in application A (i.e., ... Figure 2 The first server in the embodiment displays application B (i.e., ...) on its front-end page. Figure 2 The first access request to the interface of the second server in the embodiment is http: / / 1.1.1.1:8080 / proxy / b_route / index.html (i.e. Figure 2 The first access request in the embodiment includes encrypted cookie information (i.e., Figure 2The first user login information in the embodiment and the routing identifier of application B (i.e. Figure 2 (Service identifier of the second server in the embodiment).
[0121] Step 304: Register the IP address, port, and protocol via file.
[0122] In one possible implementation, application B registers its IP address, port, and protocol (i.e., ...) via a registration file. Figure 2 The target access information in the embodiment is registered to the instance manager of the proxy gateway (i.e., Figure 2 In the example of the cache space, the proxy gateway of application A can read the routing identifier of application B, its port 8082, IP address 2.2.2.2, and protocol HTTPS from the specified file.
[0123] Step 306: Register the IP address, port, and protocol through the data table.
[0124] In one possible implementation, application B registers its IP address, port, and protocol with the instance manager of the proxy gateway through a registration data table. The corresponding proxy gateway of application A can then read application B's route identifier, port 8082, IP address 2.2.2.2, and protocol HTTPS from the specified data table.
[0125] Step 308: Register the IP address, port, and protocol via the interface.
[0126] In one possible implementation, application B can input its routing identifier, port, IP address, and protocol into application A's proxy gateway through a registration interface. Correspondingly, application A's proxy gateway can receive application B's routing identifier, port 8082, IP address 2.2.2.2, and protocol HTTPS from the second server through the registration interface.
[0127] Step 310: Parse and obtain the route identifier.
[0128] In one possible implementation, the proxy gateway parses the first access request and obtains the route identifier b_route for application B.
[0129] Step 312: Locate information about application B in the instance manager.
[0130] In one possible implementation, the proxy gateway looks up the port, IP address, and protocol of the application B registered in step 304, step 306, or step 308 in the instance manager based on the route identifier b_route of application B.
[0131] Step 314: Generate a second access request.
[0132] In one possible implementation, the proxy gateway constructs a second access request, https: / / 2.2.2.2:8082 / index.html, based on the port, IP address, and protocol of application B. Figure 2 (Second access request in the embodiment).
[0133] Step 316: Decrypt the cookie.
[0134] In one possible implementation, the proxy gateway converts encrypted cookie information into decrypted cookie information based on a mapping table of encrypted and decrypted cookie information stored in the instance manager, thereby enabling the proxy gateway to decrypt the cookie information.
[0135] Step 318: Send a second access request.
[0136] In one possible implementation, the proxy gateway sends the second access request to application B after constructing the second access request.
[0137] Step 320: Application B responds to the second access request.
[0138] Step 322: Encrypt the cookie.
[0139] In one possible implementation, the proxy gateway receives the response information from step 322 and obtains the original cookie name from the response information (i.e., Figure 2 The second user login name in the embodiment), cookie path (i.e. Figure 2 The second user login path in the embodiment), the original cookie value (i.e. Figure 2 The original cookie information (i.e., the second user login value in the embodiment) Figure 2 (Second user login information in the embodiment).
[0140] Take the route identifier b_route from application B, concatenate it with the IP address, port number, and the original cookie name, and encrypt and perturb it to form a string, such as b_route_121314abc. This string will be used as the converted cookie name (i.e., ...). Figure 2 (First user login name in the embodiment).
[0141] The converted cookie name and the original cookie name are stored in a map mapping table in memory (i.e., Figure 2 (The login name relationship table in the embodiment) is provided for subsequent queries.
[0142] The original cookie value obtained from the response is encrypted, and the encrypted cookie value is used as the transformed cookie value (i.e., Figure 2(First user login value in the embodiment).
[0143] The converted cookie value and the original cookie value are stored in a map mapping table in memory (i.e., Figure 2 (The login value relationship table in the embodiment) is provided for subsequent queries.
[0144] Modify the original cookie path to / proxy / +B application route identifier+original cookie path, such as / proxy / b_route / +original cookie path (i.e. Figure 2 (Second user login path in the embodiment).
[0145] Application A uses the HTTP protocol (i.e., ... Figure 2 In the case of non-secure transmission protocols in the embodiments, the secure attribute of cookies (i.e. Figure 2 In the embodiment, the security attribute is set, with secure set to false (i.e., ...). Figure 2 The second state in the embodiment); in application A using the HTTPS protocol (i.e. Figure 2 In the case of a secure transmission protocol in the embodiment, the secure attribute of the cookie is set to true (i.e., Figure 2 (First state in the embodiment).
[0146] Write the converted cookie information into the request response.
[0147] Step 324, End.
[0148] The response will be returned to the user.
[0149] Corresponding to the above method embodiments, this specification also provides embodiments of an access processing apparatus. Figure 4 A schematic diagram of an access processing apparatus according to an embodiment of this specification is shown. Figure 4 As shown, the device includes:
[0150] The receiving module 420 is configured to receive the first access request sent by the user terminal;
[0151] The parsing module 440 is configured to parse the first access request, and, upon obtaining the service identifier of the second server, search for the target access information of the second server from the cache space based on the service identifier.
[0152] Module 460 is configured to construct a second access request based on the target access information;
[0153] The forwarding module 480 is configured to send the second access request to the second server so that the second server can respond to the second access request.
[0154] Optionally, the device further includes a registration module configured to, in response to a registration request sent by the second server, obtain target access information and service identifier of the second server; and associate the target access information with the service identifier and store them in the cache space.
[0155] Optionally, the registration module is further configured to read the target access information and service identifier of the second server from a registration file, wherein the registration file is used to record the target access information and service identifier written by the second server when initiating the registration request; or, read the target access information and service identifier of the second server from a registration data table, wherein the registration data table is used to record the target access information and service identifier written by the second server when initiating the registration request; or, receive the target access information and service identifier input by the second server through the registration interface.
[0156] Optionally, the construction module 460 is further configured to read the first user login information from the first access request; find the second user login information corresponding to the first user login information, wherein there is a corresponding conversion relationship between the first user login information and the second user login information; and construct a second access request based on the target access information and the second user login information.
[0157] Optionally, the construction module 460 is further configured to: search for a second user login name corresponding to the first user login name from a login name relationship table based on the first user login name, wherein the login name relationship table is constructed based on the login name used to access the second server; and search for a second user login value corresponding to the first user login value from a login value relationship table based on the first user login value, wherein the login value relationship table is constructed based on the login value used to access the second server.
[0158] Optionally, the construction module 460 is further configured to parse the first user login path to obtain a second user login path, wherein the first user login path is obtained by converting the login path for accessing the second server.
[0159] Optionally, the construction module 460 is further configured to receive response information from the second server in response to the third access request; read the second user login name and the second user login value from the response information; convert the second user login name to obtain the first user login name, and convert the second user login value to obtain the first user login value; store the first user login name and the second user login name in a login name relationship table, and store the first user login value and the second user login value in a login value relationship table.
[0160] Optionally, the construction module 460 is further configured to obtain the service identifier and target access information of the second server; concatenate the service identifier, the target access information and the second user login name, and encrypt the concatenated string to obtain the first user login name.
[0161] Optionally, the construction module 460 is further configured to encrypt the second user login value to obtain the first user login value.
[0162] Optionally, the construction module 460 is further configured to determine the first user login information based on the first user login name and the first user login value, and write the first user login information into the response information; and feed the response information back to the user terminal so that the user terminal stores the first user login name and the first user login value required to access the second server.
[0163] Optionally, the construction module 460 is further configured to obtain the transmission protocol used by the first server; if the transmission protocol is a secure transmission protocol, set the security attribute of the first user login information to a first state; if the transmission protocol is a non-secure transmission protocol, set the security attribute of the first user login information to a second state.
[0164] This specification provides an access processing apparatus applied to a processing unit of a first server. The processing unit includes a cache space, in which access information registered by other servers is pre-stored. The apparatus includes: a receiving module 420 for receiving a first access request sent by a user terminal; a parsing module 440 for parsing the first access request, and, upon obtaining a service identifier of a second server, searching for target access information of the second server in the cache space based on the service identifier; a construction module 460 for constructing a second access request based on the target access information; and a forwarding module 480 for sending the second access request to the second server so that the second server can respond to the second access request. By pre-storing access information registered by the second server in the processing unit of the first server, a second access request is constructed based on the first access request carrying the service identifier of the second server, and then the second access request is forwarded to the second server. On the one hand, this ensures that the front end of the first server only sends requests to the back end of the first server. Since the front end and back end of the first server are in the same domain, the cross-domain problem caused by the front end of the first server directly sending requests to the second server is avoided. On the other hand, in scenarios with multiple second servers, only the corresponding second access request needs to be constructed for the service identifier of different second servers, thus eliminating the need to configure nginx response for each second server, reducing resource consumption and server maintenance costs. Furthermore, in scenarios with multiple second servers, the name, path, and other attributes of user login information are transformed, avoiding the problem of user login information being overwritten when the name, path, and other attributes of user login information are the same across multiple second servers.
[0165] The above is an illustrative scheme of an access processing device according to this embodiment. It should be noted that the technical solution of this access processing device and the technical solution of the access processing method described above belong to the same concept. For details not described in detail in the technical solution of the access processing device, please refer to the description of the technical solution of the access processing method described above.
[0166] Figure 5 A structural block diagram of a computing device according to an embodiment of this specification is shown. The components of the computing device 500 include, but are not limited to, a memory 510 and a processor 520. The processor 520 is connected to the memory 510 via a bus 530, and a database 550 is used to store data.
[0167] The computing device 500 also includes an access device 540, which enables the computing device 500 to communicate via one or more networks 560. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 540 may include one or more of any type of wired or wireless network interface (e.g., Network Interface Controller (NIC)), such as an IEEE 802.11 Wireless Local Area Networks (WLAN) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.
[0168] In one embodiment of this specification, the above-described components of the computing device 500 and Figure 5 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 5 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0169] The computing device 500 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or PCs. The computing device 500 can also be a mobile or stationary server.
[0170] The processor 520 is configured to execute the following computer-executable instructions to implement the following method:
[0171] Receive the first access request sent by the user client;
[0172] Parse the first access request, and if the service identifier of the second server is obtained, search for the target access information of the second server in the cache space based on the service identifier;
[0173] Construct a second access request based on the target access information;
[0174] The second access request is sent to the second server so that the second server can respond to the second access request.
[0175] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the access processing method described above belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the access processing method described above.
[0176] An embodiment of this specification also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, are used to implement the steps of the access processing method described above.
[0177] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the access processing method described above belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the access processing method described above.
[0178] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0179] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0180] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this specification is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this specification. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this specification.
[0181] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0182] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. These embodiments have been selected and specifically described in this specification to better explain the principles and practical applications of this specification, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. An access processing method, characterized in that, A processing unit applied to a first server, the processing unit including a cache space, the cache space pre-stores access information registered by other servers, the method including: In response to a registration request sent by a second server, the target access information and service identifier of the second server are obtained, and the target access information and the service identifier are associated and stored in the cache space. Receive the second user login information sent by the second server; the second user login information includes the second user login name and the second user login value. The second user login information is encrypted to form the first user login information; the first user login information includes a first user login name and a first user login value; wherein, the first user login name is obtained by concatenating the service identifier, the target access information and the second user login name to form a string and then encrypting the string; The conversion relationship table between the first user login information and the second user login information is stored in the cache space; The first user login information is sent to the user terminal for storage. The system receives a first access request sent by the user terminal, wherein the first access request is a request initiated by the user terminal for the front end of the first server to access the resources of the second server, the first access request includes the service identifier of the second server and the first user login information, and the first access request does not contain the target access information of the second server. Parse the first access request, and if the service identifier of the second server is obtained, search for the target access information of the second server in the cache space based on the service identifier; Parse the first access request to obtain the first user login information, and look up the second user login information corresponding to the first user login information according to the conversion relationship table in the cache space; A second access request is constructed based on the target access information and the second user login information, wherein the second access request is an access request sent by the processing unit of the first server to the second server; The second access request is sent to the second server so that the second server can respond to the second access request.
2. The access processing method according to claim 1, characterized in that, Obtaining the target access information and service identifier of the second server includes: Read the target access information and service identifier of the second server from the registration file, wherein the registration file is used to record the target access information and service identifier written by the second server when initiating the registration request; or... Read the target access information and service identifier of the second server from the registration data table, wherein the registration data table is used to record the target access information and service identifier written by the second server when initiating the registration request; or... Receive the target access information and service identifier input by the second server through the registration interface.
3. The access processing method according to claim 1, characterized in that, The step of finding the second user login information corresponding to the first user login information includes: Based on the first user login name, find the second user login name corresponding to the first user login name from the login name relationship table, wherein the login name relationship table is constructed based on the login name for accessing the second server; Based on the first user login value, the second user login value corresponding to the first user login value is found from the login value relationship table, wherein the login value relationship table is constructed based on the transformation of the login value for accessing the second server.
4. The access processing method according to claim 3, characterized in that, The first user login information also includes a first user login path, and the second user login information also includes a second user login path; the method further includes: The first user login path is parsed to obtain the second user login path, wherein the first user login path is obtained by converting the login path for accessing the second server.
5. The access processing method according to claim 4, characterized in that, The receipt of the second user login information sent by the second server includes: Receive the response information from the second server in response to the third access request; Read the second user login name and the second user login value from the response information; The step of encrypting the second user login information into the first user login information includes: The second user login name is converted to obtain the first user login name, and the second user login value is converted to obtain the first user login value; The step of storing the conversion relationship table between the first user login information and the second user login information into the cache space includes: Store the first user login name and the second user login name in the login name relationship table, and store the first user login value and the second user login value in the login value relationship table.
6. The access processing method according to claim 5, characterized in that, The step of converting the second user login value to obtain the first user login value includes: The second user login value is encrypted to obtain the first user login value.
7. The access processing method according to any one of claims 5-6, characterized in that, Sending the first user login information to the user terminal for storage includes: The first user login information is determined based on the first user login name and the first user login value, and the first user login information is written into the response information; The response information is fed back to the user terminal so that the user terminal stores the first user login name and the first user login value required to access the second server.
8. The access processing method according to claim 7, characterized in that, Before sending the response information back to the user terminal, the method further includes: Obtain the transmission protocol used by the first server; When the transmission protocol is a secure transmission protocol, the security attribute of the first user login information is set to a first state; If the transmission protocol is a non-secure transmission protocol, the security attribute of the first user login information is set to the second state.
9. An access processing apparatus, characterized in that, A processing unit applied to a first server, the processing unit including a cache space, the cache space pre-stores access information registered by other servers, the device comprising: The registration module is configured to respond to a registration request sent by the second server, obtain the target access information and service identifier of the second server, and associate the target access information and the service identifier in the cache space; The receiving module is configured to receive second user login information sent by the second server; the second user login information includes a second user login name and a second user login value. The information processing module is configured to encrypt the second user login information into first user login information; the first user login information includes a first user login name and a first user login value; wherein, the first user login name is obtained by concatenating the service identifier, the target access information and the second user login name into a string and then encrypting the string; The storage module is configured to store a conversion relationship table between the first user login information and the second user login information into the cache space; The sending module is configured to send the first user login information to the user terminal for storage by the user terminal; The receiving module is further configured to receive a first access request sent by the user terminal, wherein the first access request is a request initiated by the user terminal for the front end of the first server to access the resources of the second server, the first access request includes the service identifier of the second server and the first user login information, and the first access request does not contain the target access information of the second server. The parsing module is used to parse the first access request, and if the service identifier of the second server is obtained, to search for the target access information of the second server in the cache space based on the service identifier; and to parse the first access request to obtain the first user login information, and to search for the second user login information corresponding to the first user login information according to the conversion relationship table in the cache space. The construction module is used to construct a second access request based on the target access information and the second user login information, wherein the second access request is an access request sent by the processing unit of the first server to the second server; The forwarding module is used to send the second access request to the second server so that the second server can respond to the second access request.
10. A computing device, characterized in that, include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the access processing method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, It stores computer instructions that, when executed by a processor, implement the access processing method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Cross-domain access implementation method and system for browser in application program
CN112261111A
Cross-domain access control method, electronic equipment and storage medium
CN114282240A
