Access request processing method and device, processor and electronic device

By verifying and generating access requests between a non-distributed architecture system with stateless sessions and a distributed architecture system with stateless sessions, the problem of maintaining a valid session between the two is solved, and efficient access processing is achieved.

CN115865717BActive Publication Date: 2025-03-18INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211491385.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-25
Publication Date
2025-03-18
Estimated Expiration
2042-11-25

AI Technical Summary

Technical Problem

The prior art is difficult to maintain an active session between a non-distributed architecture system with stateful sessions and a distributed architecture system with stateless sessions.

Method used

By obtaining the first access request of the target object, verifying its session ID, and after the verification is passed, a second access request is generated. The request contains attribute information of the non-distributed architecture system and data of the first access request for session validation in the distributed architecture system.

Benefits of technology

It realizes the maintenance of sessions between a non-distributed architecture system with a stateless session and a distributed architecture system with a stateless session, improves access processing efficiency, and does not need to transform the traditional stateful session system into a stateless session system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115865717B_ABST
    Figure CN115865717B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for processing access requests, a processor and an electronic device, and relates to the field of financial technology. The method includes: obtaining a first access request of a target object; verifying a first session ID in the first access request, and when the first session ID is verified, generating a second access request based on the attribute information of a non-distributed architecture system and the first access request; sending the second access request to a distributed architecture system, so as to verify the session validity of the second access request through the distributed architecture system, and when the session validity verification is passed, calling the target API method based on the uniform resource locator of the target API method. Through the present application, the problem that a valid session cannot be maintained between a non-distributed architecture system with a stateful session and a distributed architecture system with a stateless session in the related art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of financial technology, and in particular to a method and device for processing an access request, a processor, and an electronic device. Background Art

[0002] With the development, various integrated management systems have evolved from the original single system to the current application group composed of multiple subsystems. The multiple subsystems have the traditional jsp (java server interface) + servlet (server-side program written in java) architecture, and the front-end and back-end separated vue (JavaScript architecture for building user interfaces) + springboot (an open source application architecture on the Java platform) architecture. In the traditional jsp+servlet architecture, the session is created by the server and stored in the server memory. This kind of session that saves the user status on the server is a stateful session. If the stateful session service is to be expanded horizontally, it needs to rely on the load balancer to load the same user's request to the same server each time. The new subsystem adopts the front-end and back-end separated vue+springboot and distributed architecture. It persists the session to the mysql database or Redis (a KV database). This kind of server itself does not store the user status is a stateless session, and different servers and containers can share the session. In actual applications, since the traditional architecture system (i.e., non-distributed architecture system) hopes to gradually migrate various functions to the highly available and easily scalable distributed architecture system (new subsystem), there are scenarios where the traditional architecture page jumps / embeds the vue page (new front-end) of the new subsystem (distributed architecture system with separated front-end and back-end) and the traditional architecture page calls the new subsystem back-end API method (new back-end). This requires a session verification mechanism between the traditional architecture system with stateful sessions and the distributed architecture system with stateless sessions.

[0003] With respect to the problem in the related art that a valid session cannot be maintained between a non-distributed architecture system with a stateful session and a distributed architecture system with a stateless session, no effective solution has been proposed so far. Summary of the invention

[0004] The main purpose of the present application is to provide a method and device for processing access requests, a processor and an electronic device to solve the problem in the related art that a valid session cannot be maintained between a non-distributed architecture system with stateful sessions and a distributed architecture system with stateless sessions.

[0005] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for processing an access request is provided. The method comprises: obtaining a first access request of a target object, wherein the first access request is used to request an API method in a distributed architecture system, and the first access request at least includes a uniform resource locator and a first session ID of the target API method, wherein the first session ID is obtained when the target object logs in to the non-distributed architecture system; verifying the first session ID in the first access request, and when the first session ID is verified, generating a second access request based on the attribute information of the non-distributed architecture system and the first access request; sending the second access request to the distributed architecture system, so as to perform session validity verification on the second access request through the distributed architecture system, and when the session validity verification is passed, calling the target API method based on the uniform resource locator of the target API method.

[0006] Furthermore, before obtaining the first access request for the target object, the method also includes: obtaining a login request for the target object to log in to the non-distributed architecture system; creating a target session and a second session ID corresponding to the target session based on the login request; and storing the target session and the second session ID corresponding to the target session in the non-distributed architecture system.

[0007] Furthermore, verifying the first session ID in the first access request includes: reading the second session ID from the non-distributed architecture system; determining whether the first session ID is the same as the second session ID; if the first session ID is the same as the second session ID, the verification of the first session ID is passed; if the first session ID is not the same as the second session ID, the verification of the first session ID fails.

[0008] Furthermore, when the first session ID is verified, a second access request is generated based on the attribute information of the non-distributed architecture system and the first access request, including: encapsulating the data information in the first access request to obtain a first data packet; obtaining the attribute information of the non-distributed architecture system, the IP address of the target object, and the service name requested by the target object, wherein the attribute information includes at least: the IP address of the non-distributed architecture system, the port of the non-distributed architecture system; encapsulating the attribute information of the non-distributed architecture system, the IP address of the target object, and the service name requested by the target object to obtain a second data packet; obtaining the second access request through the first data packet and the second data packet.

[0009] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for processing an access request is provided. The method comprises: obtaining a second access request, wherein the second access request is obtained based on the attribute information of the non-distributed architecture system and the first access request, the first access request is used to request an API method in a distributed architecture system, and the first access request includes at least a uniform resource locator and a first session ID of the target API method, wherein the first session ID is obtained when the target object logs in to the non-distributed architecture system; performing session validity verification on the second access request; when the session validity verification of the second access request passes, calling the target API method based on the uniform resource locator of the target API method.

[0010] Furthermore, performing session validity verification on the second access request includes: obtaining a session table stored in a database corresponding to the distributed architecture system, wherein the session table is used to store valid sessions and a third session ID corresponding to the valid sessions; determining whether there is a third session ID identical to the first session ID in the session table; if there is a third session ID identical to the first session ID in the session table, the session validity verification of the second access request is passed.

[0011] Furthermore, after determining whether there is a third session ID identical to the first session ID in the session table, the method further includes: if there is no third session ID identical to the first session ID in the session table, obtaining target data information from the second access request, wherein the target data information at least includes: attribute information of the non-distributed architecture system, the IP address of the target object, and the service name requested by the target object; performing splicing based on the target data information to obtain a uniform resource locator of the non-distributed architecture system; accessing the non-distributed architecture system based on the uniform resource locator of the non-distributed architecture system to determine whether the non-distributed architecture system stores a fourth session ID identical to the first session ID; if the non-distributed architecture system stores a fourth session ID identical to the first session ID, determining that the session of the second access request passes the validity verification, and storing the first session ID in the session table.

