Gray scale processing method, system, computing device, and storage medium

By generating and providing HTML files with different grayscale ratios in a static file server, the problems of high cost and low stability of grayscale deployment in static file servers are solved, and efficient grayscale deployment capability is achieved.

CN117312716BActive Publication Date: 2025-12-26SHANGHAI BILIBILI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311332036.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-13
Publication Date
2025-12-26
Estimated Expiration
2043-10-13

AI Technical Summary

Technical Problem

Existing static file servers have high development costs and low stability and processing efficiency during canary releases, which has a significant impact, especially in scenarios with high concurrency and many business lines.

Method used

By acquiring structured data from web page canary release requests, HTML files are generated and provided to the user's client by a static file server for canary calculation. Different HTML file generation methods are used to determine the rendering content based on the canary ratio, including baseline, combined, and target version HTML file generation methods.

Benefits of technology

Without altering the existing static file server architecture, the canary release process was simplified, development and maintenance costs were reduced, and server stability and processing efficiency were improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117312716B_ABST
    Figure CN117312716B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a gray processing method and system, a computing device and a storage medium, wherein the method comprises: obtaining structured data corresponding to a Web page gray publishing request; generating an HTML file corresponding to the Web page according to the structured data; pushing the HTML file corresponding to the Web page to a static file server, providing the HTML file by the static file server to a user terminal, so that the user terminal performs gray calculation according to the HTML file, determines and renders HTML content to be displayed. The present application can conveniently realize the gray publishing capability of the static Web page according to the generated HTML file without changing the existing static file server architecture, the implementation is simple, no gray processing module needs to be added, the development and operation and maintenance cost of the gray publishing capability is effectively reduced, the influence on the static file server is effectively reduced, and the gray processing manner under the static file server is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of Internet, in particular to a gray processing method and system, a computing device and a storage medium. BACKGROUND

[0002] The existing gray release scheme generally configures a gray strategy on a gray platform and pushes it to an application server. The application server, when processing a user request, decides a target version hit by the user according to a user identifier in the user request, looks up a gray code or a service corresponding to the target version, runs the corresponding code or calls the corresponding service to obtain a rendered HTML page, and returns the HTML page to the user. The gray release scheme usually requires the server to process the gray strategy. However, the service of a static Web page usually directly uses a static file server. If a gray processing module is added to the static file server, on the one hand, there is a high development cost, and on the other hand, the stability and processing efficiency of the server will be significantly reduced, especially in the high-concurrency and multi-business-line static Web page scenario, which has a greater impact on the server. SUMMARY

[0003] In view of the above problems, the present application provides a gray processing method, system, computing device and storage medium, which is used to solve the following problems: the existing gray processing method under the static file server has a high development cost and significantly reduces the stability and processing efficiency of the server.

[0004] According to an aspect of an embodiment of the present application, a gray processing method is provided, comprising:

[0005] obtaining structured data corresponding to a Web page gray release request;

[0006] generating an HTML file corresponding to the Web page according to the structured data;

[0007] pushing the HTML file corresponding to the Web page to a static file server, so that the static file server provides the HTML file to a user terminal, so that the user terminal performs gray calculation according to the HTML file, determines and renders HTML content to be displayed.

[0008] Further, obtaining the structured data corresponding to the Web page gray release request further comprises:

[0009] in response to the Web page gray release request, finding HTML content corresponding to a page version identifier in the Web page gray release request from a build product pushed by a build system according to the page version identifier;

[0010] The page version identifier corresponding HTML content and the gray release demand data in the gray release request are determined as the structured data corresponding to the gray release request.

[0011] Further, the gray release demand data includes a gray ratio, a gray strategy and a white list.

[0012] The page version identifier includes a reference version identifier and a target version identifier.

[0013] Further, generating the HTML file corresponding to the web page according to the structured data further includes:

[0014] Determining the HTML file generation mode according to the gray ratio in the structured data;

[0015] Generating the HTML file corresponding to the web page according to the HTML file generation mode.

[0016] Further, determining the HTML file generation mode according to the gray ratio in the structured data further includes:

[0017] If the gray ratio is a first ratio, the HTML file generation mode is determined as a reference version HTML file generation mode;

[0018] If the gray ratio is greater than the first ratio and less than a second ratio, the HTML file generation mode is determined as a combination version HTML file generation mode;

[0019] If the gray ratio is equal to the second ratio, the HTML file generation mode is determined as a target version HTML file generation mode.

[0020] Further, generating the HTML file corresponding to the web page according to the HTML file generation mode further includes:

[0021] If the HTML file generation mode is the reference version HTML file generation mode, the HTML file corresponding to the web page is generated according to the reference version identifier and the HTML content corresponding to the reference version identifier;

[0022] If the HTML file generation mode is the combination version HTML file generation mode, preset HTML tag content is generated by using the reference version identifier, the target version identifier, the gray strategy, the white list and a gray calculation code; the HTML file corresponding to the web page is generated according to the HTML content corresponding to the reference version identifier, the HTML content corresponding to the target version identifier and the preset HTML tag content;

