Gray scale updating method and device
By determining the grayscale hit result on the client and diversion control, the problem of frequent server-side code modification in grayscale updates is solved, and the effect of reducing maintenance costs and improving system stability is achieved.
Patent Information
- Application Number
- CN202510587585.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-15
AI Technical Summary
When adjusting the grayscale policy, the grayscale update solution requires a large number of modifications to the server-side code, resulting in high maintenance costs.
The client realizes the determination process of grayscale hit results, and reduces the server's judgment operations through grayscale control code and redirect control code shunt control.
It reduces the working pressure on the server and the maintenance cost of grayscale update projects, while improving the stability and flexibility of the grayscale update system.
Smart Images

Figure CN120491986A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a grayscale update method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] In the development and iteration process of Internet applications, grayscale updates are a common strategy that aims to conduct small-scale testing of new features or new versions to evaluate their performance, user experience, and potential problems, and ensure their stability and reliability before full promotion.
[0003] However, when adjusting the grayscale strategy, the grayscale update solution requires a lot of modification or even redeployment of the server-side code, and the maintenance cost of the grayscale update project is high.
[0004] It should be noted that the above content is not necessarily prior art, nor is it intended to limit the scope of patent protection of this application. Summary of the Invention
[0005] The embodiments of the present application provide a grayscale update method, apparatus, computer device, computer-readable storage medium, and computer program product to solve or alleviate one or more of the technical problems raised above.
[0006] One aspect of an embodiment of the present application provides a grayscale update method, the method comprising: In response to a target object accessing a target page, obtaining a full page file of the target page, wherein the full page file includes a grayscale control code; Acquire object information of the target object and page information of the target page; Determining a grayscale hit result corresponding to the target object according to the object information, the page information, and the grayscale control code; In the case that the grayscale hit result is a hit, a grayscale page file is obtained, and a grayscale page corresponding to the target page is displayed according to the grayscale page file.
[0007] Optionally, determining a grayscale hit result corresponding to the target object according to the object information, the page information, and the grayscale control code includes: Acquire a grayscale strategy code according to the grayscale control code, wherein the grayscale strategy code includes a grayscale hit rule; The grayscale hit result is determined according to the object information, the page information and the grayscale hit rule.
[0008] Optionally, obtaining a grayscale strategy code according to the grayscale control code includes: determining a target page type according to the page information; According to the target page type and the grayscale control code, a grayscale strategy code corresponding to the target page type is acquired.
[0009] Optionally, the target page type includes a first user page type and a second user page type; and the grayscale hit rule is generated according to the following operations: Get multiple object numbers and / or multiple device information; generating a grayscale hit rule corresponding to the first user page type according to the plurality of object numbers and / or the plurality of device information; and Obtain information on multiple business entities and multiple business areas; According to the plurality of business subject information and the plurality of business area information, a grayscale hit rule corresponding to the second user page type is generated.
[0010] Optionally, the full page file further includes a redirection control code; When the grayscale hit result is a hit, obtaining the grayscale page file includes: When the grayscale hit result is a hit, a grayscale page file is obtained according to the redirection control code.
[0011] Optionally, the method further includes: In the case where the grayscale hit result is a miss, the target page is displayed according to the full page file.
[0012] Another aspect of an embodiment of the present application provides a grayscale updating device, the device comprising: a response module, configured to obtain a full page file of the target page in response to a target object accessing the target page, wherein the full page file includes a grayscale control code; A first acquisition module is used to acquire the object information of the target object and the page information of the target page; a determination module, configured to determine a grayscale hit result corresponding to the target object according to the object information, the page information, and the grayscale control code; The second acquisition module is configured to acquire a grayscale page file when the grayscale hit result is a hit, and display a grayscale page corresponding to the target page according to the grayscale page file.
[0013] Another aspect of an embodiment of the present application provides a computer device, including: at least one processor; and a memory communicatively coupled to the at least one processor; Wherein: the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described above.
[0014] Another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the method described above is implemented.
[0015] Another aspect of an embodiment of the present application provides a computer program product, including a computer program, which implements the above-mentioned method when executed by a processor.
[0016] The embodiments of the present application employing the above-mentioned technical solution can provide the following advantages: The grayscale control code is used to determine the grayscale hit result of the target object, and the grayscale page is displayed in the event of a hit. The grayscale control code is located in the full page file and is executed when the client runs the code in the full page file. This allows the grayscale hit result determination process to be deployed on the client, thereby reducing the judgment operation on the server side, thereby reducing the workload on the server side and the maintenance cost of the grayscale update project. BRIEF DESCRIPTION OF THE DRAWINGS The accompanying drawings illustrate exemplary embodiments and constitute a part of the specification. Together with the description of the specification, they serve to explain exemplary implementation of the embodiments. The illustrated embodiments are for illustrative purposes only and do not limit the scope of the claims. Throughout the drawings, the same reference numerals designate similar, but not necessarily identical, elements.
[0017] Figure 1 The following diagram schematically shows an operating environment diagram of the grayscale update method according to the first embodiment of the present application; Figure 2 The flowchart of the grayscale updating method according to the first embodiment of the present application is schematically shown; Figure 3 Schematically shows Figure 2 Flowchart of sub-steps of step S204; Figure 4 Schematically shows Figure 3 Flowchart of sub-steps of step S300; Figure 5 Schematically shows a newly added flow chart of the grayscale update method according to the first embodiment of the present application; Figure 6 The following schematically shows an application framework diagram of the grayscale update method according to the first embodiment of the present application; Figure 7 The following schematically shows an exemplary application flow chart of the grayscale update method according to the first embodiment of the present application; Figure 8 Schematically shows an exemplary application timing diagram of the grayscale update method according to the first embodiment of the present application; Figure 9 A block diagram schematically shows a grayscale updating device according to the second embodiment of the present application; and Figure 10 The following schematically shows a hardware architecture diagram of a computer device according to the third embodiment of the present application. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solutions and advantages of this application more clear, the present application is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application. 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.
[0019] It should be noted that the descriptions of "first", "second", etc. in the embodiments of the present application are for descriptive purposes only and should not be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" or "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between the various embodiments can be combined with each other, but this must be based on the fact that they can be implemented by ordinary technicians in this field. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0020] In the description of this application, it should be understood that the numerical labels before the steps do not indicate the order in which the steps are executed. They are only used to facilitate the description of this application and to distinguish each step. Therefore, they cannot be understood as limitations on this application.
[0021] First, an explanation of the terms used in this application is provided: Grayscale is a strategy used during software development and release that aims to mitigate the risks associated with new releases by gradually and controllably releasing new features or versions to a subset of users. During a grayscale release, the system will redirect a subset of users to the new version (the grayscale version) based on pre-defined grayscale policies (such as user ID, device type, and geographic location), while other users continue to use the old version (the full version).
[0022] Full page: This is the standard page version normally displayed to all users in a product or system. It includes common functions and content and is the page that most users see when they visit. In grayscale update scenarios, it serves as a baseline version compared with the grayscale page.
[0023] Grayscale page: It is a special page used in software development to test new features or new versions. It allows developers to show new features to some users on a small scale for testing and verification before fully launching them online.
[0024] A grayscale hit refers to the process during a grayscale release where, based on pre-set grayscale policies (such as user characteristics and page information), the target object (user or request) is judged to meet the grayscale release requirements. If they meet the requirements, it's considered a grayscale hit; if not, it's considered a grayscale miss. The system displays the grayscale page or applies grayscale-related features and configurations to the target object.
[0025] The head tag is a crucial part of an HTML document, located at the top of the document, typically below the html tag and before the body tag. It defines the document's metadata (information about the document). This information isn't directly displayed in the main content of the webpage, but it plays a key role in the document's presentation, functionality, and interaction with external resources.
[0026] The body tag defines the main body of a web page, including all visible page content, such as the title h1 and paragraph p. When a browser parses an HTML file, it renders the page based on the content within the body tag, displaying elements such as the title and paragraph.
[0027] Nginx: An HTTP and reverse proxy server, as well as an IMAP / POP3 / SMTP proxy server. It is used for load balancing, reverse proxy, and static file serving, and can handle a large number of concurrent connections and requests.
[0028] Request Header: It is part of the HTTP request and contains a series of information attached when the client sends a request to the server. It describes the client environment, additional properties of the request, and the content type that the client can handle.
[0029] Cookie: A small data file created by a website and stored in the user's browser to save user information and browsing habits.
[0030] Reverse proxy: A server configuration that sits between clients and backend servers, acting as an intermediary. When a client sends a request, the reverse proxy server receives it and forwards it to one or more backend servers based on predefined rules.
[0031] CDN (Content Delivery Network): is a network technology that improves user access speed and website performance by caching website content (such as static resources such as images, videos, files, etc.) on multiple geographically dispersed servers.
[0032] SSR (Server-Side Rendering): is a web page generation technology that generates complete HTML pages on the server and then sends these pages directly to the client (such as a browser).
[0033] The C-end is the consumer-facing end of the business, involving products and services that directly interact with end users. In the internet and software industries, C-end applications typically include various applications, websites, and mobile apps for individual users.
[0034] B-end: It is the business end facing enterprises or organizations (Business), where products and services are mainly aimed at other enterprises or organizations rather than individual consumers.
[0035] Javascript: A programming language used to create dynamic web pages and enhance user interaction. It enables dynamic updates of web page content, responds to user actions, and communicates asynchronously with the server.
[0036] Tracking code: A piece of code embedded in a website or application that, with user authorization, collects and sends user behavior data to a third-party server. This data may include user interaction information such as page views, click events, and form submissions.
[0037] Heatmap analysis tool: It is a data visualization technology that uses color coding to intuitively display the size of data values on a two-dimensional chart. It is used to display geographic spatial data, user behavior data, or other types of matrix data.
[0038] webpack: It is a front-end resource packaging tool that can package various static resources in the project (such as JavaScript files, CSS files, images, etc.) into one or more bundle files for easy management and loading in web applications.
[0039] Secondly, to facilitate those skilled in the art to understand the technical solutions provided in the embodiments of the present application, the following describes the relevant technologies: In the field of software development and release, grayscale release technology has become a key strategy for ensuring system stability and the smooth launch of new features. However, the inventors have discovered that grayscale release technology has many limitations in practical applications. One application solution is to implement grayscale release based on Nginx. Leveraging Nginx's reverse proxy function, traffic is directed to the full or grayscale version based on specific request attributes (such as IP address, request header, or cookies). When resources need to be returned to the source, this solution, without CDN (Content Delivery Network) acceleration, results in slow page resource loading, severely impacting the user experience and failing to meet users' expectations for fast responses.
[0040] Another application solution is to implement grayscale releases based on SSR (server-side rendering). In this solution, grayscale strategies are integrated into the server-side rendering process, dynamically generating different HTML pages based on different user requests to achieve the grayscale effect. However, implementing this solution requires a complex and comprehensive SSR service system as support, which is difficult to develop and deploy, and has high maintenance costs, requiring a professional team to continuously invest in optimization and maintenance.
[0041] To this end, the present invention provides a grayscale update technology solution. In this technology solution, (1) the grayscale hit result determination process is implemented on the client side, which can reduce the judgment operation on the server side, thereby reducing the workload of the server side and the maintenance cost of the grayscale update project; (2) the diversion control is split into two parts through different code files. The grayscale control code determines the hit status according to the grayscale strategy, and the redirection control code is responsible for the grayscale page jump display. This can achieve functional decoupling of the grayscale update system and improve the stability of the grayscale update system; (3) CDN nodes can be used to accelerate the acquisition of page resources while maintaining the operation and maintenance deployment and the page resource access mode. See below for details.
[0042] Finally, for ease of understanding, an exemplary operating environment is provided below.
[0043] like Figure 1 As shown, the operating environment diagram includes: server 2, network 4, client 6, where: Server 2 can be composed of a single or multiple computing devices. These multiple computing devices can include virtualized computing instances. Virtualized computing instances can include virtual machines, such as emulations of computer systems, operating systems, servers, and the like. A computing device can load a virtual machine based on a virtual image and / or other data defining the specific software (e.g., operating system, specialized application, server) used for the emulation. As the demand for different types of processing services changes, different virtual machines can be loaded and / or terminated on one or more computing devices. A hypervisor can be implemented to manage the use of different virtual machines on the same computing device.
[0044] The server 2 can be configured to communicate with the client 6 and the like via a network 4. The network 4 includes various network devices, such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices, and / or the like. The network 4 can include physical links, such as coaxial cable links, twisted pair cable links, fiber optic links, combinations thereof, and the like, or wireless links, such as cellular links, satellite links, Wi-Fi links, and the like.
[0045] Server 2 can provide storage, reading, writing, querying, deleting and other services, such as providing web page file storage services for clients.
[0046] Client 6 can be an electronic device running an operating system such as Windows, Android™, or iOS, such as a smartphone, tablet, laptop, virtual reality device, gaming device, set-top box, in-vehicle terminal, or smart TV. Based on these operating systems, various applications, such as a web browser, can be run.
[0047] The client 6 may provide / configure a user access page for manipulating the server 2 or uploading objects, etc.
[0048] It should be noted that the above devices are exemplary, and the number and type of devices can be adjusted in different scenarios or according to different needs.
[0049] The following describes the technical solutions of the present application through multiple embodiments, taking the client 6 as the execution subject. It should be noted that these embodiments can be implemented in many different forms and should not be construed as being limited to the embodiments described here.
[0050] Example 1 Figure 2 The flowchart of the grayscale updating method according to the first embodiment of the present application is schematically shown.
[0051] like Figure 2 As shown, the grayscale update method may include steps S200 to S208, wherein: Step S200 : in response to a target object accessing a target page, obtaining a full page file of the target page, wherein the full page file includes a grayscale control code.
[0052] Step S202: Acquire the object information of the target object and the page information of the target page.
[0053] Step S204 : determining a grayscale hit result corresponding to the target object according to the object information, the page information and the grayscale control code.
[0054] Step S206 , when the grayscale hit result is a hit, a grayscale page file is obtained, and a grayscale page corresponding to the target page is displayed according to the grayscale page file.
[0055] The grayscale update method provided in this embodiment uses the grayscale control code to determine the grayscale hit result of the target object. The grayscale control code is located in the full page file and is executed when the client runs the code in the full page file. In this way, the grayscale hit result determination process can be deployed on the client, thereby reducing the judgment operation of the server, thereby reducing the workload of the server and the maintenance cost of the grayscale update project.
[0056] The following combination Figure 2 , each step in steps S200~S206 and other optional steps are described in detail.
[0057] Step S200 In response to the target object accessing the target page, a full page file of the target page is obtained, where the full page file includes a grayscale control code.
[0058] The target object can be individual users of the software application (such as consumers) or corporate users (such as merchants), etc. The target page can be various functional pages in the application, such as the homepage, product display page, event page, personal center page, payment page, etc.
[0059] In some embodiments, the full page file can be the latest full page file obtained from the server, or a historical full page file obtained from the local cache. The grayscale control code can be located at the head tag of the page code in the full page file, at the end of the body tag, before or after a specific functional module, etc.
[0060] Step S202 , obtaining the object information of the target object and the page information of the target page.
[0061] In some embodiments, object information can be user identity information such as user ID and account name, obtained with the authorization of the user (i.e., the target object). Object information can also include status information such as the user's geographic location, device information, and network environment information. Page information can include page type, such as a customer-facing page (product details page, homepage, event page, etc.) or a business-facing page (administration backend page, data analysis page, etc.). Page information can also include page version number, page URL, page name, and the business line to which the page belongs.
[0062] The object information and page information can be historical data obtained from the local cache or the latest data obtained from the server.
[0063] Step S204 , determining the grayscale hit result corresponding to the target object according to the object information, the page information and the grayscale control code.
[0064] In some embodiments, the grayscale control code may include a rule code for calculating a grayscale hit result, and when executed, the grayscale hit result is calculated according to the included rule code and related information (object information and page information).
[0065] In other embodiments, the grayscale control code may also actively obtain the rule code file used to calculate the grayscale hit results from a specific code platform of the server (such as a grayscale policy distribution platform, etc.) or a local cache when being run, and calculate the grayscale hit results based on the obtained rule code and related information.
[0066] In some embodiments, with the user's authorization, object information, page information, and the user's historical behavior data (such as user portrait, access frequency, dwell time, etc.) can be combined for analysis to more accurately calculate the grayscale hit results.
[0067] In this embodiment, the grayscale control code is run on the client to calculate the grayscale hit results. Implementing the calculation process on the client can reduce the computing logic deployed on the server, thereby reducing the computing pressure on the server and the maintenance cost of the grayscale update project.
[0068] As mentioned above, there are multiple ways to determine the grayscale hit result. An exemplary determination method is provided below.
[0069] In an optional embodiment, if Figure 3 As shown, step S204 includes: S300 , obtaining a grayscale strategy code according to the grayscale control code, wherein the grayscale strategy code includes a grayscale hit rule.
[0070] S302 : Determine the grayscale hit result according to the object information, the page information, and the grayscale hit rule.
[0071] In some embodiments, the grayscale policy code may be a historical grayscale policy code obtained from local storage, a specific configuration file, etc., or the latest grayscale policy code obtained from a specific code platform of a server (such as a grayscale policy distribution platform, etc.).
[0072] In some embodiments, the grayscale hit rule can be one or a combination of rules based on geographic location (such as users in a specific area hit the grayscale), rules based on user ID (such as users with a user ID ending in 9 hit the grayscale), rules based on page access time (such as users who access the target page between 5:00 PM and 6:00 PM hit the grayscale), etc. For example, if a target object with user ID 00001 accesses the target page at 5:30 PM, and the grayscale hit rules obtained from the grayscale policy distribution platform include Rule A (users with a user ID ending in 1 hit the grayscale) and Rule B (users who access the target page between 5:00 PM and 6:00 PM hit the grayscale), then the grayscale hit result for the target object can be determined to be a hit.
[0073] In some embodiments, when using a combination of multiple rules to determine the grayscale hit result, a weight value can also be assigned to each grayscale hit rule based on different object information and page information, and the final grayscale hit probability can be comprehensively calculated based on the hit results and corresponding weight values of each grayscale hit rule. When the grayscale hit probability is higher than the preset probability threshold, it can be determined as a grayscale hit.
[0074] For example, when using a combination of rules A1, A2, and A3 to determine a grayscale hit result, the hit results for target object U's visit to the target page for the three rules are 0, 1, and 1, respectively ("0" represents a miss, and "1" represents a hit). If the three rules are configured with a corresponding weight array of 2:3:5, the grayscale hit probability for target object U's visit to the target page is P = (0×2+1×3+1×5)×0.1=0.8. If the grayscale hit probability P exceeds 0.6 (the preset probability threshold), the visit is considered a grayscale hit. If the grayscale hit rules cannot determine a grayscale hit result, a rule error can be reported and manual intervention can be performed.
[0075] In this embodiment, the grayscale hit result is calculated based on the obtained grayscale hit rule. Performing hit judgment based on specific grayscale hit rules and related information can improve the accuracy of grayscale hit result calculation, thereby improving the accuracy and efficiency of grayscale update.
[0076] As mentioned above, there are multiple ways to obtain the grayscale policy code. The following is an exemplary method for obtaining it.
[0077] In an optional embodiment, if Figure 4 As shown, step S300 includes: S400: Determine the target page type according to the page information.
[0078] S402 : Acquire a grayscale strategy code corresponding to the target page type according to the target page type and the grayscale control code.
[0079] Target page types can be differentiated based on the type of user they target. For example, they can be categorized as consumer-facing pages (such as product details pages, homepages, and event pages) for individual users, or business-facing pages (such as management backend pages and data analysis pages) for corporate users or organizations.
[0080] In some embodiments, the target page type can also be distinguished according to the page function type (such as home page, details page, etc.), page style type (such as dark mode page, minimalist style page, etc.), page performance type (such as high-load page), etc.
[0081] In some embodiments, the grayscale strategy code may be pre-generated based on a plurality of fixed page types. In other embodiments, the grayscale strategy code may also be dynamically generated based on factors such as the target page type and real-time business needs, user operations, etc.
[0082] In this embodiment, the grayscale policy code is obtained according to the specific target page type. Selecting different grayscale policy codes according to different types of target pages can improve the accuracy and effectiveness of grayscale policy code selection, thereby improving the flexibility and scalability of the grayscale update process.
[0083] As mentioned above, there are multiple methods for classifying target page types, and grayscale hit rules can be formulated using different methods for different classification methods. The following provides an exemplary target page type classification method and its corresponding grayscale hit rule formulation method.
[0084] In an optional embodiment, the target page type includes a first user page type and a second user page type.
[0085] like Figure 5 As shown, the grayscale hit rule is generated according to the following operations: S500: Acquire multiple object numbers and / or multiple pieces of device information.
[0086] S502: Generate a grayscale hit rule corresponding to the first user page type according to the plurality of object numbers and / or the plurality of device information.
[0087] S504: Acquire information of multiple business entities and / or information of multiple business areas.
[0088] S506: Generate a grayscale hit rule corresponding to the second user page type according to the multiple business subject information and / or multiple business area information.
[0089] The first user page can be a C-end page for individual users (such as a product details page, home page, activity page, etc.), and the second user page can be a B-end page for corporate users or organizations (such as a management backend page, a data analysis page, etc.).
[0090] In some embodiments, the object ID may be a user's account ID, etc., and the device information may include the device type (mobile device or desktop device, mobile phone or tablet, etc.), system version, device performance parameters (CPU / GPU performance, screen resolution, etc.). In other embodiments, the grayscale hit rule corresponding to the first user page type may be generated in combination with the function type of the page.
[0091] In some embodiments, the business entity information may include store number, store type, distribution station name, etc., and the business area information may include distribution area, distribution business line, etc.
[0092] For example, for the C-end page (i.e. the first user page), you can formulate grayscale hit rules according to the user number, and set the user number ending in 9 as the hit grayscale; for another example, for the B-end page (i.e. the second user page), you can formulate grayscale hit rules according to the store number, and set 30% of all store numbers as the hit grayscale.
[0093] In this embodiment, grayscale hit rules are customized based on user characteristics and business characteristics. Accurate and personalized grayscale hit rules are generated for pages of different user types, thereby achieving accurate grayscale diversion for different user groups or business scenarios, which can improve the flexibility and pertinence of grayscale control.
[0094] Step S206 , when the grayscale hit result is a hit, a grayscale page file is obtained, and a grayscale page corresponding to the target page is displayed according to the grayscale page file.
[0095] Grayscale page files may include HTML (Hypertext Markup Language) files and JavaScript files used to display grayscale pages. Grayscale pages may include features, layouts, graphics, and text content that differ from or are not found on full-scale pages. Grayscale pages may also include user feedback portals, such as questionnaires, online customer service, and feedback forms. With user authorization, grayscale pages can also collect user behavior data for analysis through data collection points (such as user behavior tracking code and heat map analysis tools).
[0096] Grayscale page files can be historical files retrieved from the client's local cache or new files obtained from a server or CDN node. When obtaining a grayscale page file, you can also determine whether it is the latest version based on the file's timestamp. If an older version of the grayscale page file is obtained, you can determine whether to re-obtain the latest version based on your needs.
[0097] In this embodiment, when a grayscale update is hit, a grayscale page is displayed using a grayscale page file. The displayed grayscale page allows the target object to obtain grayscale page content that is different from the full page, thereby achieving the goal of the grayscale update process. Different versions of the page can be displayed for specific objects for testing, verification, or promotion.
[0098] As mentioned above, there are many ways to obtain the grayscale page file. An exemplary method for obtaining the grayscale page file is provided below.
[0099] In an optional embodiment, the full page file further includes a redirection control code, and step S206 includes: When the grayscale hit result is a hit, a grayscale page file is obtained according to the redirection control code.
[0100] The redirection control code can be located at the head tag of the page code in the full page file, or at the end of the body tag, before or after a specific functional module, etc. The redirection control code can redirect the client's access to a preset resource address to obtain the grayscale page file. In some embodiments, there may be multiple versions of grayscale page files at the same time. In this case, the redirection code can also indicate the specific version of the grayscale page file that needs to be obtained.
[0101] In some embodiments, after obtaining the grayscale page file, the integrity and security of the grayscale page file can be verified by verifying the file's hash value, digital signature, etc. While obtaining the grayscale page file, other resources related to the grayscale page, such as images, scripts, style sheets, etc., can also be preloaded through the full page file.
[0102] In this embodiment, the grayscale page file is obtained through redirection control code. Different code files are used to split the diversion control into two parts. The grayscale control code determines the hit status based on the grayscale strategy, while the redirection control code is responsible for grayscale page jump display. This can achieve functional decoupling of the grayscale update system and improve the stability of the grayscale update system.
[0103] The above describes how to display the corresponding grayscale page when the target object hits the grayscale. When the target object does not hit the grayscale, there are also various optional display contents and methods. The following provides an example display method.
[0104] In an optional embodiment, the method further includes: In the case where the grayscale hit result is a miss, the target page is displayed according to the full page file.
[0105] The full page file and the grayscale page file can be constructed based on a build process modified by a webpack plug-in, and different HTML file names are set during the build (such as index.html for the full page version and grey.html for the grayscale version). In some embodiments, the target page may also include a jump button or an application button, etc., and the target object that does not hit the grayscale can also jump or apply to access the grayscale page through these buttons. In other embodiments, when the grayscale hit result of the target object is a miss, the client can also obtain and cache the grayscale page file locally on the client in advance.
[0106] In some embodiments, with user authorization, by analyzing the user's behavior patterns on the full page (such as whether the user stays for a long time in a functional area that has been optimized or updated in the grayscale page, etc.), it can be intelligently determined whether it is necessary to jump to the grayscale page.
[0107] In this embodiment, the target page is displayed for target objects that do not hit the grayscale policy. Even when the target object does not hit the grayscale policy, the target page can still be displayed normally based on the full page file, ensuring the continuity and consistency of the user experience. At the same time, it avoids the situation where the page display is abnormal or blank when the grayscale hit result is a miss, ensuring the stable operation of the grayscale update system.
[0108] It should be noted that, by using the grayscale update method of the embodiment of the present application, CDN nodes can be used to accelerate the acquisition of page resources while maintaining unchanged operation and maintenance deployment and unchanged page resource access mode. Figure 6 Schematic diagram of the system architecture of the grayscale update system constructed according to the grayscale update method of the embodiment of the present application. The version control layer can modify the build process based on the webpack plug-in and generate HTML file names corresponding to different versions during the build process to distinguish the full version index.html (i.e. the target page) from the grayscale version grey.html (i.e. the grayscale page); The traffic diversion control layer includes the redirection control JS (i.e., redirection control code) and the grayscale control JS (i.e., grayscale control code). The grayscale control JS requests the grayscale policy distribution platform to load the grayscale policy JSON file (i.e., grayscale policy code) and calculates the grayscale hit result based on page information and user information. The redirection control JS determines whether to redirect to the grayscale page based on the grayscale hit result. The grayscale policy distribution platform of the grayscale policy layer can formulate and distribute grayscale policy JSON files; The compilation and construction layer can be packaged and configured based on webpack, and the diversion control code logic (i.e. redirection control code and grayscale control code) can be inserted into the head tag of the index.html page.
[0109] In order to make this application easier to understand, the following Figure 7 and Figure 8 An exemplary application is provided, wherein: S11, user U (i.e., target object) clicks to access activity webpage A (i.e., target page) on mobile phone (i.e., client); S12, obtain the index.html file (i.e., the full page file) of the A activity webpage from the server. The head tag of index.html includes the grayscale control js (i.e., the grayscale control code) and the redirection control js (i.e., the redirection control code); S13, determining that the A activity webpage is a C-end page (i.e., the first user page type); S14: Run the Grayscale Control JS to obtain the Grayscale policy JSON (i.e., Grayscale policy code) for the C-end page from the Grayscale policy platform. The Grayscale policy JSON indicates that users with account IDs ending in 9 are eligible for Grayscale (i.e., Grayscale hit rule). S15: Calculate whether the grayscale application is eligible based on the user U's account ID (i.e., object information) and the grayscale policy JSON. If yes, go to step S16, otherwise go to step S17; S16, run the redirection control js to obtain the grayscale page file grey.html (i.e., grayscale page file) of the A activity webpage from the server, and run grey.html on the mobile phone to display the grayscale version of the A activity webpage (i.e., grayscale page); S17, run index.html on the mobile phone to display the A activity webpage.
[0110] Example 2 Figure 9 The block diagram of the grayscale update device according to the second embodiment of the present application is schematically shown. The device can be divided into one or more program modules, one or more program modules are stored in a storage medium and executed by one or more processors to complete the embodiment of the present application. The program module referred to in the embodiment of the present application refers to a series of computer program instruction segments that can complete specific functions. The following description will specifically introduce the functions of each program module in this embodiment. Figure 9 As shown, the apparatus 1000 may include: a response module 1100, a first acquisition module 1200, a determination module 1300, and a second acquisition module 1400, wherein: A response module 1100 is configured to obtain a full page file of the target page in response to a target object accessing the target page, wherein the full page file includes a grayscale control code; A first acquisition module 1200 is configured to acquire object information of the target object and page information of the target page; A determination module 1300 is configured to determine a grayscale hit result corresponding to the target object based on the object information, the page information, and the grayscale control code; The second acquisition module 1400 is configured to acquire a grayscale page file when the grayscale hit result is a hit, and display a grayscale page corresponding to the target page according to the grayscale page file.
[0111] As an optional embodiment, the determining module 1300 is further configured to: Acquire a grayscale strategy code according to the grayscale control code, wherein the grayscale strategy code includes a grayscale hit rule; The grayscale hit result is determined according to the object information, the page information and the grayscale hit rule.
[0112] As an optional embodiment, the determining module 1300 is further configured to: determining a target page type according to the page information; According to the target page type and the grayscale control code, a grayscale strategy code corresponding to the target page type is acquired.
[0113] As an optional embodiment, the target page type includes a first user page type and a second user page type, and the apparatus 1000 further includes a grayscale hit rule generation module for: Get multiple object numbers and / or multiple device information; generating a grayscale hit rule corresponding to the first user page type according to the plurality of object numbers and / or the plurality of device information; and Obtain information on multiple business entities and multiple business areas; According to the plurality of business subject information and the plurality of business area information, a grayscale hit rule corresponding to the second user page type is generated.
[0114] As an optional embodiment, the full page file further includes a redirection control code, and the second acquisition module 1400 is further configured to: When the grayscale hit result is a hit, a grayscale page file is obtained according to the redirection control code.
[0115] As an optional embodiment, the apparatus 1000 further includes a display module, configured to: In the case where the grayscale hit result is a miss, the target page is displayed according to the full page file.
[0116] Example 3 Figure 10 The following schematically shows a hardware architecture diagram of a computer device 10000 suitable for implementing the grayscale update method according to the third embodiment of the present application. In some embodiments, the computer device 10000 can be a terminal device such as a smart phone, a wearable device, a tablet computer, a personal computer, a vehicle-mounted terminal, a game console, a virtual device, a workbench, a digital assistant, a set-top box, a robot, etc. In other embodiments, the computer device 10000 can be a rack server, a blade server, a tower server, or a cabinet server (including an independent server, or a server cluster composed of multiple servers), etc. Figure 10 As shown, the computer device 10000 includes but is not limited to: a memory 10010, a processor 10020, and a network interface 10030 that can communicate with each other via a system bus. Memory 10010 includes at least one type of computer-readable storage medium, including flash memory, a hard disk, a multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic storage, a magnetic disk, an optical disk, and the like. In some embodiments, memory 10010 may be an internal storage module of computer device 10000, such as a hard disk or memory of computer device 10000. In other embodiments, memory 10010 may also be an external storage device of computer device 10000, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card, and the like equipped on computer device 10000. Of course, memory 10010 may also include both internal storage modules and external storage devices of computer device 10000. In this embodiment, the memory 10010 is generally used to store the operating system and various application software installed on the computer device 10000, such as the program code of the grayscale update method, etc. In addition, the memory 10010 can also be used to temporarily store various data that has been output or will be output.
[0117] In some embodiments, processor 10020 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other chips. Processor 10020 is typically used to control the overall operation of computer device 10000, such as performing control and processing related to data exchange or communication with computer device 10000. In this embodiment, processor 10020 is used to execute program code stored in memory 10010 or process data.
[0118] Network interface 10030 may include a wireless network interface or a wired network interface. Network interface 10030 is typically used to establish a communication link between computer device 10000 and other computer devices. For example, network interface 10030 is used to connect computer device 10000 to an external terminal via a network, establishing a data transmission channel and a communication link between computer device 10000 and the external terminal. The network may be a wireless or wired network such as an intranet, the Internet, the Global System of Mobile Communications (GSM), Wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, Bluetooth, or Wi-Fi.
[0119] It should be pointed out that Figure 10 Only a computer device having components 10010 - 10030 is shown, but it should be understood that implementing all of the shown components is not a requirement, and greater or fewer components may alternatively be implemented.
[0120] In this embodiment, the grayscale update method stored in the memory 10010 can also be divided into one or more program modules and executed by one or more processors (such as processor 10020) to complete the embodiment of the present application.
[0121] Example 4 An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the grayscale update method in the embodiment are implemented.
[0122] In this embodiment, computer-readable storage media include flash memory, hard disks, multimedia cards, card-type memories (e.g., SD or DX memories), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic storage, magnetic disks, optical disks, and the like. In some embodiments, the computer-readable storage medium may be an internal storage unit of a computer device, such as the computer device's hard disk or memory. In other embodiments, the computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card, and the like. Of course, the computer-readable storage medium may also include both the internal storage unit and external storage devices of the computer device. In this embodiment, the computer-readable storage medium is typically used to store the operating system and various application software installed on the computer device, such as the program code of the grayscale update method described in the embodiment. In addition, the computer-readable storage medium may also be used to temporarily store various types of data that has been output or is about to be output.
[0123] Example 5 An embodiment of the present application further provides a computer program product, including a computer program, which implements the method in the above embodiment when executed by a processor.
[0124] Obviously, those skilled in the art should understand that the modules or steps of the above-mentioned embodiments of the present application can be implemented using general-purpose computer devices. They can be concentrated on a single computer device or distributed on a network composed of multiple computer devices. Alternatively, they can be implemented using program codes executable by the computer device, so that they can be stored in a storage device and executed by the computer device. In some cases, the steps shown or described can be performed in a different order than herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the embodiments of the present application are not limited to any specific combination of hardware and software.
[0125] It should be noted that the above are only preferred embodiments of the present application and do not limit the scope of patent protection of the present application. Any equivalent structure or equivalent process transformation made using the contents of the description and drawings of this application, or directly or indirectly applied in other related technical fields, are also included in the scope of patent protection of the present application.
Claims
1. A grayscale update method, characterized in that: For a client, the method includes: In response to a target object accessing a target page, obtaining a full page file of the target page, wherein the full page file includes a grayscale control code; Acquire object information of the target object and page information of the target page; Determining a grayscale hit result corresponding to the target object according to the object information, the page information, and the grayscale control code; In the case that the grayscale hit result is a hit, a grayscale page file is obtained, and a grayscale page corresponding to the target page is displayed according to the grayscale page file.
2. The method according to claim 1, characterized in that Determining a grayscale hit result corresponding to the target object according to the object information, the page information, and the grayscale control code includes: Acquire a grayscale strategy code according to the grayscale control code, wherein the grayscale strategy code includes a grayscale hit rule; The grayscale hit result is determined according to the object information, the page information and the grayscale hit rule.
3. The method according to claim 2, characterized in that Obtaining a grayscale strategy code according to the grayscale control code includes: determining a target page type according to the page information; According to the target page type and the grayscale control code, a grayscale strategy code corresponding to the target page type is acquired.
4. The method according to claim 3, characterized in that The target page type includes a first user page type and a second user page type; the grayscale hit rule is generated according to the following operations: Get multiple object numbers and / or multiple device information; generating a grayscale hit rule corresponding to the first user page type according to the plurality of object numbers and / or the plurality of device information; and Obtain information on multiple business entities and / or multiple business areas; A grayscale hit rule corresponding to the second user page type is generated according to the multiple business subject information and / or multiple business area information.
5. The method according to claim 1, characterized in that The full page file also includes a redirection control code; When the grayscale hit result is a hit, obtaining the grayscale page file includes: When the grayscale hit result is a hit, a grayscale page file is obtained according to the redirection control code.
6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: In the case where the grayscale hit result is a miss, the target page is displayed according to the full page file.
7. A grayscale updating device, characterized in that: The device comprises: a response module, configured to obtain a full page file of the target page in response to a target object accessing the target page, wherein the full page file includes a grayscale control code; A first acquisition module is used to acquire the object information of the target object and the page information of the target page; a determination module, configured to determine a grayscale hit result corresponding to the target object according to the object information, the page information, and the grayscale control code; The second acquisition module is configured to acquire a grayscale page file when the grayscale hit result is a hit, and display a grayscale page corresponding to the target page according to the grayscale page file.
8. A computer device, characterized in that: include: at least one processor; and a memory communicatively coupled to the at least one processor; wherein: The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, which, when executed by a processor, implement the method according to any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.