[0012] Furthermore, after determining whether the non-distributed architecture system stores a fourth session ID that is identical to the first session ID, the method also includes: if the non-distributed architecture system does not store a fourth session ID that is identical to the first session ID, determining that the session corresponding to the second access request has expired, and displaying an invalid access interface to the target object.

[0013] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a device for processing access requests is provided. The device includes: a first acquisition unit, used to acquire a first access request of a target object, wherein the first access request is used to request an API method in a distributed architecture system, and the first access request includes at least a uniform resource locator and a first session ID of the target API method, wherein the first session ID is obtained when the target object logs in to the non-distributed architecture system; a first verification unit, used to verify the first session ID in the first access request, and when the first session ID is verified, generate a second access request based on the attribute information of the non-distributed architecture system and the first access request; a sending unit, used to send the second access request to the distributed architecture system, so as to perform session validity verification on the second access request through the distributed architecture system, and when the session validity verification is passed, call the target API method based on the uniform resource locator of the target API method.

[0014] Furthermore, the device also includes: a second acquisition unit, used to obtain a login request for the target object to log into the non-distributed architecture system before obtaining a first access request for the target object; a creation unit, used to create a target session and a second session ID corresponding to the target session based on the login request; and a storage unit, used to store the target session and the second session ID corresponding to the target session in the non-distributed architecture system.

[0015] Furthermore, the first verification unit includes: a reading module, used to read the second session ID from the non-distributed architecture system; a first judgment module, used to judge whether the first session ID is the same as the second session ID; a first determination module, used to pass the verification of the first session ID if the first session ID is the same as the second session ID; and a second determination module, used to fail the verification of the first session ID if the first session ID is not the same as the second session ID.

[0016] Furthermore, the first verification unit also includes: a first encapsulation module, used to encapsulate the data information in the first access request to obtain a first data packet; a first acquisition module, used to obtain the attribute information of the non-distributed architecture system, the IP address of the target object and the service name requested by the target object, wherein the attribute information at least includes: the IP address of the non-distributed architecture system, the port of the non-distributed architecture system; a second encapsulation module, used to encapsulate the attribute information of the non-distributed architecture system, the IP address of the target object and the service name requested by the target object to obtain a second data packet; a third determination module, used to obtain the second access request through the first data packet and the second data packet.

[0017] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a device for processing access requests is provided. The device includes: a second acquisition unit, used to acquire a second access request, wherein the second access request is obtained based on the attribute information of the non-distributed architecture system and the first access request, wherein the first access request is used to request an API method in a distributed architecture system, and the first access request includes at least a uniform resource locator and a first session ID of the target API method, wherein the first session ID is obtained when the target object logs in to the non-distributed architecture system; a second verification unit, used to perform session validity verification on the second access request; and a calling unit, used to call the target API method based on the uniform resource locator of the target API method when the session validity verification of the second access request passes.

[0018] Furthermore, the second verification unit includes: a second acquisition module, used to acquire a session table stored in a database corresponding to the distributed architecture system, wherein the session table is used to store valid sessions and a third session ID corresponding to the valid sessions; a second judgment module, used to judge whether there is a third session ID identical to the first session ID in the session table; and a fourth determination module, used to verify the session validity of the second access request if there is a third session ID identical to the first session ID in the session table.

[0019] Further, the device also includes: after determining whether there is a third session ID identical to the first session ID in the session table, if there is no third session ID identical to the first session ID in the session table, obtaining target data information from the second access request, wherein the target data information at least includes: attribute information of the non-distributed architecture system, the IP address of the target object, and the service name requested by the target object; performing splicing based on the target data information to obtain a uniform resource locator of the non-distributed architecture system; accessing the non-distributed architecture system based on the uniform resource locator of the non-distributed architecture system to determine whether the non-distributed architecture system stores a fourth session ID identical to the first session ID; if the non-distributed architecture system stores a fourth session ID identical to the first session ID, determining that the session of the second access request passes the validity verification, and storing the first session ID in the session table.

[0020] Furthermore, after determining whether the non-distributed architecture system stores a fourth session ID that is identical to the first session ID, the device also includes: if the non-distributed architecture system does not store a fourth session ID that is identical to the first session ID, determining that the session corresponding to the second access request has expired, and displaying an invalid access interface to the target object.

[0021] In order to achieve the above objective, according to one aspect of the present application, a processor is provided, and the processor is used to run a program, wherein the program executes any one of the above-mentioned methods for processing access requests when running.

[0022] In order to achieve the above-mentioned purpose, according to one aspect of the present application, an electronic device is provided, the electronic device includes one or more processors and a memory, and the memory is used to store a processing method for the one or more processors to implement any of the access requests described above.

[0023] Through the present application, the following steps are adopted: obtaining a first access request for a target object, wherein the first access request is used to request an API method in a distributed architecture system, and the first access request includes at least a uniform resource locator and a first session ID of the target API method, wherein the first session ID is obtained when the target object logs in to a non-distributed architecture system; verifying the first session ID in the first access request, and when the first session ID is verified, generating a second access request based on attribute information of the non-distributed architecture system and the first access request; sending the second access request to the distributed architecture system to perform session validity verification on the second access request through the distributed architecture system, and when the session validity verification is passed, calling the target API method based on the uniform resource locator of the target API method, thereby solving the problem in the related art that a valid session cannot be maintained between a non-distributed architecture system with a stateful session and a distributed architecture system with a stateless session. In this solution, when the target object is accessed through a non-distributed architecture system, the non-distributed architecture system verifies that the first session ID is valid, and then obtains a second access request through the attribute information of the non-distributed architecture system and the first access request. The distributed architecture system verifies the session validity of the second access request, thereby maintaining a session between the non-distributed architecture system with a stateful session and the distributed architecture system with a stateless session, without the need to transform the traditional stateful session system into a stateless session system, thereby achieving the effect of improving access processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0025] Figure 1 It is a schematic diagram of maintaining a session state in a non-distributed architecture system and maintaining a session state in a distributed architecture system in the prior art;

[0026] Figure 2 The following is a flow chart of a method for processing an access request according to an embodiment of the present application. Figure 1 ;

[0027] Figure 3 It is a schematic diagram of access between a non-distributed architecture system and a distributed architecture system provided according to an embodiment of the present application;

[0028] Figure 4 The following is a flow chart of an optional access request processing method provided in an embodiment of the present application. Figure 1 ;

[0029] Figure 5 The following is a flow chart of a method for processing an access request according to an embodiment of the present application. Figure 2;

[0030] Figure 6 The following is a flow chart of an optional access request processing method provided in an embodiment of the present application. Figure 2 ;

[0031] Figure 7 Schematic diagram of an access request processing device provided according to an embodiment of the present application Figure 1 ;

[0032] Figure 8 Schematic diagram of an access request processing device provided according to an embodiment of the present application Figure 2 ;

[0033] Fig. 9 is a schematic diagram of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0034] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0035] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0036] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0037] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:

