Method and system for grayscale resource distribution by means of page redirection, and storage medium
By identifying and comparing the grayscale identification of new and old users and triggering the redirection mechanism, the problems of low efficiency and poor user experience in the existing technology of grayscale user refresh page loading resources are solved, and efficient grayscale resource distribution and improved user experience are achieved.
Patent Information
- Application Number
- PCT/CN2024/138793
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-13
- Filing Date
- 2024-12-12
- Publication Date
- 2025-06-19
AI Technical Summary
In the process of grayscale release, the user will refresh the page to load grayscale resources when the user is grayscale during the grayscale release process, which is not efficient and has poor user experience.
By collecting new user login information and identifying the grayscale identification of the new user, we judge whether the new user is a grayscale user, and judge whether the grayscale information has changed based on the grayscale identification of the old user. When the grayscale identity of a new user is inconsistent with the old user, a redirect is triggered to ensure that only a specific user can access the grayscale resource.
Improves the efficiency of grayscale resource distribution and improves the user experience because users do not need to refresh the page frequently. At the same time, it ensures product quality, reduces the impact of potential problems on all users, and provides greater convenience and reliability for the update and maintenance of web applications.
Smart Images

Figure CN2024138793_19062025_PF_FP_ABST
Abstract
Description
A method, system and storage medium for redirecting pages to distribute grayscale resources
[0001] Related applications
[0002] This application claims priority to Chinese patent application number 202311710287.2, filed on December 13, 2023, entitled “A method, system and storage medium for redirecting pages to distribute grayscale resources,” the entire text of which is hereby incorporated by reference. Technical Field
[0003] The present application relates to the field of Web front-end development, and more specifically, to a method, system, and storage medium for redirecting pages to distribute grayscale resources. Background Art
[0004] Web technology has experienced rapid development in recent years and has become an integral part of our lives. Grayscale release technology, in particular, has brought significant convenience and flexibility to product iteration. Modern web technology encompasses numerous front-end, back-end, database, and server technologies, such as HTML, CSS, JavaScript, Vue, React, Node.js, MySQL, and Nginx. Together, these technologies form a complete web application, enabling it to run seamlessly on the internet and offer a rich variety of features and interactive experiences, such as online shopping, social networking, online video, and online gaming.
[0005] Grayscale release technology is particularly important during the update and maintenance of web applications. Grayscale release refers to testing new features or changes in a running web application with only a small number of users, rather than immediately applying them to all users. This approach prevents potential issues with new features or changes from impacting all users, while also enabling timely identification and resolution of issues and ensuring product quality. However, existing technology identifies grayscale users and refreshes the page to load grayscale resources. While this approach allows grayscale users to access grayscale features, it is inefficient and provides a poor user experience.
[0006] Therefore, it is necessary to design a method, system and storage medium for redirecting pages to distribute grayscale resources to solve the problems existing in the current technology. Summary of the Invention
[0007] In view of this, the present application proposes a method, system and storage medium for redirecting pages to distribute grayscale resources, aiming to solve the problems existing in the current technology.
[0008] In one aspect, the present application proposes a method for redirecting pages to distribute grayscale resources, including:
[0009] Collect new user login information and identify new user grayscale identities;
[0010] Determining whether the new user is a grayscale user according to the grayscale identifier;
[0011] Determine whether the grayscale information has changed based on the grayscale identifier of the old user;
[0012] When the grayscale identifier of the new user is inconsistent with the grayscale identifier of the old user, a redirection is triggered;
[0013] When the grayscale identifiers of the new user and the old user are consistent, the original resources continue to be used.
[0014] Furthermore, new user login information is collected and the grayscale identification of new users is identified, including:
[0015] Pre-store the user's grayscale identity locally in the browser.
[0016] Furthermore, judging whether the new user is a grayscale user according to the grayscale identifier includes:
[0017] Read the login information of the new user and determine whether it contains the grayscale identifier;
[0018] When the grayscale identifier exists, determining that the new user is a grayscale user;
[0019] When the grayscale identifier does not exist, it is determined that the new user is not a grayscale user.
[0020] Furthermore, when the grayscale identifier exists, after determining that the new user is a grayscale user, the method further includes:
[0021] Determine whether the grayscale identity of the new user is stored locally in the browser;
[0022] When the grayscale identifier of the new user is not stored locally in the browser, the new identifier is stored.
[0023] Furthermore, when the grayscale identifier of the new user is inconsistent with the grayscale identifier of the old user, after triggering the redirection, the method further includes:
[0024] Pre-set redirection time threshold.
[0025] Furthermore, when the grayscale identifier of the new user is inconsistent with the grayscale identifier of the old user, after the redirection is triggered, the redirection mechanism protection is also included:
[0026] Collect the last redirection trigger time, and trigger redirection when the time interval between the last redirection trigger time and the current time exceeds the redirection time threshold;
[0027] When the time interval between the last redirection triggering time and the current time does not exceed the redirection time threshold, redirection is not triggered.
[0028] Furthermore, the redirection mechanism protection also includes:
[0029] Regardless of whether a redirect is triggered, the current time is stored locally in the browser as the new redirect time.
[0030] Furthermore, when the grayscale identifier of the new user is inconsistent with the grayscale identifier of the old user, redirection is triggered, including:
[0031] If the old user is a grayscale user but the new user is a grayscale user, or if the old user is a grayscale user but the new user is not a grayscale user, redirection distribution to the correct resource is triggered.
[0032] Compared with the existing technology, the beneficial effect of the present application is that it realizes intelligent judgment on whether the new user is a grayscale user by collecting the login information of the new user and identifying the grayscale identifier of the new user, and judging whether the grayscale information has changed based on the grayscale identifier of the old user. When the grayscale identifier of the new user is inconsistent with that of the old user, a redirection is triggered to ensure that only specific users can access the grayscale resources, thereby effectively conducting grayscale release testing. Compared with the traditional refresh page to load grayscale resources, this method improves efficiency and improves the user experience because users do not refresh the page frequently. It helps to ensure product quality, reduce the impact of potential problems on all users, and provide greater convenience and reliability for the update and maintenance process of Web applications.
[0033] On the other hand, the present application also provides a system for redirecting pages to distribute grayscale resources, including:
[0034] Memory; and
[0035] A processor coupled to the memory is configured to execute the above-mentioned method for distributing grayscale resources by redirecting pages based on instructions stored in the memory.
[0036] On the other hand, the present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned method of redirecting pages to distribute grayscale resources.
[0037] It is understandable that the above-mentioned method, system and storage medium for redirecting pages to distribute grayscale resources have the same beneficial effects and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the conventional technology, the following briefly introduces the drawings required for use in the embodiments or the conventional technology descriptions. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the disclosed drawings without any creative work.
[0039] FIG1 is a flowchart of a method for distributing grayscale resources through redirected pages provided in an embodiment of the present application.
[0040] FIG2 is a flowchart of another method for distributing grayscale resources by redirecting pages provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0042] In actual project development, the iterative release of the project needs to be in the form of grayscale release, which requires loading grayscale resources for grayscale users to access. The purpose of this application is to target the grayscale release scenario. After logging in on the web page or logging in on the client without password authentication, the user can identify the change in the grayscale logo and efficiently redirect to the specified page through the strategy and protection mechanism of this application method. The page resource after redirection is a grayscale resource, thereby achieving the goal of allowing grayscale users to use the grayscale version with a better perception experience.
[0043] In some embodiments of the present application, referring to FIG1 , a method for redirecting a page to distribute grayscale resources includes:
[0044] S100: Collect new user login information and identify the new user's grayscale identity.
[0045] S200: Determine whether the new user is a grayscale user according to the grayscale identifier.
[0046] S300: Determine whether the grayscale information has changed based on the grayscale identifier of the old user. If the grayscale identifier of the new user is inconsistent with the grayscale identifier of the old user, trigger redirection. If the grayscale identifiers of the new user and the old user are consistent, continue to use the original resources.
[0047] Specifically, in S100, the login information of the new user is collected and the grayscale identification of the new user is identified. The grayscale identification is included so that it can be subsequently determined whether the user is a grayscale user. In S200, it is determined whether the new user is a grayscale user based on the grayscale identification. It is used to determine whether the new user belongs to the grayscale user group, and the judgment is made based on the existence or content of its grayscale identification. In S300, it is determined whether the grayscale information has changed based on the grayscale identification of the old user. When the grayscale identification of the new user is inconsistent with the grayscale identification of the old user, a redirection is triggered. When the grayscale identification of the new user is consistent with that of the old user, the original resources continue to be used. It is used to compare the grayscale identification of the new user and the old user. If they are inconsistent, a redirection is triggered to guide the new user to the grayscale resource page to ensure that they access new functions or changes. If they are consistent, the original resources continue to be used to avoid unnecessary page jumps.
[0048] As you can see, by accurately identifying the grayscale ID of new users and comparing it with the ID of existing users, the system can quickly determine whether a redirect is necessary. This reduces page load times and network requests, improving website performance and responsiveness. Furthermore, users can enjoy new features without noticing them, boosting user satisfaction. This improves efficiency and user experience during the grayscale release process, helping to ensure product quality.
[0049] In some embodiments of the present application, collecting new user login information and identifying the new user's grayscale identifier includes: pre-storing the user's grayscale identifier locally in the browser.
[0050] Specifically, the pre-stored process helps reduce server requests and data transmission, as the browser already stores the user's grayscale identity locally, eliminating the need to request server verification each time. This speeds up the process of determining whether a new user is a grayscale user, reduces network latency, and improves system performance. It also provides a better user experience, as users don't have to wait for a lengthy verification process.
[0051] It is understandable that the method of pre-storing the user's grayscale identification in the browser locally provides higher efficiency and faster response speed for grayscale publishing, while reducing the user's waiting time and page jumps, thereby improving user satisfaction.
[0052] In some embodiments of the present application, determining whether a new user is a grayscale user based on the grayscale identifier includes: reading the login information of the new user and determining whether it contains the grayscale identifier.
[0053] When a grayscale flag exists, the new user is determined to be a grayscale user.
[0054] When there is no grayscale identifier, the new user is determined not to be a grayscale user.
[0055] Specifically, the system first reads the new user's login information, including the data obtained from the login request. It then checks whether the read login information contains data with a grayscale identifier. If the system finds the grayscale identifier in the user's login information, it determines that the new user is a grayscale user, meaning that the new user should have access to grayscale resources or features. If the user's login information does not contain a grayscale identifier, the system determines that the new user is not a grayscale user, and they will continue to use their existing resources.
[0056] As you can see, by checking whether the login information contains the grayscale identifier, we can quickly and reliably distinguish the grayscale status of new users and determine which type of resources they should access. This improves the accuracy and speed of judgment, reduces user waiting time and waste of resources, and thus improves the efficiency and user experience of the entire grayscale release process.
[0057] In some embodiments of the present application, when a grayscale identifier exists, after determining that the new user is a grayscale user, the process further includes: determining whether the grayscale identifier of the new user is stored locally in the browser. If the grayscale identifier of the new user is not stored locally in the browser, the new identifier is stored.
[0058] Specifically, after determining that the new user is a grayscale user, the user's browser local storage is checked to see if it already contains grayscale identification information. If it is found that the new user's browser local storage does not have relevant grayscale identification data, the new grayscale identification information will be stored locally in the browser.
[0059] It is understandable that by checking the browser's local storage, the system can avoid unnecessary repeated operations and network requests, thereby reducing resource waste. If it finds that the grayscale identifier has not been stored locally, it will be proactively stored for future judgment and use, reducing user waiting time and improving the user's continuous access experience.
[0060] In some embodiments of the present application, when the grayscale identifier of the new user is inconsistent with the grayscale identifier of the old user, after triggering redirection, the method further includes: presetting a redirection time threshold.
[0061] In some embodiments of the present application, when the grayscale identifier of the new user is inconsistent with the grayscale identifier of the old user, after triggering redirection, the method further includes: collecting the time of the last redirection trigger, and when the time interval between the last redirection trigger time and the current time exceeds a redirection time threshold, triggering redirection. When the time interval between the last redirection trigger time and the current time does not exceed the redirection time threshold, redirection is not triggered.
[0062] Specifically, before determining whether the grayscale information has changed, a redirection time threshold is pre-set to determine when to trigger the redirection. This threshold is set based on business needs to ensure the appropriate redirection timing. The last redirection trigger time is collected and then compared with the current time. When the interval between the last redirection trigger time and the current time exceeds the pre-set redirection time threshold, the redirection is triggered. This means that if no redirection is performed for a period of time, the system will re-trigger to ensure timely determination of grayscale information changes.
[0063] It is understandable that a protection mechanism has been added for grayscale user redirection for client-side micro-applications that do not require password authentication to log in. A redirection time is stored locally in the browser. If the interval between the time of the last redirection and that of the previous redirection is less than a threshold, a normal in-page routing jump is executed. If the interval is greater than this threshold, the redirection logic is executed. By considering the time factor and the redirection interval, redirection can be triggered at the appropriate time to ensure the accuracy of grayscale information and the continuity of user access. In particular, for client-side micro-applications that do not require password authentication to log in, the redirection time mechanism provides a better user experience, avoids overly frequent redirections, and ensures accurate detection of whether grayscale information has changed.
[0064] In some embodiments of the present application, the redirection mechanism protection further includes: regardless of whether the redirection is triggered, the current time is stored as the new redirection time in the browser locally.
[0065] As you can understand, this increases the need for continuous monitoring and maintenance of system status. By continuously updating redirection times, we ensure that the latest time information is used in future judgments. This helps to more accurately determine when redirection is triggered, while also ensuring timely detection of grayscale information. This improves operational reliability, ensures a consistent user experience, and provides greater control over redirection operations.
[0066] In some embodiments of the present application, when the grayscale identification of the new user is inconsistent with the grayscale identification of the old user, redirection is triggered, including: if the old user is a grayscale user but the new user is a grayscale user, or the old user is a grayscale user but the new user is not a grayscale user, then redirection distribution is triggered with the correct resources.
[0067] It is understandable that by considering the difference in grayscale identification between new and old users, unnecessary resource waste and confusion are avoided, while providing more efficient resource distribution and user experience. This ensures that users obtain the appropriate version of resources without being aware of it.
[0068] An application embodiment of the present application: For grayscale user login, the cookie responded by the login interface will contain a grayscale identification. The cookie is read through document.cookie to identify whether the currently logged-in user is the target grayscale user. The grayscale identification is stored locally in the browser through localStorage. When switching accounts to log in, first read the grayscale identification stored locally in the browser, and then read the new cookie after the new account logs in to determine whether the new cookie contains the grayscale identification. At this time, the new identification is first stored locally in the browser. The next step is to determine whether the grayscale identification has changed. If the old account is not a grayscale user but the new account is a grayscale user, or the old account is a grayscale user but the new account is not a grayscale user, the redirection logic is triggered to distribute the correct resources. Otherwise, it is a normal page route jump and the old resources are used.
[0069] Triggering the redirect logic requires further evaluation. For client-side microapps, users log in without password authentication. Redirecting to the application triggers authentication again. This requires a protection mechanism. The browser stores a redirect time locally. If the interval between the last redirect time and the last redirect time is less than a threshold, a standard on-page route redirect is executed. If the interval is greater than the threshold, the redirect logic is executed. In either case, the current time must be saved locally in the browser as the new redirect time. The interval threshold is determined based on the specific business situation. It should not be too small, otherwise the page will refresh infinitely, nor too large, otherwise the user may switch accounts and re-authenticate to log in without triggering a redirect. For most business scenarios, a threshold of 10 seconds is a reasonable interval. This protection mechanism ensures a good user experience for grayscale users logging into the system without password authentication on the client side.
[0070] Redirection is achieved by setting the location.href property to the specific redirection interface address and the specified jump link parameters. The jump link parameters must be encoded using encodeURIComponent. After executing location.href, the page resources are reloaded. Nginx uses the cookie information to determine whether the user is a grayscale user. If so, the grayscale resource is delivered; if not, the normal version of the resource is delivered.
[0071] In the above embodiment, by collecting the login information of the new user and identifying the grayscale identifier of the new user, and judging whether the grayscale information has changed based on the grayscale identifier of the old user, an intelligent judgment is made as to whether the new user is a grayscale user. When the grayscale identifier of the new user is inconsistent with that of the old user, a redirection is triggered to ensure that only specific users can access the grayscale resources, thereby effectively conducting grayscale release testing. Compared with the traditional refresh page to load grayscale resources, this method improves efficiency and improves the user experience because users do not refresh the page frequently. It helps to ensure product quality, reduce the impact of potential problems on all users, and provide greater convenience and reliability for the update and maintenance process of Web applications.
[0072] In another preferred embodiment based on the above embodiment, this embodiment provides a system for distributing grayscale resources by redirecting pages, including:
[0073] Memory; and
[0074] A processor coupled to the memory is configured to execute the above-mentioned method of redirecting pages to distribute grayscale resources based on instructions stored in the memory.
[0075] On the other hand, the present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned method of redirecting pages to distribute grayscale resources.
[0076] It is understandable that the above-mentioned method, system and storage medium for redirecting pages to distribute grayscale resources have the same beneficial effects and will not be repeated here.
[0077] 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 take the form of a complete hardware embodiment, a complete software embodiment, or a combination of software and hardware embodiments. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0078] 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 produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0079] These computer program instructions may also be stored in a computer-readable memory that can direct 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 a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0080] 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, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0081] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0082] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A method for redirecting pages to distribute grayscale resources, characterized in that: include: Collect new user login information and identify new user grayscale identities; Determining whether the new user is a grayscale user according to the grayscale identifier; Determine whether the grayscale information has changed based on the grayscale identifier of the old user; When the grayscale identifier of the new user is inconsistent with the grayscale identifier of the old user, a redirection is triggered; When the grayscale identifiers of the new user and the old user are consistent, the original resources continue to be used.
2. The method for distributing grayscale resources by redirecting pages according to claim 1, characterized in that: Collect new user login information and identify new user grayscale identities, including: Pre-store the user's grayscale identification locally in the browser.
3. The method for distributing grayscale resources by redirecting pages according to claim 2, characterized in that: Judging whether the new user is a grayscale user according to the grayscale identifier includes: Read the login information of the new user to determine whether it contains the grayscale identifier; When the grayscale identifier exists, determining that the new user is a grayscale user; When the grayscale identifier does not exist, it is determined that the new user is not a grayscale user.
4. The method for distributing grayscale resources by redirecting pages according to claim 3, characterized in that: When the grayscale identifier exists, after determining that the new user is a grayscale user, the method further includes: Determine whether the grayscale identifier of the new user is stored locally in the browser; When the grayscale identifier of the new user is not stored locally in the browser, the new identifier is stored.
5. The method for distributing grayscale resources by redirecting pages according to claim 1, characterized in that: When the grayscale identifier of the new user is inconsistent with the grayscale identifier of the old user, after triggering the redirection, the method further includes: Pre-set redirection time threshold.
6. The method for distributing grayscale resources by redirecting pages according to claim 5, characterized in that: When the grayscale identifier of the new user is inconsistent with the grayscale identifier of the old user, after the redirection is triggered, the redirection mechanism protection is also included: Collect the last redirection trigger time, and when the time interval between the last redirection trigger time and the current time exceeds the redirection time threshold, trigger redirection; When the time interval between the last redirection triggering time and the current time does not exceed the redirection time threshold, redirection is not triggered.
7. The method for distributing grayscale resources by redirecting pages according to claim 6, characterized in that: The redirection mechanism protection also includes: Regardless of whether redirection is triggered, the current time is stored locally in the browser as the new redirection time.
8. The method for distributing grayscale resources by redirecting pages according to claim 1, characterized in that: When the grayscale identifier of the new user is inconsistent with the grayscale identifier of the old user, triggering redirection includes: If the old user is a grayscale user but the new user is a grayscale user, or the old user is a grayscale user but the new user is not a grayscale user, redirection distribution to the correct resource is triggered.
9. A system for redirecting pages to distribute grayscale resources, characterized in that: include: Memory; as well as A processor coupled to the memory, the processor being configured to execute the method for distributing grayscale resources by redirecting pages according to any one of claims 1-8 based on instructions stored in the memory.
10. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for distributing grayscale resources by redirecting pages as described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Redirect method and redirect device under PCC (Policy and Charging Control)
CN102811130A
Gray release method and gray release device
CN114598553A
Method and system for redirecting page to distribute gray resources and storage medium
CN117827308A
Systems and methods for storing references to original uniform resource identifiers
US20220236858A1