[0023] If the HTML file generation manner is the target version HTML file generation manner, the HTML file corresponding to the Web page is generated according to the target version identifier and the HTML content corresponding to the target version identifier.

[0024] Further, the gray scale strategy includes a user bucketing strategy, and the user bucketing strategy records a division rule of dividing each user terminal into each bucket and a page version identifier corresponding to each bucket.

[0025] Further, the method further includes:

[0026] Collecting abnormal error information corresponding to the Web page, wherein the abnormal error information includes a page version identifier of the page content to be displayed.

[0027] According to another aspect of the embodiments of the present application, a gray scale processing system is provided, comprising:

[0028] The acquisition module is adapted to acquire structured data corresponding to the Web page gray scale publishing request;

[0029] The generation module is adapted to generate an HTML file corresponding to the Web page according to the structured data;

[0030] The transmission module is adapted to push the HTML file corresponding to the Web page to the static file server, and the static file server provides the HTML file to the user terminal, so that the user terminal performs gray scale calculation according to the HTML file, determines and renders the HTML content to be displayed.

[0031] According to still another aspect of the embodiments of the present application, a computing device is provided, comprising a processor, a memory, a communication interface and a communication bus, the processor, the memory and the communication interface complete communication with each other through the communication bus;

[0032] The memory is used to store at least one executable instruction, and the executable instruction causes the processor to perform the operations corresponding to the above-mentioned gray scale processing method.

[0033] According to still another aspect of the embodiments of the present application, a computer storage medium is provided, and the storage medium stores at least one executable instruction, and the executable instruction causes the processor to perform the operations corresponding to the above-mentioned gray scale processing method.

[0034] According to the gray processing method, system, computing device and storage medium provided by the embodiment of the application, the structured data corresponding to the gray release request of the Web page can be used to conveniently generate the HTML file corresponding to the Web page, wherein different HTML file generation methods are used to generate the HTML file corresponding to the Web page according to different gray scales, and the generated HTML file is provided to the user end by the static file server; on the premise of not changing the existing static file server architecture, the gray release capability of the static Web page can be conveniently realized according to the generated HTML file, compared with the existing gray processing method under the static file server, the implementation method is simple, the gray processing module does not need to be added, the development and operation and maintenance cost of the gray release capability is effectively reduced, the influence on the static file server is effectively reduced, and the gray processing method under the static file server is optimized.

[0035] The above description is only a summary of the technical solutions of the embodiments of the application, in order to more clearly understand the technical means of the embodiments of the application, the embodiments of the application can be implemented according to the content of the specification, and in order to make the above and other purposes, characteristics and advantages of the embodiments of the application more obvious and easy to understand, the following specific embodiments of the embodiments of the application are described. BRIEF DESCRIPTION OF DRAWINGS

[0036] By reading the detailed description of the preferred embodiments below, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of illustrating the preferred embodiments and are not considered as limiting the embodiments of the application. Moreover, the same reference symbols are used to represent the same components throughout the drawings. In the drawings:

[0037] Figure 1 A flowchart of a gray processing method according to an embodiment of the application is shown;

[0038] Figure 2a A flowchart of a gray processing method according to another embodiment of the application is shown;

[0039] Figure 2b An example of script tag content is shown;

[0040] Figure 3 A flowchart of a gray processing method corresponding to a gray strategy is shown;

[0041] Figure 4 A structural block diagram of a gray processing system according to an embodiment of the application is shown;

[0042] Figure 5 A structural diagram of a computing device according to an embodiment of the application is shown. DETAILED DESCRIPTION

[0043] Exemplary embodiments of the present disclosure will be described in greater detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the present disclosure to those skilled in the art.

[0044] First, the nomenclature related to one or more embodiments of the present application is explained.

[0045] Gray release: refers to a release method that allows part of the users to access the new version according to the user identifier and the gray scale ratio when the code is released to the production environment, so as to collect the problems of the new version.

[0046] Gray scale: the proportion of new features opened to the target user group.

[0047] Gray strategy: refers to which data needs to be used as the basis for gray calculation. Commonly used are user ID identifier and device identifier or pure randomness.

[0048] Static Web page: refers to an HTML page that does not have dynamic server technology support, is provided by a simple file server, and does not change with request parameters and service state.

[0049] Static file server: a server used to store and provide static files (such as HTML, CSS, images, videos, and JavaScript files, etc.). It provides a mechanism for accessing static files, allowing any user on the system to access and download these files through the HTTP protocol.

[0050] HTML: refers to HyperText Markup Language, which is a markup language. It includes a series of tags that can unify the format of documents on the network, allowing scattered Internet resources to be connected into a logical whole. HTML text is a descriptive text composed of HTML commands, which can describe text, graphics, animation, sound, tables, links, etc.