[0038] Stateful session: A session in which the server saves the user's state.

[0039] Stateless session: The server itself does not store user status. Different servers and containers can share sessions. Sessions can be saved in MySQL databases, Redis, etc.

[0040] Single sign-on: Users only need to log in once to access all mutually trusted application systems.

[0041] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties. For example, an interface is set between this system and the relevant user or organization. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.

[0042] Specifically, in a traditional architecture system with stateful sessions (non-distributed architecture system), the server saves the session in the server memory after the user logs in. A distributed architecture system with stateless sessions is essentially multiple systems, such as Figure 1 As shown in the figure, suppose there are two server nodes, namely, system A and system B. At the beginning, the user interacts with system A. At this time, the user's session can be saved to the database or Redis. Then the user's request reaches system B, and the session in system B can also be obtained from the database or Redis. In order to maintain the session between the traditional architecture system with stateful session and the distributed architecture system with stateless session, a method for processing access requests is proposed.

[0043] The present invention is described below in conjunction with preferred implementation steps. Figure 2 The following is a flow chart of a method for processing an access request according to an embodiment of the present application. Figure 1 ,like Figure 2 As shown, the method comprises the following steps:

[0044] Step S201, obtaining a first access request of a target object, wherein the first access request is used to request an API method in a distributed architecture system, and the first access request at least includes a uniform resource locator of the target API method and a first session ID, wherein the first session ID is obtained when the target object logs in to a non-distributed architecture system;

[0045] Step S202, verifying the first session ID in the first access request, and generating a second access request based on the attribute information of the non-distributed architecture system and the first access request when the first session ID is verified;

[0046] Step S203, sending the second access request to the distributed architecture system so as to perform session validity verification on the second access request through the distributed architecture system, and when the session validity verification passes, calling the target API method according to the uniform resource locator of the target API method.

[0047] Specifically, Figure 3 As shown, the method of non-distributed front-end requesting distributed new back-end API method is transformed. The target object initiates a first access request through the non-distributed architecture system, and the non-distributed architecture system verifies the session validity of the first session ID in the first access request, and generates a second access request based on the attribute information of the non-distributed architecture system and the first access request when the first session ID is verified.

[0048] For example, an example of a first access request is as follows:

[0049] / forwardReq?sessionId=xxxxxx, requesturl= / data / query?sessionId=xxxxxx. The data corresponding to Requesturl is the URL (Uniform Resource Locator) of the API method actually requested.

[0050] An example of a second access request is as follows:

[0051] {"publicData":"{"clientSystemId":"cloam","clientSystemIp":"122.67.29.100:43488","clientUserIp":"122.67.29.100"}","privateData":"{"planId":"000001"}, where the non-distributed architecture system ip and port are the data corresponding to clientSystemIp, the target object's ip is the data corresponding to clientUserIp, the requested service name is the data corresponding to clientSystemId, and "privateData":"{"planId":"000001"} is the actual requested API method of the target object.

[0052] When receiving the second access request, the non-distributed architecture system will send the second access request to the distributed architecture system. Through the second access request, the non-distributed architecture system ip and port, and the requested service name are sent to the distributed architecture system for subsequent session validity verification. After receiving the second access request, the distributed architecture system checks whether the first session ID exists in the distributed architecture system. If it exists, it directly indicates that the session is valid. If it does not exist, the url used for session handshake verification is spliced ​​according to the clientSystemId, ip and port clientSystemIp in the input parameter publicData in the second access request. Different clientSystemIds request different checkSession links. Taking the previous request parameter example, the spliced ​​url is http: / / 122.67.29.100:43488 / cloam / checkSession. The corresponding non-distributed architecture system is accessed according to the url to determine the validity of the session.

[0053] After confirming the validity of the session, directly call the specific API method. For all subsequent requests, the session will remain valid as long as the non-distributed architecture system session where the session is located has not expired.

[0054] To summarize, in this solution, when the target object is accessed through a non-distributed architecture system, the non-distributed architecture system verifies that the first session ID is valid, and then obtains a second access request through the attribute information of the non-distributed architecture system and the first access request. The distributed architecture system verifies the session validity of the second access request, thereby maintaining a session between a non-distributed architecture system with a stateful session and a distributed architecture system with a stateless session, without the need to transform a traditional stateful session system into a stateless session system.

[0055] Optionally, in the access request processing method provided in the embodiment of the present application, before obtaining the first access request of the target object, the method also includes: obtaining a login request for the target object to log in to the non-distributed architecture system; creating a target session and a second session ID corresponding to the target session based on the login request; and storing the target session and the second session ID corresponding to the target session in the non-distributed architecture system.

[0056] Specifically, for a non-distributed architecture system, when a user logs in, a session is created and stored in the non-distributed architecture system to ensure the validity of the session. The above steps ensure the validity of the session in the non-distributed architecture system.

[0057] Optionally, in the access request processing method provided in the embodiment of the present application, verifying the first session ID in the first access request includes: reading the second session ID from the non-distributed architecture system; determining whether the first session ID is the same as the second session ID; if the first session ID is the same as the second session ID, the verification of the first session ID passes; if the first session ID is not the same as the second session ID, the verification of the first session ID fails.

[0058] Specifically, when the non-distributed architecture system verifies the first session ID in the first access request, it includes: determining whether there is a second session ID that is the same as the first session ID in the session IDs stored in the non-distributed architecture system; if the second session ID that is the same as the first session ID is not stored in the non-distributed architecture system, it means that the session for the target object has expired, the target object has no right to access the system anymore, and the target object needs to log in to the system again; if the second session ID that is the same as the first session ID is stored in the non-distributed architecture system, it means that the session for the target object is valid, that is, the above-mentioned verification of the first session ID is passed.

[0059] In summary, the above steps ensure that the operation of the target object is based on a valid session and is safe and controllable.

[0060] Optionally, in the access request processing method provided in the embodiment of the present application, when the first session ID is verified, generating a second access request based on the attribute information of the non-distributed architecture system and the first access request includes: encapsulating the data information in the first access request to obtain a first data packet; obtaining the attribute information of the non-distributed architecture system, the IP address of the target object, and the service name requested by the target object, wherein the attribute information includes at least: the IP address of the non-distributed architecture system, the port of the non-distributed architecture system; encapsulating the attribute information of the non-distributed architecture system, the IP address of the target object, and the service name requested by the target object to obtain a second data packet; obtaining a second access request through the first data packet and the second data packet.

[0061] Specifically, when the non-distributed architecture system verifies the first session ID, it encapsulates the data information in the first access request to obtain a first data packet, encapsulates the attribute information of the non-distributed architecture system, the IP address of the target object, and the service name requested by the target object to obtain a second data packet, and finally assembles the first data packet and the second data packet to obtain a second access request.

[0062] For example, an example of the first access request is as follows: / forwardReq?sessionId=xxxxxx,requesturl= / data / query?sessionId=xxxxxx. The data corresponding to requesturl is the API method url (Uniform Resource Locator) actually requested.

[0063] An example of a second access request is as follows:

[0064] {"publicData":"{"clientSystemId":"cloam","clientSystemIp":"122.67.29.100:43488","clientUserIp":"122.67.29.100"}","privateData":"{"planId":"000001"}, where the non-distributed architecture system ip and port are the data corresponding to clientSystemIp, the target object ip is the data corresponding to clientUserIp, the requested service name is the data corresponding to clientSystemId, and "privateData":"{"planId":"000001"} is the actual requested API method of the target object. It should be noted that "publicData" is the second data packet mentioned above, and "privateData" is the first data packet mentioned above.

[0065] When receiving the second access request, the non-distributed architecture system will send the second access request to the distributed architecture system. Through the second access request, the server IP and port, and the requested service name are sent to the distributed architecture system for subsequent session validity verification. After receiving the second access request, the distributed architecture system checks whether the first session ID exists in the distributed architecture system. If it exists, it directly indicates that the session is valid. If it does not exist, the URL used for session handshake verification is spliced ​​according to the clientSystemId, IP, and port clientSystemIp in the input parameter publicData in the second access request. Different clientSystemIds request different checkSession links. Taking the previous request parameter example, the spliced ​​URL is http: / / 122.67.29.100:43488 / cloam / checkSession. The corresponding non-distributed architecture system is accessed according to the URL to determine the validity of the session.

[0066] In an optional embodiment, the following may be used: Figure 4The flowchart shown implements the processing of access requests, and takes the following architecture as an example for explanation: Java language and springboot framework are used. In the implementation of this distributed architecture system, sessions are stored in mysql database. A session table is created in mysql database to store the current valid session, and the primary key is session_id. The table fields record the user (user_id), request IP address (visit_ip), login system (logon_sys), user system information (sysCtx), user information (usrCtx), etc. of the session.

[0067] Taking the traditional non-distributed architecture system cloam system as an example, the original client directly requests the new backend API method, and all requests are unified into a proxy method, such as Figure 4 As shown. The url of the API method actually requested is used as the parameter requesturl. For example, if you request / data / query?sessionId=xxxxxx, after the transformation, you can request / forwardReq?sessionId=xxxxxx,requesturl= / data / query?sessionId=xxxxxx. The specific process of this proxy method is as follows:

[0068] (1) Non-distributed architecture system verification session.

[0069] (2) After the session verification is passed, the original parameters are encapsulated into privateData, and then encapsulated into publicData, which contains the server IP and port (clientSystemIp), client user IP (clientUserIp), and service name (clientSystemId). Request parameter example:

[0070] {"publicData":"{"clientSystemId":"cloam","clientSystemIp":"122.67.29.100:43488","clientUserIp":"122.67.29.100"}","privateData":"{"planId":"000001"}

[0071] (3) Finally, the request is forwarded to the distributed architecture system.

[0072] In a distributed architecture system, session verification is added to the gateway aspect GatewayAspect and the filter AuthZuulPreFilter to ensure that each request is based on a valid session. The process is as follows:

[0073] (1) Check whether the sessionId exists in the session table. If it does, update the last access time in the table.

[0074] (2) If it does not exist, the URL used for session handshake verification is spliced ​​according to the service name (clientSystemId), server IP and port (clientSystemIp) in the publicData parameter. Different clientSystemIds request different checkSession links. Taking the previous request parameter example as an example, the spliced ​​URL is http: / / 122.67.29.100:43488 / cloam / checkSession. If the returned session is valid, the session handshake verification is passed and the session is stored in the session table.

[0075] (3) Session verification is passed and the API method is called. For all subsequent requests, as long as the server session where the session is located has not expired, the session remains valid.

[0076] The access request processing method provided in the embodiment of the present application obtains a first access request of the target object, wherein the first access request is used to request an API method in a distributed architecture system, and the first access request includes at least a uniform resource locator and a first session ID of the target API method, wherein the first session ID is obtained when the target object logs in to a non-distributed architecture system; verifies the first session ID in the first access request, and when the first session ID is verified, generates a second access request based on attribute information of the non-distributed architecture system and the first access request; sends the second access request to the distributed architecture system to verify the session validity of the second access request through the distributed architecture system, and when the session validity verification is passed, calls the target API method based on the uniform resource locator of the target API method, thereby solving the problem in the related art that a valid session cannot be maintained between a non-distributed architecture system with a stateful session and a distributed architecture system with a stateless session. In this solution, when the target object is accessed through a non-distributed architecture system, the non-distributed architecture system verifies that the first session ID is valid, and then obtains a second access request through the attribute information of the non-distributed architecture system and the first access request. The distributed architecture system verifies the session validity of the second access request, thereby maintaining a session between the non-distributed architecture system with a stateful session and the distributed architecture system with a stateless session, without the need to transform the traditional stateful session system into a stateless session system, thereby achieving the effect of improving access processing efficiency.

[0077] Figure 5 The following is a flow chart of a method for processing an access request according to an embodiment of the present application. Figure 2 ,like Figure 5 As shown, the method comprises the following steps:

[0078] Step S501, obtaining a second access request, wherein the second access request is obtained based on the attribute information of the non-distributed architecture system and the first access request, the first access request is used to request an API method in the distributed architecture system, and the first access request at least includes a uniform resource locator of a target API method and a first session ID, wherein the first session ID is obtained when the target object logs in to the non-distributed architecture system;

[0079] Step S502, performing session validity verification on the second access request;

[0080] Step S503: when the session validity verification of the second access request is passed, the target API method is called according to the uniform resource locator of the target API method.

[0081] Specifically, the target object initiates a first access request through the non-distributed architecture system. The non-distributed architecture system verifies the session validity of the first session ID in the first access request, and generates a second access request based on the attribute information of the non-distributed architecture system and the first access request when the first session ID is verified.

[0082] For example, an example of the first access request is as follows: / forwardReq?sessionId=xxxxxx,requesturl= / data / query?sessionId=xxxxxx. The data corresponding to requesturl is the api method url (Uniform Resource Locator) of the actual request.

[0083] An example of a second access request is as follows:

[0084] {"publicData":"{"clientSystemId":"cloam","clientSystemIp":"122.67.29.100:43488","clientUserIp":"122.67.29.100"}","privateData":"{"planId":"000001"}, where the non-distributed architecture system ip and port are the data corresponding to clientSystemIp, the target object's ip is the data corresponding to clientUserIp, the requested service name is the data corresponding to clientSystemId, and "privateData":"{"planId":"000001"} is the actual requested API method of the target object.

[0085] When receiving the second access request, the non-distributed architecture system will send the second access request to the distributed architecture system. Through the second access request, the server IP and port, and the requested service name are sent to the distributed architecture system for subsequent session validity verification. After receiving the second access request, the distributed architecture system checks whether the first session ID exists in the distributed architecture system. If it exists, it directly indicates that the session is valid. If it does not exist, the URL used for session handshake verification is spliced ​​according to the clientSystemId, IP, and port clientSystemIp in the input parameter publicData in the second access request. Different clientSystemIds request different checkSession links. Taking the previous request parameter example, the spliced ​​URL is http: / / 122.67.29.100:43488 / cloam / checkSession. The corresponding non-distributed architecture system is accessed according to the URL to determine the validity of the session.

[0086] After confirming the validity of the session, directly call the specific API method. For all subsequent requests, the session will remain valid as long as the non-distributed architecture system session where the session is located has not expired.

[0087] To summarize, the distributed architecture system verifies the session validity of the second access request, thereby maintaining the session between the non-distributed architecture system with stateful session and the distributed architecture system with stateless session, without the need to transform the traditional stateful session system into a stateless session system.

[0088] Optionally, in the access request processing method provided in the embodiment of the present application, performing session validity verification on the second access request includes: obtaining a session table stored in a database corresponding to the distributed architecture system, wherein the session table is used to store valid sessions and a third session ID corresponding to the valid sessions; determining whether there is a third session ID that is identical to the first session ID in the session table; if there is a third session ID that is identical to the first session ID in the session table, the session validity verification of the second access request is passed.

[0089] If there is no third session ID identical to the first session ID in the session table, obtain target data information from the second access request, wherein the target data information includes at least: attribute information of the non-distributed architecture system, the IP address of the target object, and the service name requested by the target object; perform splicing based on the target data information to obtain the uniform resource locator of the non-distributed architecture system; access the non-distributed architecture system based on the uniform resource locator of the non-distributed architecture system to determine whether the non-distributed architecture system stores a fourth session ID identical to the first session ID; if the non-distributed architecture system stores a fourth session ID identical to the first session ID, determine that the session of the second access request passes the validity verification, and store the first session ID in the session table.

[0090] If the non-distributed architecture system does not store a fourth session ID that is the same as the first session ID, it is determined that the session corresponding to the second access request has expired, and an invalid access interface is displayed to the target object.

[0091] Specifically, the distributed architecture system reads the session table stored in the database, and determines whether there is a third session ID that is the same as the first session ID in the session table; if there is a third session ID that is the same as the first session ID in the session table, the session validity verification of the second access request is passed. This step is to confirm whether the session and session ID corresponding to the second access request have been stored in the distributed architecture system.

[0092] If the distributed architecture system does not store the session and session ID corresponding to the second access request, then obtain the attribute information of the non-distributed architecture system, the IP address of the target object, the service name requested by the target object and other data information from the second access request, and then splice these data information to obtain the uniform resource locator of the non-distributed architecture system, access the non-distributed architecture system through the uniform resource locator of the non-distributed architecture system, and determine whether the non-distributed architecture system stores a fourth session ID that is the same as the first session ID. If the non-distributed architecture system stores a fourth session ID that is the same as the first session ID, then determine that the session of the second access request passes the validity verification, and store the first session ID in the session table. For all subsequent requests to the target object, as long as the non-distributed architecture system session where the session is located has not expired, the session will remain valid.

[0093] If the non-distributed architecture system does not store the fourth session ID that is the same as the first session ID, it is determined that the session ID of the second access request has expired.

[0094] The above steps realize maintaining the session between the traditional architecture system with stateful session and the distributed architecture system with stateless session.

[0095] In an optional embodiment, based on the technical basis of the above method, it is also possible to implement a page jump in a non-distributed architecture system\embed a new distributed architecture system vue page without the user having to log in again, such as Figure 6 As shown:

[0096] (1) In a non-distributed architecture system, a jsp (java server interface) transfer page is implemented, and all menu items that need to jump to / embed the new subsystem vue page are configured to jump to the transfer page uniformly.

[0097] (2) This jsp transfer page requests the distributed architecture system's login method in the same way as the API request method described above. If it returns a success (i.e., the session verification is passed and the login is successful in the distributed architecture system), the page is redirected to the distributed architecture system's vue page.

[0098] (3) The vue transfer page obtains session information from the distributed architecture system. After verification, it is routed to the actual vue page to display the actual vue page to the browser.

[0099] The processing method of the access request provided by the embodiment of the present application obtains a second access request, wherein the second access request is obtained based on the attribute information of the non-distributed architecture system and the first access request, the first access request is used to request the API method in the distributed architecture system, and the first access request at least includes the uniform resource locator of the target API method and the first session ID, wherein the first session ID is obtained when the target object logs in to the non-distributed architecture system; the session validity verification is performed on the second access request; when the session validity verification of the second access request is passed, the target API method is called based on the uniform resource locator of the target API method, thereby solving the problem that a valid session cannot be maintained between a non-distributed architecture system with a stateful session and a distributed architecture system with a stateless session in the related art. In this solution, when the target object is accessed through the non-distributed architecture system, after the non-distributed architecture system verifies that the first session ID is valid, the second access request is obtained through the attribute information of the non-distributed architecture system and the first access request, and the distributed architecture system verifies the session validity of the second access request, thereby realizing the maintenance of the session between the non-distributed architecture system with a stateful session and the distributed architecture system with a stateless session, and there is no need to transform the traditional stateful session system into a stateless session system, thereby achieving the effect of improving the access processing efficiency.

[0100] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0101] The embodiment of the present application also provides a device for processing access requests. It should be noted that the device for processing access requests in the embodiment of the present application can be used to execute the method for processing access requests provided in the embodiment of the present application. The device for processing access requests provided in the embodiment of the present application is introduced below.

[0102] Figure 7 Schematic diagram of an access request processing device according to an embodiment of the present application Figure 1 .like Figure 7 As shown, the device includes: a first acquisition unit 701, a first verification unit 702 and a sending unit 703.

[0103] A first acquisition unit 701 is used to acquire a first access request of a target object, wherein the first access request is used to request an API method in a distributed architecture system, and the first access request at least includes a uniform resource locator of the target API method and a first session ID, wherein the first session ID is obtained when the target object logs in to the non-distributed architecture system;

[0104] The first verification unit 702 is used to verify the first session ID in the first access request, and when the first session ID is verified, generate a second access request according to the attribute information of the non-distributed architecture system and the first access request;

[0105] The sending unit 703 is used to send the second access request to the distributed architecture system so as to perform session validity verification on the second access request through the distributed architecture system, and when the session validity verification passes, call the target API method according to the uniform resource locator of the target API method.

[0106] The access request processing device provided in the embodiment of the present application obtains a first access request of a target object through a first acquisition unit 701, wherein the first access request is used to request an API method in a distributed architecture system, and the first access request includes at least a uniform resource locator and a first session ID of the target API method, wherein the first session ID is obtained when the target object logs in to a non-distributed architecture system; a first verification unit 702 verifies the first session ID in the first access request, and when the first session ID is verified, generates a second access request based on attribute information of the non-distributed architecture system and the first access request; a sending unit 703 sends the second access request to the distributed architecture system, so as to perform session validity verification on the second access request through the distributed architecture system, and when the session validity verification is passed, calls the target API method based on the uniform resource locator of the target API method, thereby solving the problem in the related art that a valid session cannot be maintained between a non-distributed architecture system with a stateful session and a distributed architecture system with a stateless session. In this solution, when the target object is accessed through a non-distributed architecture system, the non-distributed architecture system verifies that the first session ID is valid, and then obtains a second access request through the attribute information of the non-distributed architecture system and the first access request. The distributed architecture system verifies the session validity of the second access request, thereby maintaining a session between the non-distributed architecture system with a stateful session and the distributed architecture system with a stateless session, without the need to transform the traditional stateful session system into a stateless session system, thereby achieving the effect of improving access processing efficiency.

[0107] Optionally, in the access request processing device provided in the embodiment of the present application, the device also includes: a second acquisition unit, used to obtain a login request for the target object to log in to the non-distributed architecture system before obtaining the first access request for the target object; a creation unit, used to create a target session and a second session ID corresponding to the target session based on the login request; and a storage unit, used to store the target session and the second session ID corresponding to the target session in the non-distributed architecture system.

[0108] Optionally, in the access request processing device provided in the embodiment of the present application, the first verification unit includes: a reading module, used to read the second session ID from the non-distributed architecture system; a first judgment module, used to judge whether the first session ID is the same as the second session ID; a first determination module, used to pass the verification of the first session ID if the first session ID is the same as the second session ID; and a second determination module, used to fail the verification of the first session ID if the first session ID is not the same as the second session ID.

[0109] Optionally, in the access request processing device provided in the embodiment of the present application, the first verification unit also includes: a first encapsulation module, used to encapsulate the data information in the first access request to obtain a first data packet; a first acquisition module, used to obtain the attribute information of the non-distributed architecture system, the IP address of the target object and the service name requested by the target object, wherein the attribute information includes at least: the IP address of the non-distributed architecture system, the port of the non-distributed architecture system; a second encapsulation module, used to encapsulate the attribute information of the non-distributed architecture system, the IP address of the target object and the service name requested by the target object to obtain a second data packet; a third determination module, used to obtain a second access request through the first data packet and the second data packet.

[0110] The access request processing device includes a processor and a memory. The above-mentioned first acquisition unit 701, first verification unit 702 and sending unit 703 are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to implement corresponding functions.

[0111] The processor includes a kernel, which retrieves the corresponding program unit from the memory. The kernel can be set to one or more, and the kernel parameters can be adjusted to achieve the purpose of the present invention.

[0112] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0113] The embodiment of the present application also provides a device for processing access requests. It should be noted that the device for processing access requests in the embodiment of the present application can be used to execute the method for processing access requests provided in the embodiment of the present application. The device for processing access requests provided in the embodiment of the present application is introduced below.

[0114] Figure 8 Schematic diagram of an access request processing device according to an embodiment of the present application Figure 2 .like Figure 8As shown, the device includes: a second acquisition unit 801, a second verification unit 802 and a calling unit 803.

[0115] The second acquisition unit 801 is used to acquire a second access request, wherein the second access request is obtained according to the attribute information of the non-distributed architecture system and the first access request, the first access request is used to request an API method in the distributed architecture system, and the first access request at least includes a uniform resource locator of a target API method and a first session ID, wherein the first session ID is obtained when the target object logs in to the non-distributed architecture system;

[0116] A second verification unit 802, configured to perform session validity verification on the second access request;

[0117] The calling unit 803 is configured to call the target API method according to the uniform resource locator of the target API method when the session validity verification of the second access request is passed.

[0118] The access request processing device provided in the embodiment of the present application obtains the second access request through the second acquisition unit 801, wherein the second access request is obtained based on the attribute information of the non-distributed architecture system and the first access request, the first access request is used to request the API method in the distributed architecture system, and the first access request includes at least the uniform resource locator and the first session ID of the target API method, wherein the first session ID is obtained when the target object logs in to the non-distributed architecture system; the second verification unit 802 verifies the session validity of the second access request; the calling unit 803 calls the target API method based on the uniform resource locator of the target API method when the session validity verification of the second access request is passed, thereby solving the problem in the related art that a valid session cannot be maintained between a non-distributed architecture system with a stateful session and a distributed architecture system with a stateless session. In this solution, when the target object is accessed through a non-distributed architecture system, the non-distributed architecture system verifies that the first session ID is valid, and then obtains a second access request through the attribute information of the non-distributed architecture system and the first access request. The distributed architecture system verifies the session validity of the second access request, thereby maintaining a session between the non-distributed architecture system with a stateful session and the distributed architecture system with a stateless session, without the need to transform the traditional stateful session system into a stateless session system, thereby achieving the effect of improving access processing efficiency.

[0119] Optionally, in the access request processing device provided in the embodiment of the present application, the second verification unit includes: a second acquisition module, used to obtain a session table stored in a database corresponding to the distributed architecture system, wherein the session table is used to store valid sessions and a third session ID corresponding to the valid sessions; a second judgment module, used to judge whether there is a third session ID that is identical to the first session ID in the session table; and a fourth determination module, used to verify the session validity of the second access request if there is a third session ID that is identical to the first session ID in the session table.

[0120] Optionally, in the access request processing device provided in the embodiment of the present application, the device also includes: after determining whether there is a third session ID identical to the first session ID in the session table, if there is no third session ID identical to the first session ID in the session table, obtaining target data information from the second access request, wherein the target data information includes at least: attribute information of the non-distributed architecture system, the IP address of the target object, and the service name requested by the target object; splicing based on the target data information to obtain a uniform resource locator of the non-distributed architecture system; accessing the non-distributed architecture system based on the uniform resource locator of the non-distributed architecture system to determine whether the non-distributed architecture system stores a fourth session ID identical to the first session ID; if the non-distributed architecture system stores a fourth session ID identical to the first session ID, determining that the session of the second access request passes the validity verification, and storing the first session ID in the session table.

[0121] Optionally, in the access request processing device provided in an embodiment of the present application, after determining whether the non-distributed architecture system stores a fourth session ID that is identical to the first session ID, the device also includes: if the non-distributed architecture system does not store a fourth session ID that is identical to the first session ID, determining that the session corresponding to the second access request has expired, and displaying an invalid access interface to the target object.

[0122] An embodiment of the present invention provides a processor, which is used to run a program, wherein the processing method of executing an access request is executed when the program is running.

[0123] like Fig. 9As shown, an embodiment of the present invention provides an electronic device, the device includes a processor, a memory, and a program stored in the memory and executable on the processor, and the processor implements the following steps when executing the program: obtaining a first access request of a target object, wherein the first access request is used to request an API method in a distributed architecture system, and the first access request includes at least a uniform resource locator and a first session ID of the target API method, wherein the first session ID is obtained when the target object logs in to a non-distributed architecture system; verifying the first session ID in the first access request, and when the first session ID is verified, generating a second access request based on attribute information of the non-distributed architecture system and the first access request; sending the second access request to the distributed architecture system to perform session validity verification on the second access request through the distributed architecture system, and when the session validity verification is passed, calling the target API method based on the uniform resource locator of the target API method.

[0124] Optionally, before obtaining the first access request for the target object, the method also includes: obtaining a login request for the target object to log in to the non-distributed architecture system; creating a target session and a second session ID corresponding to the target session based on the login request; and storing the target session and the second session ID corresponding to the target session in the non-distributed architecture system.

[0125] Optionally, verifying the first session ID in the first access request includes: reading the second session ID from the non-distributed architecture system; determining whether the first session ID is the same as the second session ID; if the first session ID is the same as the second session ID, the verification of the first session ID passes; if the first session ID is not the same as the second session ID, the verification of the first session ID fails.

[0126] Optionally, when the first session ID is verified, a second access request is generated based on the attribute information of the non-distributed architecture system and the first access request, including: encapsulating the data information in the first access request to obtain a first data packet; obtaining the attribute information of the non-distributed architecture system, the IP address of the target object, and the service name requested by the target object, wherein the attribute information includes at least: the IP address of the non-distributed architecture system, the port of the non-distributed architecture system; encapsulating the attribute information of the non-distributed architecture system, the IP address of the target object, and the service name requested by the target object to obtain a second data packet; obtaining a second access request through the first data packet and the second data packet.

[0127] Optionally, a second access request is obtained, wherein the second access request is obtained based on attribute information of the non-distributed architecture system and the first access request, the first access request is used to request an API method in the distributed architecture system, and the first access request includes at least a uniform resource locator and a first session ID of the target API method, wherein the first session ID is obtained when the target object logs in to the non-distributed architecture system; a session validity verification is performed on the second access request; when the session validity verification of the second access request passes, the target API method is called based on the uniform resource locator of the target API method.

[0128] Optionally, performing session validity verification on the second access request includes: obtaining a session table stored in a database corresponding to the distributed architecture system, wherein the session table is used to store valid sessions and a third session ID corresponding to the valid sessions; determining whether there is a third session ID identical to the first session ID in the session table; if there is a third session ID identical to the first session ID in the session table, the session validity verification of the second access request is passed.

[0129] Optionally, after determining whether there is a third session ID identical to the first session ID in the session table, the method further includes: if there is no third session ID identical to the first session ID in the session table, obtaining target data information from the second access request, wherein the target data information includes at least: attribute information of the non-distributed architecture system, the IP address of the target object, and the service name requested by the target object; performing splicing based on the target data information to obtain a uniform resource locator of the non-distributed architecture system; accessing the non-distributed architecture system based on the uniform resource locator of the non-distributed architecture system to determine whether the non-distributed architecture system stores a fourth session ID identical to the first session ID; if the non-distributed architecture system stores a fourth session ID identical to the first session ID, determining that the session of the second access request passes the validity verification, and storing the first session ID in the session table.

[0130] Optionally, after determining whether the non-distributed architecture system stores a fourth session ID that is identical to the first session ID, the method further includes: if the non-distributed architecture system does not store a fourth session ID that is identical to the first session ID, determining that the session corresponding to the second access request has expired, and displaying an invalid access interface to the target object.

[0131] The devices in this article can be servers, PCs, PADs, mobile phones, etc.

[0132] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that initializes the following method steps: obtaining a first access request for a target object, wherein the first access request is used to request an API method in a distributed architecture system, and the first access request includes at least a uniform resource locator and a first session ID of the target API method, wherein the first session ID is obtained when the target object logs in to a non-distributed architecture system; verifying the first session ID in the first access request, and when the first session ID is verified, generating a second access request based on attribute information of the non-distributed architecture system and the first access request; sending the second access request to the distributed architecture system to perform session validity verification on the second access request through the distributed architecture system, and when the session validity verification is passed, calling the target API method based on the uniform resource locator of the target API method.

[0133] Optionally, before obtaining the first access request for the target object, the method also includes: obtaining a login request for the target object to log in to the non-distributed architecture system; creating a target session and a second session ID corresponding to the target session based on the login request; and storing the target session and the second session ID corresponding to the target session in the non-distributed architecture system.

[0134] Optionally, verifying the first session ID in the first access request includes: reading the second session ID from the non-distributed architecture system; determining whether the first session ID is the same as the second session ID; if the first session ID is the same as the second session ID, the verification of the first session ID passes; if the first session ID is not the same as the second session ID, the verification of the first session ID fails.

[0135] Optionally, when the first session ID is verified, a second access request is generated based on the attribute information of the non-distributed architecture system and the first access request, including: encapsulating the data information in the first access request to obtain a first data packet; obtaining the attribute information of the non-distributed architecture system, the IP address of the target object, and the service name requested by the target object, wherein the attribute information includes at least: the IP address of the non-distributed architecture system, the port of the non-distributed architecture system; encapsulating the attribute information of the non-distributed architecture system, the IP address of the target object, and the service name requested by the target object to obtain a second data packet; obtaining a second access request through the first data packet and the second data packet.

[0136] Optionally, a second access request is obtained, wherein the second access request is obtained based on attribute information of the non-distributed architecture system and the first access request, the first access request is used to request an API method in the distributed architecture system, and the first access request includes at least a uniform resource locator and a first session ID of the target API method, wherein the first session ID is obtained when the target object logs in to the non-distributed architecture system; a session validity verification is performed on the second access request; when the session validity verification of the second access request passes, the target API method is called based on the uniform resource locator of the target API method.

[0137] Optionally, performing session validity verification on the second access request includes: obtaining a session table stored in a database corresponding to the distributed architecture system, wherein the session table is used to store valid sessions and a third session ID corresponding to the valid sessions; determining whether there is a third session ID identical to the first session ID in the session table; if there is a third session ID identical to the first session ID in the session table, the session validity verification of the second access request is passed.

[0138] Optionally, after determining whether there is a third session ID identical to the first session ID in the session table, the method further includes: if there is no third session ID identical to the first session ID in the session table, obtaining target data information from the second access request, wherein the target data information includes at least: attribute information of the non-distributed architecture system, the IP address of the target object, and the service name requested by the target object; performing splicing based on the target data information to obtain a uniform resource locator of the non-distributed architecture system; accessing the non-distributed architecture system based on the uniform resource locator of the non-distributed architecture system to determine whether the non-distributed architecture system stores a fourth session ID identical to the first session ID; if the non-distributed architecture system stores a fourth session ID identical to the first session ID, determining that the session of the second access request passes the validity verification, and storing the first session ID in the session table.

[0139] Optionally, after determining whether the non-distributed architecture system stores a fourth session ID that is identical to the first session ID, the method further includes: if the non-distributed architecture system does not store a fourth session ID that is identical to the first session ID, determining that the session corresponding to the second access request has expired, and displaying an invalid access interface to the target object.

[0140] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0141] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0142] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0143] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0144] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0145] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0146] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0147] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0148] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0149] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for processing an access request, the method being applied to a non-distributed architecture system, characterized in that: include: Obtaining a first access request of a target object, wherein the first access request is used to request an API method in a distributed architecture system, and the first access request at least includes a uniform resource locator of the target API method and a first session ID, wherein the first session ID is obtained when the target object logs in to the non-distributed architecture system; Verifying the first session ID in the first access request, and when the first session ID is verified, generating a second access request according to the attribute information of the non-distributed architecture system and the first access request; Sending the second access request to the distributed architecture system to perform session validity verification on the second access request through the distributed architecture system, and calling the target API method according to the uniform resource locator of the target API method when the session validity verification passes; The performing session validity verification on the second access request includes: Obtaining a session table stored in a database corresponding to the distributed architecture system, wherein the session table is used to store valid sessions and a third session ID corresponding to the valid sessions; Determine whether there is a third session ID identical to the first session ID in the session table; If a third session ID identical to the first session ID exists in the session table, the session validity verification of the second access request is successful.

