New and old system parallel method utilizing session synchronization and iframe embedding
Through the token-based session binding mechanism and the application context root forwarding mechanism, the problem of user session management and menu functions parallelism in the case of large differences between new and old system architectures is solved, and the synchronization of user sessions and flexible jump of menu functions is realized, ensuring the unified user experience and the stable operation of the system.
Patent Information
- Application Number
- CN202411993700.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-16
AI Technical Summary
In the case where the architecture of new and old systems is very different, how to manage the user session life cycle and realize the parallelism of the menu functions of new and old systems to ensure user experience and system stability.
The token-based session binding mechanism and the application context root forwarding mechanism are adopted. After logging in through the new system, the token is generated and passed to the old system. The old system verifies the token and establishes a session. The new system saves the cookies of the new and old systems, realizes the consistency management of user sessions, and realizes the parallelism of menu functions through context root forwarding.
It realizes the synchronization of user sessions and flexible jump of menu functions, ensuring the unified user experience and stable operation of the system, without the need for repeated user login, and is suitable for monolithic and microservice architectures.
Smart Images

Figure CN120010946A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of Internet application development, and in particular relates to a new and old system parallel method utilizing session synchronization and iframe embedding. Background Art
[0002] In modern Internet application development, the implementation strategy of small steps and fast progress and batch iteration has become the preferred solution for enterprises to implement the quick-win strategy. Based on this strategy, the old and new systems need to be implemented in parallel, that is, the business functions of the old system are embedded in the page framework of the new system, and at the same time, the customer's experience is seamless.
[0003] However, as the architectures of the new and old systems are very different, the old system uses a monolithic architecture and the new system uses a front-end and back-end separated architecture. There are some challenges in ensuring the stable and parallel operation of the new and old systems during the batch iteration of the systems. The main issues are how to manage the user session lifecycle and how to run the menu functions of the new and old systems in parallel. These issues directly affect the user experience and system stability.
[0004] However, in the existing system parallel method, the scenario where the old system adopts a monolithic architecture and the new system adopts a front-end and back-end separated architecture has the following disadvantages:
[0005] Session asynchrony: Since each system has independent sessions, the so-called system parallelism only enables the two systems to be used independently. Customers still need to log in again when switching functions, which affects the user experience.
[0006] Menu page fragmentation: Although the system is available for use at the same time, the menu pages are independent of each other, and it is impossible to switch on the same screen or jump to the menu;
[0007] In order to solve the above problems, we need to propose a parallel method of the old and new systems using session synchronization and iframe embedding, so that it can ensure user session synchronization and flexibly perform menu jumps and same-screen operations. Summary of the invention
[0008] The purpose of the present invention is to provide a new and old system parallel method using session synchronization and iframe embedding, which can ensure user session synchronization and flexibly perform menu jumps and same-screen operation mechanisms to solve the problems raised in the above background technology.
[0009] To achieve the above object, the present invention adopts the following technical solutions:
[0010] A method for parallel operation of new and old systems using session synchronization and iframe embedding includes the following steps:
[0011] S1. Develop a token-based session binding mechanism based on the new system and the old system to embed the old system into the new system.
[0012] S2. After initiating a login from the new system, a user session and a token bound to the user are generated, and the token is used to log in to the old system;
[0013] S3: The old system requests the new system to verify and obtain user information based on the token. After the old system establishes a session, it returns the cookie to the new system. At this time, the new system saves the cookies of both the old and new systems.
[0014] S4. Develop a mechanism based on application context root forwarding so that after logging into the new system, customers can click to switch menu functions between the new system and the old system without any obstacles, and can jump between pages.
[0015] Preferably, in step S1, the token-based session binding mechanism includes the following process: user logs in to the new system, the new system generates a token and passes it to the old system, the old system verifies the token and obtains user information, the old system establishes a session and returns a cookie, the new system saves the cookies of the new and old systems, and session consistency management;
[0016] Among them, the user logs into the new system by entering the user name and password through the login page of the new system.
[0017] The new system verifies the correctness of the username and password. After successful verification, the new system generates a token bound to the user and associates the session information with the token.
[0018] The new system generates a token and passes it to the old system. The new system returns the generated token to the client. When the client requests resources from the old system, it sends the token to the old system as part of the request.
[0019] The old system verifies the token and obtains user information when it receives a request containing the token. It uses the token to initiate a verification request to the new system. The new system verifies the validity of the token and returns the corresponding user information to the old system. If the token is invalid or expired, the new system returns an error message, and the old system rejects the client's request accordingly.
[0020] The old system establishes a session and returns a cookie. After verifying the token and obtaining the user information, the old system establishes a session for the user and generates a cookie associated with the session. The old system returns the cookie to the client so that the client can carry the cookie in subsequent requests to maintain the session state.
[0021] The new system saves the cookies of the old and new systems. After receiving the cookies returned by the old system, the client may need to carry the cookies of the old and new systems in the interaction with the new system. After receiving these cookies, the new system saves them so that it can identify and maintain the user's session status when needed.
[0022] Session consistency management is the process in which the new system and the old system use tokens and cookies to achieve consistent management of user sessions throughout the entire process. During the switching and interaction between the new system and the old system, users do not need to re-login or perform additional authentication, which ensures that users can switch seamlessly between the new and old systems and obtain a consistent user experience.
[0023] Preferably, the new system includes a new system front end, a new system back end and a downstream system, and the request for session synchronization and refresh is initiated by the new system back end. The specific initiation process is as follows:
[0024] A1. The user logs in to the new system front end;
[0025] A2. The new system backend generates a token and returns a new version of the token cookie;
[0026] A3. Users log in to the old system through tokens;
[0027] A4. Verify Token and return user information.
[0028] A5. Save cookie information, including cookie information after successful login to the new online banking and cookie information after successful login to the old system using token;
[0029] A6. Create a session after the login operation is completed.
[0030] Preferably, in step S2, when the user logs in from the new system, the login module of the new system verifies the user's credentials. After the login is successful, the session management module of the new system generates a user session and records the relevant information of the user session on the server side. At the same time, the new system generates a token bound to the currently logged-in user. This token contains the user ID and validity period information and is signed using an encryption algorithm to ensure its security. The new system passes the generated token to the embedded old system. After receiving the token, the old system uses it as a login credential and initiates a login request to its own login module.
[0031] Preferably, in step S3, when the old system requests the new system to verify and obtain user information, it first receives the token and then sends the token to the verification interface of the new system. The verification interface of the new system verifies the token after receiving it. If the token verification is successful, the new system returns the user information corresponding to the token to the old system. The old system establishes its own user session based on the user information obtained from the new system. While establishing the session, the old system generates a cookie for identifying the user's login status in the old system. The old system then returns the cookie to the new system. After the new system receives the cookie returned by the old system, it saves it together with the cookie generated by itself.
[0032] Preferably, in step S4, when the mechanism based on application context root forwarding is formulated, the new system front-end framework adopts VUE, the old system uses JSP / Servlet, the new system menu context root is configured as / AAAAAAA / , and the old system menu context root is configured as / BBBBBBB / . After the customer clicks the menu, the new system performs context forwarding through the WEB server and chooses to forward to the new system back end or the old system back end, and adds parameter configuration to the menu for parameterized configuration of the menu jump page.
[0033] Preferably, the process of switching the menu function between the new system and the old system is as follows: in the front-end interface of the new system, a corresponding click event handler is added for the menu function of the old system. When the user clicks on the menu of the old system, the new system forwards the request to the corresponding page of the old system according to the established forwarding mechanism. After processing the request, the old system returns the response to the new system, and the new system jumps the page. Similarly, when the user clicks on the menu of the new system in the old system, the old system forwards the request to the new system, thereby realizing mutual page jumps and function switching.
[0034] Preferably, the following improvements are made to achieve mutual jump between the old system and the new system:
[0035] The old system JSP and the new system Vue jump to each other, and the new system Vue listens to the click events of specific buttons of the old system JSP:
[0036] The unified calling function of the old system JSP, the old system tab button, return, close is modified to a unified calling function;
[0037] The old system JSP page session timed out. When loading the old system page, the new system will monitor the old system page. If no response is received, a pop-up window will be displayed.
[0038] The new system and the old system share sessions, and the new system backend initiates session synchronization and refresh requests.
[0039] Preferably, the context root refers to the root directory path of the Web application in the Web server, and the root directory path is a basic URL path portion used to identify a Web application.
[0040] Preferably, the menu routing rules in the menu function are dynamically adjusted as new functions are launched and old functions are taken offline.
[0041] The new and old system parallel method using session synchronization and iframe embedding proposed by the present invention has the following advantages compared with the prior art:
[0042] 1. The present invention uses a token-based session binding mechanism and an application context root forwarding-based mechanism in combination. After logging into the new system, a session of the old system can be established at the same time, and the business functions between the new and old systems can be switched without obstacles, and security is guaranteed. The mechanism based on application context root forwarding is used to realize parallel menu functions, and the technology can be expanded to grayscale release. Not only the simultaneous operation of the systems is taken into account, but also the customer's usage experience is fully considered, so that customers do not feel anything. Customers log in once and operate the menu functions of the new and old systems at the same time without repeated login, and the experience is unified.
[0043] 2. The present invention is applicable to both monolithic and microservice architectures, has strong versatility, and is convenient for promotion and application in different types of projects. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 It is a flowchart of the present invention;
[0045] Figure 2 It is a block diagram of the connection between the new system and the old system of the present invention;
[0046] Figure 3 The request for session synchronization and refresh of the present invention is initiated by the new system backend. DETAILED DESCRIPTION
[0047] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. The specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0048] The present invention provides Figure 1-3 A method for parallel operation of the new and old systems using session synchronization and iframe embedding is shown, comprising the following steps:
[0049] S1. Develop a token-based session binding mechanism based on the new system and the old system to embed the old system into the new system.
[0050] The token-based session binding mechanism includes the following process: user logs in to the new system, the new system generates a token and passes it to the old system, the old system verifies the token and obtains user information, the old system establishes a session and returns a cookie, the new system saves the cookies of the new and old systems, and manages session consistency;
[0051] Among them, the user logs into the new system by entering the user name and password through the login page of the new system.
[0052] The new system verifies the correctness of the username and password. After successful verification, the new system generates a token bound to the user and associates the session information (which may include user ID, session ID, etc.) with the token.
[0053] The new system generates a token and passes it to the old system. The new system returns the generated token to the client (such as a browser or mobile application). When the client requests resources from the old system, it sends the token as part of the request (usually in the request header) to the old system.
[0054] The old system verifies the token and obtains user information when it receives a request containing the token. It uses the token to initiate a verification request to the new system. The new system verifies the validity of the token and returns the corresponding user information (such as user name, role, etc.) to the old system. If the token is invalid or expired, the new system returns an error message, and the old system rejects the client's request accordingly.
[0055] The old system establishes a session and returns a cookie. After verifying the token and obtaining the user information, the old system establishes a session for the user and generates a cookie associated with the session. The old system returns the cookie to the client so that the client can carry the cookie in subsequent requests to maintain the session state.
[0056] The new system saves the cookies of the old and new systems. After receiving the cookies returned by the old system, the client may need to carry the cookies of the old and new systems in the interaction with the new system. After receiving these cookies, the new system saves them so that it can identify and maintain the user's session status when needed.
[0057] Session consistency management is the process in which the new system and the old system use tokens and cookies to achieve consistent management of user sessions throughout the entire process. During the switching and interaction between the new system and the old system, users do not need to re-login or perform additional authentication, which ensures that users can switch seamlessly between the new and old systems and obtain a consistent user experience.
[0058] like Figure 2 As shown, the new system includes a new system front end, a new system back end and a downstream system, and the request for session synchronization and refresh is initiated by the new system back end, such as Figure 3 The specific initiation process is as follows:
[0059] A1. The user logs in to the new system front end;
[0060] A2. The new system backend generates a token and returns a new version of the token cookie;
[0061] A3. Users log in to the old system through tokens;
[0062] A4. Verify Token; return user information (currently logged in user ID);
[0063] A5. Save cookie information, including cookie information after successful login to the new online banking and cookie information after successful login to the old system using token;
[0064] A6. Create a session after the login operation is completed.
[0065] S2. After initiating a login from the new system, a user session and a token bound to the user are generated, and the token is used to log in to the old system;
[0066] When a user logs in from the new system, the login module of the new system verifies the user's credentials. After a successful login, the session management module of the new system generates a user session and records relevant information of the user session on the server. At the same time, the new system generates a token bound to the currently logged-in user. This token contains the user ID and validity period information and is signed using an encryption algorithm to ensure its security. The new system passes the generated token to the embedded old system. After receiving the token, the old system uses it as a login credential and initiates a login request to its own login module.
[0067] S3: The old system requests the new system to verify and obtain user information based on the token. After the old system establishes a session, it returns the cookie to the new system. At this time, the new system saves the cookies of both the old and new systems.
[0068] When the old system requests the new system to verify and obtain user information, it first receives the token and then sends the token to the verification interface of the new system. The verification interface of the new system verifies the token after receiving it. If the token verification passes, the new system returns the user information corresponding to the token to the old system. The old system establishes its own user session based on the user information obtained from the new system. While establishing the session, the old system generates a cookie for identifying the user's login status in the old system. The old system then returns the cookie to the new system. After the new system receives the cookie returned by the old system, it saves it together with the cookie generated by itself.
[0069] S4. Develop a mechanism based on application context root forwarding so that after logging into the new system, customers can click to switch menu functions between the new system and the old system without any obstacles, and can jump between pages.
[0070] When the mechanism based on application context root forwarding is formulated, the new system front-end framework adopts VUE, the old system uses JSP / Servlet, the new system menu context root is configured as / AAAAAAA / , and the old system menu context root is configured as / BBBBBBB / . After the customer clicks on the menu, the new system performs context forwarding through the WEB server and chooses to forward to the new system back end or the old system back end, and adds parameter configuration to the menu for parameterized configuration of the menu jump page.
[0071] The process of switching the menu functions between the new system and the old system is as follows: in the front-end interface of the new system, a corresponding click event handler is added for the menu function of the old system. When the user clicks on the menu of the old system, the new system forwards the request to the corresponding page of the old system according to the established forwarding mechanism. After processing the request, the old system returns the response to the new system, and the new system jumps the page. Similarly, when the user clicks on the menu of the new system in the old system, the old system forwards the request to the new system to realize mutual page jump and function switching.
[0072] To achieve the mutual jump between the old system and the new system, the following improvements are made:
[0073] The old system JSP and the new system Vue jump to each other, and the new system Vue listens to the click events of specific buttons of the old system JSP:
[0074] The unified calling function of the old system JSP, the old system tab button, return, close is modified to a unified calling function;
[0075] The old system JSP page session timed out. When loading the old system page, the new system will monitor the old system page. If no response is received, a pop-up window will be displayed.
[0076] The new system and the old system share sessions, and the new system backend initiates session synchronization and refresh requests.
[0077] The context root refers to the root directory path of a Web application in a Web server, and the root directory path is a basic URL path portion used to identify a Web application.
[0078] The menu routing rules in the menu function are dynamically adjusted as new functions are launched and old functions are taken offline.
[0079] By using a token-based session binding mechanism in conjunction with an application context root forwarding mechanism, a session of the old system can be established after logging into the new system, and business functions between the old and new systems can be switched seamlessly with security guarantees. The mechanism based on application context root forwarding is used to implement parallel menu functions, and the technology can be expanded to grayscale release, which not only takes into account the simultaneous operation of the systems, but also fully considers the customer's usage experience, achieving customer-free operation. Customers log in once and operate the menu functions of the new and old systems at the same time without repeated login, and the experience is unified. The present invention is suitable for monolithic and microservice architectures, has strong versatility, and is convenient for promotion and application in different types of projects.
[0080] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A new and old system parallel method using session synchronization and iframe embedding, characterized by: The steps include: S1. Develop a token-based session binding mechanism based on the new system and the old system to embed the old system into the new system. S2. After initiating a login from the new system, a user session and a token bound to the user are generated, and the token is used to log in to the old system; S3: The old system requests the new system to verify and obtain user information based on the token. After the old system establishes a session, it returns the cookie to the new system. At this time, the new system saves the cookies of both the old and new systems. S4. Develop a mechanism based on application context root forwarding so that after logging into the new system, customers can click to switch menu functions between the new system and the old system without any obstacles, and can jump between pages.
2. A method for parallel operation of new and old systems using session synchronization and iframe embedding according to claim 1, characterized in that: In step S1, the token-based session binding mechanism includes the following process: the user logs in to the new system, the new system generates a token and passes it to the old system, the old system verifies the token and obtains user information, the old system establishes a session and returns a cookie, the new system saves the cookies of the new and old systems, and manages session consistency; Among them, the user logs into the new system by entering the user name and password through the login page of the new system. The new system verifies the correctness of the username and password. After successful verification, the new system generates a token bound to the user and associates the session information with the token. The new system generates a token and passes it to the old system. The new system returns the generated token to the client. When the client requests resources from the old system, it sends the token to the old system as part of the request. The old system verifies the token and obtains user information when it receives a request containing the token. It uses the token to initiate a verification request to the new system. The new system verifies the validity of the token and returns the corresponding user information to the old system. If the token is invalid or expired, the new system returns an error message, and the old system rejects the client's request accordingly. The old system establishes a session and returns a cookie. After verifying the token and obtaining the user information, the old system establishes a session for the user and generates a cookie associated with the session. The old system returns the cookie to the client so that the client can carry the cookie in subsequent requests to maintain the session state. The new system saves the cookies of the old and new systems. After receiving the cookies returned by the old system, the client may need to carry the cookies of the old and new systems in the interaction with the new system. After receiving these cookies, the new system saves them so that it can identify and maintain the user's session status when needed. Session consistency management is the process in which the new system and the old system use tokens and cookies to achieve consistent management of user sessions throughout the entire process. During the switching and interaction between the new system and the old system, users do not need to re-login or perform additional authentication, which ensures that users can switch seamlessly between the new and old systems and obtain a consistent user experience.
3. A new and old system parallel method using session synchronization and iframe embedding according to claim 2, characterized in that: The new system includes a new system front end, a new system back end and a downstream system. The request for session synchronization and refresh is initiated by the new system back end. The specific initiation process is as follows: A1. The user logs in to the new system front end; A2. The new system backend generates a token and returns a new version of the token cookie; A3. The user logs in to the old system through the token; A4. Verify the Token. Return user information; A5. Save cookie information, including cookie information after successful login to the new online banking and cookie information after successful login to the old system using token; A6. Create a session after the login operation is completed.
4. A method for parallel operation of new and old systems using session synchronization and iframe embedding according to claim 3, characterized in that: In step S2, when the user logs in from the new system, the login module of the new system verifies the user's credentials. After the login is successful, the session management module of the new system generates a user session and records the relevant information of the user session on the server side. At the same time, the new system generates a token bound to the currently logged-in user. This token contains the user ID and validity period information and is signed using an encryption algorithm to ensure its security. The new system passes the generated token to the embedded old system. After receiving the token, the old system uses it as a login credential and initiates a login request to its own login module.
5. A new and old system parallel method using session synchronization and iframe embedding according to claim 4, characterized in that: In step S3, when the old system requests the new system to verify and obtain user information, it first receives the token and then sends the token to the verification interface of the new system. The verification interface of the new system verifies the token after receiving it. If the token verification is successful, the new system returns the user information corresponding to the token to the old system. The old system establishes its own user session based on the user information obtained from the new system. While establishing the session, the old system generates a cookie for identifying the user's login status in the old system. The old system then returns the cookie to the new system. After the new system receives the cookie returned by the old system, it saves it together with the cookie generated by itself.
6. A method for parallel operation of new and old systems using session synchronization and iframe embedding according to claim 5, characterized in that: In step S4, when the mechanism based on application context root forwarding is formulated, the new system front-end framework adopts VUE, the old system uses JSP / Servlet, the new system menu context root is configured as / AAAAAAA / , and the old system menu context root is configured as / BBBBBBB / . After the customer clicks the menu, the new system performs context forwarding through the WEB server, and chooses to forward to the new system back end or the old system back end, and adds parameter configuration to the menu for parameterized configuration of the menu jump page.
7. A method for parallel operation of new and old systems using session synchronization and iframe embedding according to claim 6, characterized in that: The process of switching the menu functions between the new system and the old system is as follows: in the front-end interface of the new system, a corresponding click event handler is added for the menu function of the old system. When the user clicks on the menu of the old system, the new system forwards the request to the corresponding page of the old system according to the established forwarding mechanism. After processing the request, the old system returns the response to the new system, and the new system jumps the page. Similarly, when the user clicks on the menu of the new system in the old system, the old system forwards the request to the new system to realize mutual page jump and function switching.
8. A method for parallel operation of new and old systems using session synchronization and iframe embedding according to claim 7, characterized in that: To achieve the mutual jump between the old system and the new system, the following improvements are made: The old system JSP and the new system Vue jump to each other, and the new system Vue listens to the click events of specific buttons of the old system JSP: The unified calling function of the old system JSP, the old system tab button, return, close is modified to a unified calling function; The old system JSP page session timed out. When loading the old system page, the new system will monitor the old system page. If no response is received, a pop-up window will be displayed. The new system and the old system share sessions, and the new system backend initiates session synchronization and refresh requests.
9. A method for parallel operation of new and old systems using session synchronization and iframe embedding according to claim 8, characterized in that: The context root refers to the root directory path of a Web application in a Web server, and the root directory path is a basic URL path portion used to identify a Web application.
10. A method for parallel operation of new and old systems using session synchronization and iframe embedding according to claim 9, characterized in that: The menu routing rules in the menu function are dynamically adjusted as new functions are launched and old functions are taken offline.