[0051] script tag: an important element in HTML, used to embed or reference JavaScript code. In a web page, JavaScript code can be used to implement various dynamic functions, such as responding to user interaction, updating content, creating animation effects, etc.

[0052] Figure 1 A flowchart of a gray processing method according to an embodiment of the present application is shown, as shown in Figure 1 The method comprises the following steps:

[0053] In step S101, the structured data corresponding to the Web page gray release request is obtained.

[0054] When the developer updates or modifies the HTML content of the reference version of the static Web page to form a target version, and wants to perform gray release on the target version, a Web page gray release request can be sent according to the gray release requirements thereof, wherein the Web page gray release request can include page version identifiers, gray release requirement data, and the like. Specifically, the page version identifiers include page version identifiers of each version of the Web page required for gray release. The page version identifier is identification information for uniquely identifying the version of the Web page, which can be a page version number, a page version ID, or the like. The gray release requirement data can include a gray scale, a gray strategy, and a white list, and the like. The Web page in this embodiment refers to a static Web page.

[0055] In step S101, the page version identifier corresponding to the HTML content in the Web page gray release request is obtained, and the HTML content corresponding to the page version identifier and the gray release requirement data in the Web page gray release request are determined as the structured data corresponding to the Web page gray release request.

[0056] In step S102, the HTML file corresponding to the Web page is generated according to the structured data.

[0057] After obtaining the structured data corresponding to the Web page gray release request, the gray situation is determined according to the structured data, and then the HTML file corresponding to the Web page is generated. The gray scale in the structured data has a corresponding relationship with the HTML file generation method, and the HTML file generation method to be adopted can be determined according to the gray scale, and then the HTML file corresponding to the Web page is generated according to the determined HTML file generation method.

[0058] In step S103, the HTML file corresponding to the Web page is pushed to the static file server, and the HTML file is provided to the user terminal by the static file server.

[0059] The generated HTML file corresponding to the Web page is pushed to the static file server, and then the HTML file is provided to the user terminal by the static file server, so that the user terminal can perform gray calculation according to the HTML file to implement the gray strategy, determine and render the HTML content to be displayed, and complete the page display. The user terminal can include a page browsing device, a browser, an APP, and the like used by the user.

[0060] According to the gray processing method provided in the embodiment of the present application, the structured data corresponding to the Web page gray release request can be used to conveniently generate the HTML file corresponding to the Web page, and the generated HTML file is provided to the user end by the static file server. On the premise of not changing the existing static file server architecture, the gray release capability of the static Web page can be conveniently realized according to the generated HTML file. Compared with the existing gray processing method under the static file server, the implementation method is simple, no gray processing module needs to be added, the development cost of the gray release capability is effectively reduced, the influence on the static file server is effectively reduced, and the gray processing method under the static file server is optimized.

[0061] Figure 2a The flowchart of the gray processing method according to another embodiment of the present application is shown, as shown in Figure 2a The method comprises the following steps:

[0062] In step S201, in response to the Web page gray release request, the HTML content corresponding to the page version identifier in the Web page gray release request is searched from the build product pushed by the build system according to the page version identifier.

[0063] The code files and the like generated by the developer can be uniformly managed by the build system. The developer writes the HTML content and the like of the Web page, and then the code files and the like are provided to the build system by the code server and the like, and the build system is used to compile the code files and the like to form the build product. The build product can include the HTML content and the like of the Web page and the related data (such as the version identifier) of the code files. The build system pushes the build product to the gray processing system, the gray processing system receives the build product pushed by the build system, stores the HTML content and the related data in the database, and forms the corresponding version record. The gray processing system records each code change of each HTML content, so as to select a certain version to perform the gray release, and can control the gray proportion, the gray strategy, the white list and the like.

[0064] In the Web page development scenario, the developer often updates or modifies some content in the benchmark version of the static Web page according to the business demand, the abnormal error information and the like, forms the HTML content of the new version, and provides the HTML content to the build system for compilation. In the embodiment, the new version is referred to as a target version. The build system compiles the HTML content of the target version to form the build product and pushes the build product to the gray processing system.

[0065] When the developer wants to perform gray release on the target version, the developer can send a Web page gray release request to the gray processing system according to the gray release requirement of the target version, where the Web page gray release request can include a page version identifier, gray release requirement data, and the like. The page version identifier includes page version identifiers of Web pages of each version required during gray release, and specifically can include a baseline version identifier and a target version identifier. In response to the Web page gray release request, HTML content corresponding to the page version identifier is searched from the build product pushed by the build system according to the page version identifier in the Web page gray release request. Specifically, HTML content corresponding to the baseline version identifier and HTML content corresponding to the target version identifier are searched from the build product pushed by the build system.

[0066] In an optional embodiment, the developer can submit a Web page gray release request in the form of a release order. For example, the developer creates a release order for the target version, and the release order can be automatically associated with the baseline version currently online, so that the Web page gray release request can include the baseline version identifier and the target version identifier. The release order also records the gray release requirement data.

