A gray release method and device, computer equipment and storage medium
By dynamically modifying the grayscale markers using interceptors, the high cost and complex management issues of existing grayscale deployment methods are resolved, enabling low-cost and low-risk grayscale deployments that are suitable for a wide range of projects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2026-03-27
AI Technical Summary
Existing canary release methods are costly and complex to manage for small and medium-sized enterprises. Using domain names and URL paths for canary releases results in high investment costs, significant risks of code modification, and poor user experience.
By dynamically modifying the grayscale markers using interceptors, grayscale deployment can be implemented with a single line of code, avoiding the cost of purchasing domain names, simplifying the configuration process, and reducing access costs.
It enables low-cost, low-risk canary releases, suitable for a wide range of projects, without affecting existing structures and packaging configurations.
Smart Images

Figure CN116720013B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a gray release method and device, computer equipment and storage medium. BACKGROUND
[0002] Gray release, also known as canary release, is a software release strategy that gradually introduces new versions of software or services into production environments to reduce release risks and improve release quality. Gray release is a release method that tests and verifies new versions of software or services in a small number of users first, then gradually expands them to more users, and eventually covers the entire user group. This approach allows new versions of software or services to be continuously improved through gradual verification and testing, while reducing the impact and risk on production environments, ensuring the stability and reliability of new versions.
[0003] The existing gray release method, one method is to use different domain names for gray release. However, due to the high cost of purchasing and maintaining domain names, small and medium-sized enterprises increase investment costs, and if multiple domain names are used, the difficulty of domain name management increases, for example, when multiple domain names need to be maintained, filed, updated, etc. When this happens, you need to invest in appropriate technical support and manpower. Another method is to use URL (Uniform Resource Locator) path gray. Since URL path gray requires adding corresponding path configurations and controls in the code, it requires modifying multiple components and modules of the system, increasing the cost and risk of code modification. And since URL path gray needs to direct some users to new versions of resources based on their specific identifiers or configurations, it requires user participation and cooperation, which reduces user experience and effectiveness. SUMMARY
[0004] The purpose of the present application is to provide a gray release method, device, computer equipment and storage medium, which can dynamically modify the gray label, implement the process of gray release, avoid the cost of purchasing domain names, and only use one line of code to modify the gray label function, without affecting the existing structure and packaging configuration of the project. At the same time, the access cost is very low, and the application range is wide.
[0005] According to one aspect of the present application, the present application provides a gray release method, comprising:
[0006] Receiving an operation instruction to access a web page, using an interceptor to intercept resources corresponding to the operation instruction;
[0007] According to the resource, determine whether the gray label of the resource needs to be modified; wherein the gray label includes a request header and a request body;
[0008] if no modification is needed, obtaining a gray scale mark of the resource;
[0009] if modification is needed, adjusting the original request header of the resource to obtain a new request header, and merging the new request header with the request body to obtain the gray scale mark of the resource;
[0010] obtaining data corresponding to the gray scale mark from a server according to the gray scale mark.
[0011] Optionally, the receiving of the operation instruction for accessing the webpage and intercepting the resource corresponding to the operation instruction by the interceptor include:
[0012] receiving the operation instruction for accessing the webpage;
[0013] loading the resource corresponding to the operation instruction according to the operation instruction, and determining whether the interception configuration is updated;
[0014] if the interception configuration is updated, automatically refreshing the webpage, and intercepting all the resources by the interceptor;
[0015] if the interception configuration is not updated, not refreshing the webpage, and intercepting all the resources by the interceptor.
[0016] Optionally, the loading of the resource corresponding to the operation instruction and the determination of whether the interception configuration is updated include:
[0017] automatically adding a gray scale mark value to the resource by a script, and determining whether the gray scale mark value is updated.
[0018] Optionally, the receiving of the operation instruction for accessing the webpage and intercepting the resource corresponding to the operation instruction further include:
[0019] receiving the operation instruction for accessing the webpage;
[0020] loading the resource corresponding to the operation instruction according to the operation instruction, and determining whether the interceptor is loaded for the first time;
[0021] if the interceptor is loaded for the first time, loading the interceptor, and after the loading is completed, automatically refreshing the webpage, and intercepting all the resources by the interceptor;
[0022] if the interceptor is not loaded for the first time, intercepting all the resources by the interceptor.
[0023] Optionally, the determining of whether the gray scale mark of the resource needs to be modified according to the resource include:
[0024] According to the resource and preset configuration parameters, it is determined whether the gray scale mark of the resource needs to be modified, wherein the configuration parameters contain address information of the resource.
[0025] Optionally, the adjusting the original request header of the resource to obtain a new request header, and merging the new request header with the request body to obtain the gray scale mark of the resource comprises:
[0026] Obtaining the original request header and the request body of the resource;
[0027] Adding a preset request header parameter into the request header to obtain a new request header;
[0028] Merging the new request header with the original request body to obtain the gray scale mark of the resource.
[0029] Optionally, the obtaining data corresponding to the gray scale mark from a server according to the gray scale mark comprises:
[0030] According to the gray scale mark, a request for obtaining data is initiated to a corresponding server, and the data returned by the server according to the request is received.
[0031] The application further provides a gray scale publishing device, comprising:
[0032] A resource obtaining module is configured to receive an operation instruction for accessing a webpage, and intercept a resource corresponding to the operation instruction by using an interceptor;
[0033] A judging module is configured to determine whether a gray scale mark of the resource needs to be modified according to the resource, wherein the gray scale mark contains a request header and a request body;
[0034] An obtaining module is configured to obtain the gray scale mark of the resource if the modification is not needed;
[0035] A modifying module is configured to adjust the original request header of the resource to obtain a new request header, and merge the new request header with the request body to obtain the gray scale mark of the resource if the modification is needed;
[0036] A data obtaining module is configured to obtain data corresponding to the gray scale mark from a server according to the gray scale mark.
[0037] The application further provides a computer device, comprising:
[0038] A memory is configured to store a computer program;
[0039] A processor is configured to execute the computer program to realize the gray scale publishing method.
[0040] The application further provides a computer readable storage medium, wherein computer executable instructions are stored in the computer readable storage medium, and when the computer executable instructions are loaded and executed by a processor, the steps of the gray release method described above are implemented.
[0041] It can be seen that the application can dynamically modify the gray label, implement the process of gray release, avoid the cost of purchasing a domain name, and realize the function of modifying the gray label with only one line of code, without affecting the existing structure and packaging configuration of the project, while the access cost is extremely low and the application range is wide. The application also provides a gray release device, a computer device, and a storage medium, which have the above beneficial effects. BRIEF DESCRIPTION OF DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are only a part of the present application, and for those skilled in the art, other drawings can be obtained without creative labor based on the provided drawings.
[0043] Figure 1 A flow chart of a gray release method provided by the embodiment of the present application;
[0044] Figure 2 A flow chart of a gray release method provided by the embodiment of the present application;
[0045] Figure 3 A structure block diagram of a gray release device provided by the embodiment of the present application;
[0046] Figure 4 A structure block diagram of a computer device provided by the embodiment of the present application. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the present application.
[0048] Gray release, also known as canary release, is a software release strategy that gradually introduces new versions of software or services into production environment to reduce release risk and improve release quality. Gray release is a release method that tests and verifies new versions of software or services in a small number of users first, and then gradually expands them to more users, eventually covering the entire user group. This way, new versions of software or services can be continuously improved through gradual verification and testing, while reducing the impact and risk on the production environment, ensuring the stability and reliability of new versions.
[0049] Currently, the existing gray release method is to use different domain names for gray release. However, due to the high cost of purchasing and maintaining domain names, small and medium-sized enterprises increase investment costs, and if multiple domain names are used, the difficulty of domain name management increases, such as when multiple domain names need to be maintained, registered, updated, etc. When this happens, technical support and manpower need to be invested. Another method is to use URL (Uniform Resource Locator) path gray. Since URL path gray requires adding corresponding path configuration and control in the code, it needs to modify multiple components and modules of the system, increasing the cost and risk of code modification. In addition, since URL path gray needs to direct some users to new versions of resources based on specific user identification or configuration, it requires user participation and cooperation, which reduces user experience and use effect.
[0050] Therefore, the present application provides a gray release method that can dynamically modify the gray mark, implement the gray release process, avoid the cost of purchasing domain names, and modify the gray mark with only one line of code, without affecting the existing structure and packaging configuration of the project, while having extremely low access cost and wide application range.
[0051] The following will be described in detail, please refer to Figure 1 , Figure 1 The flowchart of the gray release method provided by the embodiment of the present application can include:
[0052] Step S101: receiving an operation instruction to access a webpage, and intercepting resources corresponding to the operation instruction by using an interceptor.
[0053] The form of the operation instruction in the embodiment of the present application is not limited, which can be a small piece of data code, a specific high or low level, or an identifier, etc. The required form can be determined according to the actual situation. In the embodiment of the present application, the instruction content of the operation instruction is not limited, which can be a login instruction for user login to the webpage, or an execution instruction for executing specific operations after clicking the content in the webpage.
[0054] In the embodiment of the present application, the operation instruction for accessing the webpage can be received, and the interceptor is used to intercept the resource corresponding to the operation instruction. The interceptor is a technology for intercepting the request or response in the data request process, and the operation instruction and the resource correspond to each other. It should be noted that in the embodiment of the present application, whether the interceptor is used to intercept the resource corresponding to the operation instruction can be determined according to the preset judgment condition. The preset judgment condition is not limited, and the following conditions can be used. For example, when the operation instruction for accessing the webpage is received, the resource corresponding to the operation instruction is loaded according to the operation instruction, and it is determined whether the interception configuration is updated. If the interception configuration is updated, the webpage is automatically refreshed, and all resources are intercepted by using the interceptor. If the interception configuration is not updated, the webpage is not refreshed, and all resources are intercepted by using the interceptor. Alternatively, when the operation instruction for accessing the webpage is received, the resource corresponding to the operation instruction is loaded according to the operation instruction, and it is determined whether the interceptor is loaded for the first time. If the interceptor is loaded for the first time, the interceptor is loaded. After the loading is completed, the webpage is automatically refreshed, and all resources are intercepted by using the interceptor. If the interceptor is not loaded for the first time, all resources are intercepted by using the interceptor. The interception configuration is configuration information containing a parameter such as a gray mark value. It should be noted that the method for determining whether the interception configuration is updated is not limited. For example, the gray mark value can be automatically added to the resource by using a script, and then it is determined whether the gray mark value is updated. If the gray mark value is updated, the webpage is automatically refreshed, and all resources are intercepted by using the interceptor. If the interception configuration is not updated, the webpage is not refreshed, and all resources are intercepted by using the interceptor. For example, after the user logs in successfully, the gray mark value is set as the user id (number). When it is detected that the gray mark value is updated, the webpage is automatically refreshed, and all resources are intercepted by using the interceptor. Alternatively, the request header corresponding to the operation instruction can be automatically added by using a script, and then it is determined whether the request header is updated. If the request header is updated, the webpage is automatically refreshed, and all resources are intercepted by using the interceptor. If the request header is not updated, the webpage is not refreshed, and all resources are intercepted by using the interceptor.
[0055] Step S102: According to the resource, it is determined whether the gray mark of the resource needs to be modified. The gray mark includes the request header and the request body. If the modification is not needed, steps S103 and S105 are executed. If the modification is needed, steps S104 and S105 are executed.
[0056] In this embodiment of the invention, the grayscale marker is a request corresponding to a resource, including a request header and a request body. In this embodiment, it can be determined whether the grayscale marker of a resource needs to be modified based on the resource. This can be done by determining whether the grayscale marker needs modification based on the resource and preset configuration parameters. Essentially, it's about judging the parameters and other information of the acquired resource based on the configuration parameters to determine whether the grayscale marker needs modification. The configuration parameters include the resource's address information and identifier, etc. When a resource is acquired, it can be determined whether the grayscale marker needs modification based on the resource's address information or its identifier. It should be noted that there are no restrictions on the setting of the configuration parameters; they can be set by designers according to requirements or based on actual usage.
[0057] Step S103: Obtain the grayscale marker of the resource.
[0058] Step S104: Adjust the original request header of the resource to obtain a new request header, and merge the new request header with the request body to obtain the grayscale mark of the resource.
[0059] In this embodiment of the invention, the original request header of the resource can be adjusted to obtain a new request header, and then merged with the request body to obtain the grayscale marker of the resource. There are no restrictions on the method of adjusting the request header; it can be to first obtain the original request header and request body of the resource, then add preset request header parameters to the request header to obtain a new request header, and finally merge the new request header with the original request body to obtain the grayscale marker of the resource. The setting of the request header parameters is not limited; they can be set by the designer according to requirements or according to actual usage.
[0060] It should be noted that, in practical applications, the embodiments of the present invention can adjust the original request header of the resource with only one line of code to obtain a new request header, and merge the new request header with the request body to obtain the grayscale mark of the resource. Grayscale release is achieved without affecting the existing structure and packaging configuration of the project, and the access cost is extremely low. It is suitable for existing projects. 1. It can dynamically modify the grayscale mark. If the grayscale mark needs to be changed, the current method needs to repackage and release.
[0061] Step S105: Obtain the data corresponding to the grayscale marker from the server based on the grayscale marker.
[0062] In the embodiment of the present application, the data corresponding to the gray scale mark can be obtained from the server according to the gray scale mark. The data can be requested from the corresponding server according to the gray scale mark, and the data returned by the server according to the request can be received. It should be noted that the server in the embodiment of the present application can determine the data to be returned according to the gray scale mark, and send the data to the client.
[0063] Based on the above embodiment, the embodiment of the present application provides a gray release method, which can dynamically modify the gray scale mark, realize the process of gray release, avoid the cost of purchasing domain name, and realize the function of modifying the gray scale mark with only one line of code, without affecting the existing structure and packaging configuration of the project, while the access cost is extremely low and the application range is wide.
[0064] The above process will be described below through specific examples. Please refer to Figure 2 , Figure 2 A flowchart of a gray release method provided by the embodiment of the present application is shown in the example, which is applied to a client, specifically, accessing a gray environment in a HER (electronic human resource management) system. The process is as follows:
[0065] Step S201: A user accesses a webpage, and a browser in the webpage receives an operation instruction of accessing the webpage.
[0066] Step S202: According to the operation instruction, the browser loads corresponding resources, and automatically adds a gray scale mark value to the resources by using a script.
[0067] Step S203: It is determined whether the interception configuration is updated, or whether the interceptor is loaded for the first time.
[0068] Step S204: If there is an update, or if it is loaded for the first time, the interceptor is loaded. After the loading is completed, or after the update, the webpage is automatically refreshed, and all resources are intercepted by using the interceptor.
[0069] Step S205: If there is no update, or if it is not loaded for the first time, all resources are intercepted by using the interceptor.
[0070] Step S206: According to the resources, it is determined whether the gray scale mark of the resources needs to be modified. If the modification is not needed, steps S210 and S211 are executed, and if the modification is needed, steps S207, S208, S209 and S211 are executed.
[0071] Step S207: The original request header and request body of the resources are obtained.
[0072] Step S208: A preset request header parameter is added to the request header to obtain a new request header.
[0073] Step S209: merging the new request header with the original request body to obtain the gray marking of the resource.
[0074] Step S210: obtaining the gray marking of the resource.
[0075] Step S211: obtaining data corresponding to the gray marking from the server according to the gray marking.
[0076] The embodiment of the application provides a gray release method, which can dynamically modify the gray marking, realizes the process of gray release, avoids the cost of purchasing a domain name, and realizes the function of modifying the gray marking by using only one line of code, does not affect the existing structure and packaging configuration of a project, and has low access cost and wide application range.
[0077] The following describes a gray release device and a computer device provided by the embodiment of the application, and the gray release device and the computer device described below can be correspondingly referred to the gray release method described above.
[0078] Please refer to Figure 3 , Figure 3 The structure block diagram of the gray release device provided by the embodiment of the application, which can include:
[0079] The resource obtaining module 11 is configured to receive an operation instruction for accessing a webpage, and intercept a resource corresponding to the operation instruction by using an interceptor.
[0080] The judgment module 12 is configured to determine whether the gray marking of the resource needs to be modified according to the resource, wherein the gray marking includes a request header and a request body.
[0081] The obtaining module 13 is configured to obtain the gray marking of the resource if the gray marking does not need to be modified.
[0082] The modification module 14 is configured to adjust the original request header of the resource to obtain a new request header, and merge the new request header with the request body to obtain the gray marking of the resource if the gray marking needs to be modified.
[0083] The data obtaining module 15 is configured to obtain data corresponding to the gray marking from a server according to the gray marking.
[0084] Based on the above embodiment, the resource obtaining module 11 can include:
[0085] The receiving unit is configured to receive the operation instruction for accessing the webpage.
[0086] The judgment unit is configured to load the resource corresponding to the operation instruction according to the operation instruction, and determine whether the interception configuration is updated.
[0087] The script can be used to automatically add a gray scale mark value to the resource in the embodiment of the present application, and determine whether the gray scale mark value is updated.
[0088] The interception unit is configured to automatically refresh the webpage and intercept all the resources by using the interceptor if the interception configuration is updated, and not to refresh the webpage and intercept all the resources by using the interceptor if the interception configuration is not updated.
[0089] According to any of the above embodiments, the resource acquisition module 11 can further include:
[0090] The interceptor judgment unit is configured to load the resource corresponding to the operation instruction according to the operation instruction, and determine whether the interceptor is loaded for the first time.
[0091] The acquisition unit is configured to load the interceptor if the interceptor is loaded for the first time, automatically refresh the webpage and intercept all the resources by using the interceptor after the loading is completed, and intercept all the resources by using the interceptor if the interceptor is not loaded for the first time.
[0092] According to any of the above embodiments, the judgment module 12 can include:
[0093] The judgment unit is configured to determine whether the gray scale mark of the resource needs to be modified according to the resource and a preset configuration parameter, wherein the configuration parameter contains address information of the resource.
[0094] According to any of the above embodiments, the modification module 14 can include:
[0095] The request acquisition unit is configured to acquire the original request header and request body of the resource.
[0096] The modification unit is configured to add a preset request header parameter to the request header to obtain a new request header.
[0097] The merging unit is configured to merge the new request header and the original request body to obtain the gray scale mark of the resource.
[0098] According to any of the above embodiments, the data acquisition module 15 can include:
[0099] The data receiving unit is configured to initiate a request for acquiring data to a corresponding server according to the gray scale mark, and receive the data returned by the server according to the request.
[0100] The embodiment of the application can dynamically modify the gray scale mark, realize the process of gray scale publishing, avoid the cost of purchasing a domain name, and realize the function of modifying the gray scale mark with only one line of code, without affecting the existing structure and packaging configuration of the project, while the access cost is extremely low and the application range is wide.
[0101] Please refer to Figure 4 , Figure 4 The structural block diagram of the computer device provided by the embodiment of the application comprises:
[0102] The memory 10 is used for storing a computer program.
[0103] The processor 20 is used for executing the computer program to realize the gray scale publishing method.
[0104] As shown in Figure 4 , the structural schematic diagram of the computer device can comprise a memory 10, a processor 20, a communication interface 31, an input / output interface 32 and a communication bus 33.
[0105] In the embodiment of the application, the memory 10 is used for storing one or more programs, and the program can comprise program code including computer operation instructions. In the embodiment of the application, the memory 10 can store programs for realizing the following functions:
[0106] After receiving the operation instruction of accessing the webpage, the interceptor is used to intercept the resource corresponding to the operation instruction;
[0107] According to the resource, it is determined whether the gray scale mark of the resource needs to be modified; wherein the gray scale mark comprises a request header and a request body;
[0108] If the modification is not needed, the gray scale mark of the resource is obtained;
[0109] If the modification is needed, the original request header of the resource is adjusted to obtain a new request header, and the new request header and the request body are combined to obtain the gray scale mark of the resource;
[0110] According to the gray scale mark, data corresponding to the gray scale mark is obtained from the server.
[0111] In a possible implementation manner, the memory 10 can comprise a program storage area and a data storage area, wherein the program storage area can store an operating system and at least one application program required by a function; and the data storage area can store data created in the use process.
[0112] In addition, the memory 10 can include read-only memory and random access memory, and provide instructions and data to the processor. A portion of the memory can also include a NVRAM. The memory stores operating systems and operating instructions, executable modules or data structures, or subsets thereof, or expanded sets thereof, wherein the operating instructions can include various operating instructions for implementing various operations. The operating system can include various system programs for implementing various basic tasks and processing hardware-based tasks.
[0113] The processor 20 can be a central processing unit (CPU), an application specific integrated circuit, a digital signal processor, a field programmable gate array, or other programmable logic device, which can be a microprocessor or any conventional processor, etc. The processor 20 can invoke programs stored in the memory 10.
[0114] The communication interface 31 can be an interface for connecting with other devices or systems.
[0115] The input / output interface 32 can be an interface for obtaining external input data or outputting data to the outside.
[0116] Of course, it should be noted that, Figure 4 The structure shown does not constitute a limitation on the computer device in the embodiments of the present application, and in actual applications, the computer device can include more or fewer components than those shown, or combine certain components. Figure 4 The structure shown does not constitute a limitation on the computer device in the embodiments of the present application, and in actual applications, the computer device can include more or fewer components than those shown, or combine certain components.
[0117] In the embodiments of the present application, the gray scale label can be dynamically modified to realize the process of gray scale publishing, avoid the cost of purchasing domain names, and realize the function of modifying the gray scale label with only one line of code, without affecting the existing structure and packaging configuration of the project, while the access cost is extremely low and the application range is wide.
[0118] The embodiment of the present application also provides a computer readable storage medium, the computer readable storage medium stores computer executable instructions, when the computer executable instructions are loaded and executed by a processor, receiving an operation instruction of accessing a webpage, intercepting a resource corresponding to the operation instruction by using an interceptor; determining whether a gray label of the resource needs to be modified according to the resource; wherein the gray label comprises a request header and a request body; if the gray label does not need to be modified, obtaining the gray label of the resource; if the gray label needs to be modified, adjusting an original request header of the resource to obtain a new request header, and combining the new request header and the request body to obtain the gray label of the resource; and obtaining data corresponding to the gray label from a server according to the gray label. In the embodiment of the present application, the gray label can be dynamically modified, the process of gray publishing is realized, the cost of purchasing a domain name is avoided, the function of modifying the gray label can be realized by using only one line of code, the existing structure and packaging configuration of a project are not affected, the access cost is very low, and the application range is wide.
[0119] The embodiments in the description are described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same or similar parts of each embodiment can be referred to each other. For the device disclosed by the embodiments, since it corresponds to the method disclosed by the embodiments, the description is relatively simple, and the related parts can be referred to the method part.
[0120] The skilled person can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized by electronic hardware, computer software or a combination of the two. In order to clearly show the interchangeability of hardware and software, the components and steps of each example have been described in the above description. Whether the functions are realized by hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0121] The steps of the method or algorithm described in combination with the embodiments disclosed herein can be directly implemented by hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0122] The above describes in detail the gray scale publishing method, device, computer device and storage medium provided by the present application. The principles and implementation manners of the present application are described by applying specific examples. The above description of the embodiments is only used to help understand the method of the present application and its core idea. It should be pointed out that, for those skilled in the art, without departing from the principles of the present application, the present application can be improved and modified in several ways, and these improvements and modifications also fall within the protection scope of the claims of the present application.
Claims
1. A method of gray release, characterized by, The method comprises the following steps: receiving an operation instruction for accessing a webpage, and intercepting resources corresponding to the operation instruction by using an interceptor; determining whether the gray label of the resources needs to be modified according to the resources; wherein the gray label comprises a request header and a request body; if the gray label does not need to be modified, obtaining the gray label of the resources; if the gray label needs to be modified, adjusting the original request header of the resources to obtain a new request header, and merging the new request header and the request body to obtain the gray label of the resources; obtaining data corresponding to the gray label from a server according to the gray label; wherein the receiving of the operation instruction for accessing the webpage and the intercepting of the resources corresponding to the operation instruction by using the interceptor comprise: receiving the operation instruction for accessing the webpage; loading the resources corresponding to the operation instruction according to the operation instruction, and determining whether the interception configuration is updated; if the interception configuration is updated, automatically refreshing the webpage and intercepting all the resources by using the interceptor; if the interception configuration is not updated, not refreshing the webpage and intercepting all the resources by using the interceptor; wherein the receiving of the operation instruction for accessing the webpage and the intercepting of the resources corresponding to the operation instruction by using the interceptor further comprise: receiving the operation instruction for accessing the webpage; loading the resources corresponding to the operation instruction according to the operation instruction, and determining whether the interceptor is loaded for the first time; if the interceptor is loaded for the first time, loading the interceptor, and after the loading is completed, automatically refreshing the webpage and intercepting all the resources by using the interceptor; if the interceptor is not loaded for the first time, intercepting all the resources by using the interceptor.
2. The gray scale publishing method of claim 1, wherein, The loading of the resources corresponding to the operation instruction and the determination of whether the interception configuration is updated comprise: automatically adding a gray label value to the resources by using a script, and determining whether the gray label value is updated.
3. The gray scale publishing method of claim 1, wherein, The determination of whether the gray label of the resources needs to be modified according to the resources comprises: determining whether the gray label of the resources needs to be modified according to the resources and a preset configuration parameter; wherein the configuration parameter comprises address information of the resources.
4. The gray scale publishing method of claim 1, wherein, The adjustment of the original request header of the resources to obtain a new request header, and the merging of the new request header and the request body to obtain the gray label of the resources comprise: obtaining the original request header and the request body of the resources; adding a preset request header parameter to the request header to obtain a new request header; merging the new request header and the original request body to obtain the gray label of the resources.
5. The gray scale publishing method of claim 1, wherein, The obtaining of data corresponding to the gray label from a server according to the gray label comprises: initiating a request for obtaining data to a corresponding server according to the gray label, and receiving the data returned by the server according to the request.
6. A gray release apparatus characterized by comprising: The method comprises the following steps: a resource obtaining module is configured to receive an operation instruction for accessing a webpage, and intercept resources corresponding to the operation instruction by using an interceptor; A judgment module is configured to determine whether the gray-scale label of the resource needs to be modified according to the resource, wherein the gray-scale label comprises a request header and a request body. An acquisition module is configured to acquire the gray-scale label of the resource if the gray-scale label does not need to be modified. A modification module is configured to adjust the original request header of the resource to obtain a new request header, and combine the new request header with the request body to obtain the gray-scale label of the resource if the gray-scale label needs to be modified. A data acquisition module is configured to acquire data corresponding to the gray-scale label from a server according to the gray-scale label. The resource acquisition module comprises: A receiving unit is configured to receive the operation instruction for accessing a webpage. A judgment unit is configured to load the resource corresponding to the operation instruction according to the operation instruction, and determine whether the interception configuration is updated. An interception unit is configured to automatically refresh the webpage and intercept all the resources by using the interceptor if the interception configuration is updated, and not to refresh the webpage and intercept all the resources by using the interceptor if the interception configuration is not updated. The resource acquisition module further comprises: An interceptor judgment unit is configured to load the resource corresponding to the operation instruction according to the operation instruction, and determine whether the interceptor is loaded for the first time. An acquisition unit is configured to load the interceptor if the interceptor is loaded for the first time, automatically refresh the webpage, and intercept all the resources by using the interceptor after the loading is completed, and intercept all the resources by using the interceptor if the interceptor is not loaded for the first time.
7. A computer device, comprising: It comprises: A memory is configured to store a computer program. A processor is configured to execute the computer program to implement the gray-scale publishing method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer executable instructions, and the computer executable instructions are loaded and executed by the processor to implement the steps of the gray-scale publishing method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Handling method and system of grey release
CN103095743A
Gray version page access method and device, computer device and computer storage medium
CN109376322A
Gray release method, system and device and computer readable storage medium
CN110650163A