2. The method according to claim 1, characterized in that Before obtaining the first access request of the target object, the method further includes: Obtaining a login request from the target object to log into the non-distributed architecture system; Creating a target session and a second session ID corresponding to the target session according to the login request; The target session and a second session ID corresponding to the target session are stored in the non-distributed architecture system.

3. The method according to claim 2, characterized in that Verifying the first session ID in the first access request includes: Reading the second session ID from the non-distributed architecture system; Determining whether the first session ID is the same as the second session ID; If the first session ID is the same as the second session ID, the verification of the first session ID is successful; If the first session ID is different from the second session ID, the verification of the first session ID fails.

4. The method according to claim 1, characterized in that When the first session ID is verified, generating a second access request according to the attribute information of the non-distributed architecture system and the first access request includes: Encapsulating the data information in the first access request to obtain a first data packet; Acquire the attribute information of the non-distributed architecture system, the IP address of the target object and the service name requested by the target object, wherein the attribute information at least includes: the IP address of the non-distributed architecture system and the port of the non-distributed architecture system; Encapsulating the attribute information of the non-distributed architecture system, the IP address of the target object, and the service name requested by the target object to obtain a second data packet; The second access request is obtained through the first data packet and the second data packet.

5. A method for processing an access request, the method being applied to a distributed architecture system, characterized in that: include: Obtaining a second access request, wherein the second access request is obtained based on the attribute information of the non-distributed architecture system and the first access request, wherein the first access request is used to request an API method in the distributed architecture system, and the first access request at least includes a uniform resource locator of a target API method and a first session ID, wherein the first session ID is obtained when the target object logs in to the non-distributed architecture system; Performing session validity verification on the second access request; When the session validity verification of the second access request is passed, calling the target API method according to the uniform resource locator of the target API method; Performing session validity verification on the second access request includes: Obtaining a session table stored in a database corresponding to the distributed architecture system, wherein the session table is used to store valid sessions and a third session ID corresponding to the valid sessions; Determine whether there is a third session ID identical to the first session ID in the session table; If a third session ID identical to the first session ID exists in the session table, the session validity verification of the second access request is successful.