[0067] Step S202, HTML content corresponding to the page version identifier and the gray release requirement data in the Web page gray release request are determined as structured data corresponding to the Web page gray release request.

[0068] The gray release requirement data can include a gray release ratio, a gray release strategy, a whitelist, and the like, and a person skilled in the art can also set the gray release requirement data to include other data for reflecting the gray release requirement according to actual needs, which is not limited here. The structured data can include the gray release ratio, the gray release strategy, the whitelist, HTML content corresponding to the baseline version identifier, and HTML content corresponding to the target version identifier, and the like.

[0069] Step S203, the HTML file generation mode is determined according to the gray release ratio in the structured data.

[0070] In the embodiments of the present application, according to the gray release ratio, the HTML file generation mode can be mainly divided into three types, specifically: a baseline version HTML file generation mode, a combined version HTML file generation mode, and a target version HTML file generation mode.

[0071] If the gray scale ratio is the first ratio, the HTML file generation manner is determined as the benchmark version HTML file generation manner; if the gray scale ratio is greater than the first ratio and less than the second ratio, the HTML file generation manner is determined as the combined version HTML file generation manner; and if the gray scale ratio is equal to the second ratio, the HTML file generation manner is determined as the target version HTML file generation manner. The first ratio can be 0%, and the second ratio can be 100%. Assuming that the gray scale ratio in the current structured data is greater than 0% and less than 100%, for example, the gray scale ratio is 35%, which indicates that the target version needs to be opened to 35% of the user groups, and the benchmark version needs to be opened to 65% of the user groups. Therefore, the generated HTML file needs to contain both the HTML content corresponding to the benchmark version and the HTML content corresponding to the target version. In this case, the HTML file generation manner can be determined as the combined version HTML file generation manner.

[0072] In step S204, the HTML file corresponding to the Web page is generated according to the HTML file generation manner.

[0073] If the HTML file generation manner is the benchmark version HTML file generation manner, the HTML file corresponding to the Web page is generated according to the benchmark version identifier and the HTML content corresponding to the benchmark version identifier. If the HTML file generation manner is the combined version HTML file generation manner, the preset HTML tag content is generated by using the benchmark version identifier, the target version identifier, the gray scale strategy, the white list, and the gray scale calculation code. The HTML file corresponding to the Web page is generated according to the HTML content corresponding to the benchmark version identifier, the HTML content corresponding to the target version identifier, and the preset HTML tag content. If the HTML file generation manner is the target version HTML file generation manner, the HTML file corresponding to the Web page is generated according to the target version identifier and the HTML content corresponding to the target version identifier.

[0074] Specifically, when the gray scale ratio is 0%, it indicates that the target version is not opened to any user end, and the HTML file generation manner is the benchmark version HTML file generation manner. Therefore, the content of the HTML file corresponding to the Web page includes the benchmark version identifier and the HTML content corresponding to the benchmark version identifier. After the HTML file is provided to the user end, the user end directly runs the HTML content corresponding to the benchmark version identifier without any gray scale decision process according to the HTML file.

[0075] When the gray scale ratio is greater than 0% and less than 100%, it indicates that the target version needs to be opened to part of the user terminals, the HTML file is generated in the combined version HTML file generation manner, and the content of the HTML file corresponding to the generated Web page includes the HTML content corresponding to the benchmark version identifier, the HTML content corresponding to the target version identifier, and the preset HTML tag content generated by using the benchmark version identifier, the target version identifier, the gray scale strategy, the white list, and the gray scale calculation code. That is, the structured data and the gray scale calculation code are written into the HTML file. By making some changes to the HTML content, the gray release function is obtained by using the combined version HTML file generation manner, and the influence on the user experience is small.

[0076] The gray scale strategy includes a user bucketing strategy, and the user bucketing strategy records a division rule of dividing each user terminal into each bucket and a page version identifier corresponding to each bucket. The gray scale strategy can also be other strategies, which are not limited herein. The gray scale calculation code can be a JavaScript code, and the function of the gray scale calculation code is to read the structured data, calculate the page version identifier hit by the user terminal according to the data required by the gray scale strategy, such as a login user ID, a device ID, a browser cookie, and running environment information, according to the gray scale ratio. After the HTML file is provided to the user terminal, the user terminal runs the gray scale calculation code according to the HTML file to determine which version of the HTML content to use according to the gray scale strategy.