6. The method according to claim 5, characterized in that After determining whether there is a third session ID identical to the first session ID in the session table, the method further includes: If the third session ID identical to the first session ID does not exist in the session table, obtaining target data information from the second access request, wherein the target data information at least includes: attribute information of the non-distributed architecture system, the IP address of the target object, and the service name requested by the target object; splicing according to the target data information to obtain the uniform resource locator of the non-distributed architecture system; Access the non-distributed architecture system according to the uniform resource locator of the non-distributed architecture system to determine whether the non-distributed architecture system stores a fourth session ID that is the same as the first session ID; If the non-distributed architecture system stores a fourth session ID that is the same as the first session ID, it is determined that the session of the second access request passes the validity verification, and the first session ID is stored in the session table.

7. The method according to claim 6, characterized in that After determining whether the non-distributed architecture system stores a fourth session ID that is identical to the first session ID, the method further includes: If the non-distributed architecture system does not store a fourth session ID that is the same as the first session ID, it is determined that the session corresponding to the second access request has expired, and an invalid access interface is displayed to the target object.

8. A device for processing access requests, characterized in that: include: A first acquisition unit is used to acquire a first access request of a target object, wherein the first access request is used to request an API method in a distributed architecture system, and the first access request at least includes a uniform resource locator of the target API method and a first session ID, wherein the first session ID is obtained when the target object logs in to a non-distributed architecture system; A first verification unit, configured to verify the first session ID in the first access request, and generate a second access request according to the attribute information of the non-distributed architecture system and the first access request when the first session ID is verified successfully; a sending unit, configured to send the second access request to the distributed architecture system, so as to perform session validity verification on the second access request through the distributed architecture system, and when the session validity verification passes, call the target API method according to the uniform resource locator of the target API method; The processing device is further used to obtain a session table stored in a database corresponding to the distributed architecture system, wherein the session table is used to store valid sessions and a third session ID corresponding to the valid sessions; Determine whether there is a third session ID identical to the first session ID in the session table; If a third session ID identical to the first session ID exists in the session table, the session validity verification of the second access request is successful.

9. A device for processing access requests, characterized in that: include: a second acquisition unit, configured to acquire a second access request, wherein the second access request is obtained based on the attribute information of the non-distributed architecture system and the first access request, wherein the first access request is used to request an API method in the distributed architecture system, and the first access request at least includes a uniform resource locator of a target API method and a first session ID, wherein the first session ID is obtained when the target object logs in to the non-distributed architecture system; A second verification unit, configured to perform session validity verification on the second access request; a calling unit, configured to call the target API method according to the uniform resource locator of the target API method when the session validity verification of the second access request passes; Among them, the second verification unit includes: a second acquisition module, used to obtain a session table stored in a database corresponding to the distributed architecture system, wherein the session table is used to store valid sessions and a third session ID corresponding to the valid sessions; a second judgment module, used to judge whether there is a third session ID identical to the first session ID in the session table; and a fourth determination module, used to verify the session validity of the second access request if there is a third session ID identical to the first session ID in the session table.

10. A processor, characterized in that: The processor is used to run a program, wherein the program, when running, executes the method for processing an access request as described in any one of claims 1 to 7.

11. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the access request processing method described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and system for page access

    CN102447726A