[0077] Specifically, the preset HTML tag content can be script tag content, which can be as shown in Figure 2b The versions field is used to store the HTML content corresponding to each version, the gray field is used to declare the gray scale strategy, and the user terminals are divided into 1000 buckets under the gray scale strategy. According to the number of the hit bucket, the hit version is found in the gray.list field, and finally the HTML content corresponding to the corresponding version is used to display the page content. The mid field is used to represent the login user ID, and the buvid field is used to represent the device ID. The whiteList field is used to declare the white list, and according to the mid field and the buvid field, it is limited which user terminals belong to the white list, the hit version is found in the gray.list field, and finally the HTML content corresponding to the corresponding version is used to display the page content. Figure 2b Only one limiting manner of the white list is shown, and a person skilled in the art can set the range of the mid field and the buvid field under the white list according to actual needs, which is not limited herein.

[0078] When the grayscale ratio is 100%, it means that the target version is open to all user terminals, and the HTML file is generated in the target version HTML file generation manner. The content of the generated HTML file corresponding to the Web page includes the target version identifier and the HTML content corresponding to the target version identifier. After the HTML file is provided to the user terminal, the user terminal will not have any gray decision process according to the HTML file, and directly run the HTML content corresponding to the target version identifier.

[0079] In step S205, the HTML file corresponding to the Web page is pushed to the static file server. The static file server provides the HTML file corresponding to the Web page to the user terminal in response to the Web page acquisition request sent by the user terminal.

[0080] The gray processing system pushes the generated HTML file corresponding to the Web page to the static file server. When the user terminal wants to display the Web page, it can send a Web page acquisition request to the static file server. The static file server provides the HTML file corresponding to the Web page to the user terminal in response to the Web page acquisition request. The user terminal can conveniently implement the gray strategy to perform gray calculation, determine the page version to be displayed, take the HTML content corresponding to the page version to be displayed as the HTML content to be displayed, render the HTML content to be displayed to the page, and complete the page display.

[0081] In step S206, the abnormal error information corresponding to the Web page is collected.

[0082] The monitoring SDK can also be set in the Web page. The monitoring SDK can read the page version identifier of the currently displayed HTML content when it is initialized, and report the abnormal error information corresponding to the Web page carrying the page version identifier to the gray processing system when the Web page runs abnormally. If the HTML file is generated in the benchmark version HTML file generation manner, the page version identifier carried in the abnormal error information is the benchmark version identifier. If the HTML file is generated in the combined version HTML file generation manner, the page version identifier carried in the abnormal error information is the page version identifier of the version determined for the user terminal according to the gray strategy, which is the benchmark version identifier or the target version identifier. If the HTML file is generated in the target version HTML file generation manner, the page version identifier carried in the abnormal error information is the target version identifier.

[0083] The gray processing system collects abnormal error information corresponding to the Web page. After the abnormal error information is processed by de-duplication, statistics and the like, the abnormal error information can be presented in real time on a front-end page, so that a developer can know problems existing in each version of the Web page, monitor version stability, and decide whether to continue to increase the gray ratio or rollback.

[0084] The following describes a gray processing method with respect to an HTML file corresponding to a Web page generated by using a combined version HTML file generation manner, taking a gray strategy including a user bucketing strategy as an example. Figure 3 A flowchart of a gray processing method corresponding to a gray strategy is shown in FIG. 3. The method includes the following steps. Figure 3

[0085] In step S301, a user identifier is obtained.

[0086] The user end receives an HTML file corresponding to a Web page, and obtains a user identifier when the Web page needs to be displayed, so as to implement a gray strategy according to the user identifier and determine which version of HTML content in the HTML file to use. The user identifier can include a login user ID, a device ID and the like.

[0087] In step S302, it is determined whether the user identifier is empty. If yes, step S306 is performed; if no, step S303 is performed.

[0088] If the user identifier is empty, for example, the user ID is empty, a baseline version can be used, and step S306 is performed. If the user identifier is not empty, it is further determined which whitelist or bucket the user identifier hits, so as to determine the version to be used, and step S303 is performed.

[0089] In step S303, it is determined whether the user identifier hits any whitelist. If yes, step S307 is performed; if no, step S304 is performed.

[0090] In step S304, the user identifier is subjected to hash processing, and a bucket corresponding to a hash processing result and a page version identifier corresponding to the bucket are determined.

[0091] Taking dividing a plurality of buckets as an example, a range of a hash processing result corresponding to each bucket and a page version identifier corresponding to each bucket are preset. When it is needed to determine which bucket a user identifier hits, the user identifier is subjected to hash processing to obtain a hash processing result. The hash processing result is matched with the range of the hash processing result corresponding to each bucket, a bucket corresponding to the hash processing result is determined, and a page version identifier corresponding to the bucket is determined according to a preset correspondence between the bucket and the page version identifier.

[0092] ​Step S305, the HTML content corresponding to the page version corresponding to the bucket is used as the HTML content to be presented.

[0093] After determining the page version corresponding to the bucket, the HTML content corresponding to the page version corresponding to the bucket is used as the HTML content to be presented.

[0094] Step S306, the HTML content corresponding to the reference version identifier is used as the HTML content to be presented.

[0095] In the case where the user identifier is empty, the HTML content corresponding to the reference version identifier is used as the HTML content to be presented.

[0096] Step S307, the HTML content corresponding to the version identifier corresponding to the hit whitelist is used as the HTML content to be presented.

[0097] In the case where the user identifier hits a certain whitelist in step S303, the HTML content corresponding to the version identifier corresponding to the hit whitelist is used as the HTML content to be presented.

[0098] Step S308, the HTML content to be presented is rendered to present the corresponding Web page.

[0099] According to the gray processing method provided in the embodiment of the present application, the gray scale, the gray strategy, the white list, and the HTML content corresponding to each page version identifier are taken as the structured data corresponding to the Web page gray publishing request, and different HTML file generation manners are used to generate the HTML file corresponding to the Web page according to different gray scales, and the generated HTML file is provided to the user end by the static file server; when the benchmark version HTML file generation manner or the target version HTML file generation manner is used to generate the HTML file, the HTML file can be conveniently generated according to the corresponding page version identifier and the HTML content corresponding to the page version identifier, the user end does not have any gray decision process according to the HTML file, directly runs the HTML content corresponding to the corresponding page version identifier, and completes page display; when the combined version HTML file generation manner is used to generate the HTML file, the structured data and the gray calculation code are written into the HTML file, the user end runs the gray calculation code according to the HTML file, determines which version of the HTML content in the HTML file to use according to the gray strategy, and completes page display; and when the Web page has a running exception, the monitoring SDK set in the page can be used to report the error information carrying the page version identifier in real time, so that the developer can know the problems existing in each version of the Web page and timely monitor the version stability; the scheme conveniently realizes the gray publishing capability of the static Web page without changing the existing static file server architecture, has the functions of adjusting the gray scale, setting the gray strategy, setting the white list, and rolling back, and effectively guarantees the controllability and online stability of the page publishing process.

[0100] Figure 4 A structural block diagram of a gray processing system according to one embodiment of the present application is shown, as shown in the figure, the system includes an acquisition module 410, a generation module 420, and a transmission module 430. Figure 4

[0101] The acquisition module 410 is adapted to acquire the structured data corresponding to the Web page gray publishing request.

[0102] The generation module 420 is adapted to generate the HTML file corresponding to the Web page according to the structured data.

[0103] The transmission module 430 is adapted to push the HTML file corresponding to the Web page to the static file server, and provide the HTML file to the user end by the static file server, so that the user end performs gray calculation according to the HTML file, determines and renders the HTML content to be displayed.

[0104] ​Optionally, the acquisition module 410 is further adapted to: in response to the web page gray release request, according to the page version identifier in the web page gray release request, searching the HTML content corresponding to the page version identifier from the build product pushed by the build system; determining the HTML content corresponding to the page version identifier and the gray release demand data in the web page gray release request as the structured data corresponding to the web page gray release request.

[0105] Optionally, the gray release demand data comprises a gray proportion, a gray strategy and a white list; and the page version identifier comprises a reference version identifier and a target version identifier.

[0106] Optionally, the generation module 420 is further adapted to: determining the HTML file generation mode according to the gray proportion in the structured data; and generating the HTML file corresponding to the web page according to the HTML file generation mode.

[0107] Optionally, the generation module 420 is further adapted to: if the gray proportion is a first proportion, determining the HTML file generation mode as a reference version HTML file generation mode; if the gray proportion is greater than the first proportion and less than a second proportion, determining the HTML file generation mode as a combination version HTML file generation mode; and if the gray proportion is equal to the second proportion, determining the HTML file generation mode as a target version HTML file generation mode.

[0108] Optionally, the generation module 420 is further adapted to: if the HTML file generation mode is the reference version HTML file generation mode, generating the HTML file corresponding to the web page according to the reference version identifier and the HTML content corresponding to the reference version identifier; if the HTML file generation mode is the combination version HTML file generation mode, generating preset HTML tag content by using the reference version identifier, the target version identifier, the gray strategy, the white list and a gray calculation code; and generating the HTML file corresponding to the web page according to the HTML content corresponding to the reference version identifier, the HTML content corresponding to the target version identifier and the preset HTML tag content; and if the HTML file generation mode is the target version HTML file generation mode, generating the HTML file corresponding to the web page according to the target version identifier and the HTML content corresponding to the target version identifier.

[0109] Optionally, the gray strategy comprises a user bucketing strategy, and the user bucketing strategy records a division rule of dividing each user terminal into each bucket and a page version identifier corresponding to each bucket.

[0110] Optionally, the transmission module 430 is further adapted to: providing the HTML file corresponding to the web page to the user terminal by the static file server in response to the web page acquisition request sent by the user terminal.

[0111] Optionally, the system is further adapted to collect abnormal error information corresponding to the Web page, wherein the abnormal error information comprises a page version identifier of the page content to be displayed.

[0112] The above modules are described with reference to the corresponding description in the method embodiments, and will not be described here again.

[0113] According to the gray processing system provided in the embodiments of the present application, the gray scale, the gray strategy, the white list, and the HTML content corresponding to each page version identifier are taken as the structured data corresponding to the Web page gray release request, and different HTML file generation manners are used to generate the HTML file corresponding to the Web page according to the different gray scales, and the generated HTML file is provided to the user end by the static file server; when the HTML file is generated by using the benchmark version HTML file generation manner or the target version HTML file generation manner, the HTML file can be conveniently generated according to the corresponding page version identifier and the HTML content corresponding to the page version identifier, the user end does not have any gray decision process according to the HTML file, directly runs the HTML content corresponding to the page version identifier, and completes the page display; when the HTML file is generated by using the combined version HTML file generation manner, the structured data and the gray calculation code are written into the HTML file, the user end runs the gray calculation code according to the HTML file, determines which version of the HTML content in the HTML file to use according to the gray strategy, and completes the page display; and when the Web page has a running exception, the abnormal error information carrying the page version identifier can be reported in real time by the monitoring SDK set in the page, so that the developer knows the problems existing in each version of the Web page, and the version stability is monitored in time; the scheme conveniently realizes the gray release capability of the static Web page without changing the existing static file server architecture, has the functions of adjusting the gray scale, setting the gray strategy, setting the white list, and rolling back, and effectively guarantees the controllability and online stability of the page release process.

[0114] The embodiments of the present application further provide a nonvolatile computer storage medium, and the computer storage medium stores at least one executable instruction, and the executable instruction can execute the gray processing method in any method embodiment.

[0115] Figure 5 A structural schematic diagram of a computing device according to an embodiment of the present application is shown, and the specific embodiments of the present application do not limit the specific implementation of the computing device.

[0116] As Figure 5As shown, the computing device can include a processor 502, a communications interface 504, a memory 506, and a communications bus 508.

[0117] wherein:

[0118] The processor 502, the communications interface 504, and the memory 506 communicate with each other through the communications bus 508.

[0119] The communications interface 504 is configured to communicate with network elements such as clients or other servers.

[0120] The processor 502 is configured to execute the program 510, and in particular, execute the steps in the above-mentioned grayscale processing method embodiments.

[0121] In particular, the program 510 can include program code including computer operation instructions.

[0122] The processor 502 can be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the computing device can be the same type of processor, such as one or more CPUs; or can be different types of processors, such as one or more CPUs and one or more ASICs.

[0123] The memory 506 is configured to store the program 510. The memory 506 can include a high-speed RAM memory, and can also include a non-volatile memory such as at least one disk memory.

[0124] The program 510 can be specifically configured to cause the processor 502 to execute the grayscale processing method in any of the above-mentioned method embodiments. The specific implementation of each step in the program 510 can refer to the corresponding description in the above-mentioned grayscale processing embodiments, and will not be described here. Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-mentioned devices and modules can refer to the corresponding process description in the above-mentioned method embodiments, and will not be described here.

[0125] The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems can be used with programs in accordance with the teachings herein, or it can prove convenient to construct more specialized apparatus to perform the required method steps. The required structure for a variety of these systems will be apparent from the description above. In addition, the present embodiments are not described with reference to any particular programming language. It will be appreciated that a variety of programming languages can be used to implement the teachings of the present embodiments as described herein, and any references below to specific languages are provided for disclosure of enablement only.

[0126] In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the application can be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been described in detail in order to avoid obscuring the understanding of this description.

[0127] Similarly, it is to be understood that the mechanical details of the application can be put into practice in various ways without necessarily deviating from the principles of the application. In the description of the example embodiments of the application above, the various features of the application are sometimes grouped together in a single embodiment, figure or description of a related aspect. This is done for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the aspects of the application. However, it should be understood that the described principles of the application can be used in any combination of one or more of the described features. The disclosure of the application is not to be limited to the features described herein, but can be employed in any of the described features, and in other applications now known or later developed.

[0128] Those skilled in the art will appreciate that the modules in the apparatuses of the embodiments can be adapted and placed in one or more apparatuses other than the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and further can be divided into more sub-modules or sub-units or sub-components. Any combination of all the features disclosed in the specification (including the accompanying claims, abstract and drawings), and any method or of the apparatuses disclosed can be taken, except that at least some of such features and / or processes or units are mutually exclusive. Unless explicitly stated, each feature disclosed in the specification (including the accompanying claims, abstract and drawings) can be replaced by alternative features that serve the same, equivalent or similar purpose.

[0129] Furthermore, those skilled in the art will recognize that, while certain embodiments described herein include certain features that are not included in other embodiments, combinations of those features from different embodiments are meant to be within the scope of the application, and form different embodiments, for example, in the following claims. For example, in the following claims, any of the claimed embodiments can be used in any combination.

[0130] The various component embodiments of the present application can be implemented in hardware, or as software modules running in one or more processors, or in combinations thereof. Those skilled in the art will appreciate that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all of the functionality according to some or all of the components of the present application. The present application can also be implemented as a program of instructions for performing part or all of the methods described herein, e.g., a computer program and a computer program product. Such program implementing the present application can be stored on a computer readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, or provided on a carrier signal, or in any other form.

[0131] It is to be noted that the above-mentioned embodiments illustrate rather than limit the application, and that one skilled in the art will be able to design many alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word 'comprising' does not exclude the presence of elements or steps other than those listed in a claim. The word 'a' or 'an' preceding an element does not exclude the presence of a plurality of such elements. The application can be implemented by means of both hardware and software, and any combination thereof. In a unit claim, several devices can be listed with a conjunction like 'or', but it is to be understood that a combination of these devices can be used in the application. The use of the word 'at least' followed by a list of one or more members does not exclude additional members of the same class or logical type.

Claims

1. A gray processing method, comprising: obtaining structured data corresponding to a gray release request of a web page; determining an HTML file generation mode according to a gray ratio in the structured data, and generating an HTML file corresponding to the web page according to the HTML file generation mode; pushing the HTML file corresponding to the web page to a static file server, and providing the HTML file to a user terminal by the static file server, so that the user terminal performs gray calculation according to the HTML file, and determines and renders HTML content to be displayed; wherein the determining the HTML file generation mode according to the gray ratio in the structured data further comprises: if the gray ratio is a first ratio, determining that the HTML file generation mode is a base version HTML file generation mode; if the gray ratio is greater than the first ratio and less than a second ratio, determining that the HTML file generation mode is a combination version HTML file generation mode; if the gray ratio is equal to the second ratio, determining that the HTML file generation mode is a target version HTML file generation mode. 2.The method of claim 1, wherein the obtaining the structured data corresponding to the gray release request of the web page further comprises: in response to the gray release request of the web page, searching for HTML content corresponding to a page version identifier in a build product pushed by a build system according to the page version identifier in the gray release request of the web page; determining the HTML content corresponding to the page version identifier and gray release requirement data in the gray release request of the web page as the structured data corresponding to the gray release request of the web page.

3. The method of claim 2, the grayscale release requirement data comprising: a gray ratio, a gray strategy, and a white list; the page version identifier comprises a base version identifier and a target version identifier. 4.The method of claim 1, wherein the generating the HTML file corresponding to the web page according to the HTML file generation mode further comprises: if the HTML file generation mode is the base version HTML file generation mode, generating the HTML file corresponding to the web page according to the base version identifier and the HTML content corresponding to the base version identifier; if the HTML file generation mode is the combination version HTML file generation mode, generating preset HTML tag content by using the base version identifier, the target version identifier, the gray strategy, the white list, and gray calculation code, and generating the HTML file corresponding to the web page according to the HTML content corresponding to the base version identifier, the HTML content corresponding to the target version identifier, and the preset HTML tag content; if the HTML file generation mode is the target version HTML file generation mode, generating the HTML file corresponding to the web page according to the target version identifier and the HTML content corresponding to the target version identifier.

5. The method of claim 4, wherein the gray scale strategy comprises a user bucketing strategy, and the user bucketing strategy records a division rule for dividing each user terminal into each bucket and a page version identifier corresponding to each bucket.

6. The method of any one of claims 1-5, further comprising: collecting abnormal error information corresponding to the Web page, wherein the abnormal error information comprises a page version identifier of the page content to be displayed.

7. A gray scale processing system, comprising: an acquisition module adapted to acquire structured data corresponding to a Web page gray scale publishing request; a generation module adapted to determine an HTML file generation manner according to a gray scale ratio in the structured data, and generate an HTML file corresponding to the Web page according to the HTML file generation manner; a transmission module adapted to push the HTML file corresponding to the Web page to a static file server, and provide the HTML file to a user terminal by the static file server, so that the user terminal performs gray scale calculation according to the HTML file, determines and renders HTML content to be displayed; wherein the generation module is further adapted to: if the gray scale ratio is a first ratio, determine that the HTML file generation manner is a base version HTML file generation manner; if the gray scale ratio is greater than the first ratio and less than a second ratio, determine that the HTML file generation manner is a combined version HTML file generation manner; if the gray scale ratio is equal to the second ratio, determine that the HTML file generation manner is a target version HTML file generation manner.

8. A computing device comprising: a processor, a memory, a communication interface, and a communication bus, the processor, the memory, and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction causes the processor to perform operations corresponding to the gray scale processing method of any one of claims 1-6.

9. A computer storage medium, the storage medium stores at least one executable instruction, and the executable instruction causes a processor to perform operations corresponding to the gray scale processing method of any one of claims 1-6.

10. A computer program product, comprising at least one executable instruction, and the executable instruction causes a processor to perform operations corresponding to the gray scale processing method of any one of claims 1-6.

Citation Information

Patent Citations

  • Gray release method and device, computer equipment and storage medium

    CN116776030A