Grayscale release method, device, equipment and computer readable medium

By calculating the Boolean hit value and grayscale ratio of the access request, the switching direction of the access request is controlled, which solves the problem of ineffective grayscale publishing traffic switching in the existing technology, and achieves the purpose of orderly traffic switching and full switching.

CN113918237BActive Publication Date: 2024-10-01GUANGZHOU PINWEI SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111115551.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-23
Publication Date
2024-10-01
Estimated Expiration
2041-09-23

AI Technical Summary

Technical Problem

In the existing technology, the grayscale publishing method lacks effective control in the traffic switching process, resulting in long service interruption time when the server is upgraded, and the switching effect is poor, which cannot effectively overcome the technical shortcomings of traditional server upgrades.

Method used

By obtaining the unique identifier of the access request, calculate the Boolean hit value to determine whether it meets the grayscale hit conditions. If it meets the grayscale hit conditions, it will be sent to the target server. Otherwise, it will be sent to the original server. The switching benchmark value will be adjusted according to the grayscale ratio to ensure orderly traffic switching. conduct.

Benefits of technology

It realizes the orderly switching of traffic in grayscale publishing, avoids the failure of grayscale operations, controls the switching granularity, prevents excessive pressure on the target server, and finally achieves full switching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113918237B_ABST
    Figure CN113918237B_ABST
Patent Text Reader

Abstract

The present invention discloses a grayscale publishing method, device, equipment and computer-readable medium, and belongs to the field of computer technology. The method comprises: obtaining an access request; calculating a Boolean hit value corresponding to the access request according to a unique identifier of the access request; judging whether the access request meets a grayscale hit condition according to the Boolean hit value; if the access request meets the grayscale hit condition, sending the access request to a target server, and if the access request does not meet the grayscale hit condition, sending the access request to an original server. The present invention controls the switching of access requests through the unique identification identifier of the access request and the grayscale hit condition, so that the traffic switching link in the grayscale publishing is switched in an orderly manner, and the failure of grayscale operation is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a grayscale publishing method, device, equipment and computer-readable medium. Background Art

[0002] In the traditional server upgrade method, the application source code or program package needs to be uploaded to the server, and the original server providing the original version of the service needs to be stopped first. After the target server providing the new version of the service is successfully upgraded and tested, the target server can be started again. In the above traditional upgrade method, the service needs to be interrupted when the server is upgraded. In addition, if there is a problem with the target server, the rollback operation will cause a longer service interruption.

[0003] In order to solve the problem of traditional server upgrade, the existing technology adopts the gray release method to switch traffic between the new and old servers. The gray release method is to gradually switch the access traffic from the original server to the target server. When the server is upgraded, the original server terminal service is not required. Since the access traffic is gradually switched to the target server, gray release can also avoid large-scale service interruptions caused by target server failures.

[0004] In the prior art, the traffic switching process of grayscale release is usually controlled based on the relevant experience of technical personnel, or no switching control is performed, which can easily cause the traffic switching of grayscale release to be invalid and the switching effect to be poor, and thus still cannot overcome the technical defects of traditional server upgrades. Summary of the invention

[0005] In order to solve the problems of the prior art, the embodiments of the present invention provide a grayscale release method, device, equipment and computer-readable medium. The technical solution is as follows:

[0006] In a first aspect, a grayscale release method is provided, the method comprising:

[0007] Get access request;

[0008] Calculate a Boolean hit value corresponding to the access request according to the unique identifier of the access request;

[0009] Determining whether the access request meets the grayscale hit condition according to the Boolean hit value;

[0010] If the access request meets the grayscale hit condition, the access request is sent to the target server; if the access request does not meet the grayscale hit condition, the access request is sent to the original server.

[0011] Further, calculating the Boolean hit value corresponding to the access request according to the unique identification value of the access request includes:

[0012] Reading the unique identifier;

[0013] Convert the unique identifier into a numerical value to determine a switching reference value;

[0014] The Boolean hit value is calculated according to the switching reference value.

[0015] Furthermore, converting the unique identifier into a numerical value to determine the switching reference value includes:

[0016] Perform CRC32 calculation on the unique identifier to obtain the switching reference value.

[0017] Further, the calculating the Boolean hit value according to the switching reference value includes:

[0018] Get the grayscale calculation base;

[0019] A modulo calculation is performed on the switching reference value and the grayscale calculation base to obtain the Boolean hit value.

[0020] Furthermore, the grayscale hit condition is set according to the grayscale ratio and the grayscale calculation base.

[0021] Furthermore, the grayscale hit condition is:

[0022] The Boolean hit value is smaller than a product of the grayscale ratio and the grayscale calculation base.

[0023] Furthermore, the method further comprises:

[0024] It is determined whether the grayscale ratio meets the target grayscale ratio. If not, the grayscale ratio is updated according to a preset update condition so that the grayscale ratio is increased according to a preset amplitude until the grayscale ratio meets the target grayscale ratio.

[0025] In a second aspect, a phased release device is provided, the device comprising:

[0026] A request acquisition module, used to acquire access requests;

[0027] A request calculation module, used to calculate a Boolean hit value corresponding to the access request according to the unique identifier of the access request;

[0028] A grayscale judgment module, used for judging whether the access request meets the grayscale hit condition according to the Boolean hit value;

[0029] The request switching module is used to send the access request to the target server when the access request meets the grayscale hit condition, and to send the access request to the original server when the access request does not meet the grayscale hit condition.

[0030] Furthermore, the request calculation module includes:

[0031] A unique identification reading module, used for reading a unique identification;

[0032] A switching reference value calculation module, used to convert the unique identifier into a numerical value to determine the switching reference value;

[0033] The Boolean hit value calculation module is used to calculate the Boolean hit value according to the switching reference value.

[0034] Further, the reference value calculation module is switched, specifically for:

[0035] Perform CRC32 calculation on the unique identifier to obtain the switching reference value.

[0036] Furthermore, the Boolean hit value calculation module is specifically used for:

[0037] Get the grayscale calculation base;

[0038] Perform modulo calculation on the switching reference value and the grayscale calculation base to obtain a Boolean hit value.

[0039] Furthermore, the grayscale hit condition is set according to the grayscale ratio and the grayscale calculation base.

[0040] Furthermore, the grayscale hit conditions are specifically as follows:

[0041] The Boolean hit index obtained by the modulo calculation of the switching reference value and the grayscale calculation base is less than the product of the grayscale ratio and the grayscale calculation base.

[0042] Furthermore, the device disclosed in the present invention also includes:

[0043] The adjustment module is used to determine whether the grayscale ratio meets the target grayscale ratio. If not, the grayscale ratio is updated according to a preset update condition so that the grayscale ratio is increased according to a preset amplitude until the grayscale ratio meets the target grayscale ratio.

[0044] In a third aspect, an electronic device is provided, including:

[0045] one or more processors; and

[0046] A memory associated with the one or more processors, the memory being used to store program instructions, wherein the program instructions, when read and executed by the one or more processors, execute any method described in the first aspect.

[0047] According to a fourth aspect, a computer-readable medium is provided, on which a computer program is stored, wherein when the program is executed by a processor, the method described in any one of the first aspects is implemented.

[0048] The technical solution provided by the embodiment of the present invention has the following beneficial effects:

[0049] 1. The data solution provided by the embodiment of the present invention controls the access request switching through the unique identification mark of the access request and the grayscale hit condition, so that the traffic switching link in the grayscale release is switched in an orderly manner to avoid the failure of the grayscale operation;

[0050] 2. The data solution provided by the embodiment of the present invention sets the grayscale hit condition according to the grayscale ratio, and can control and adjust the switching granularity according to the actual switching requirements to prevent the grayscale release switching traffic from being too large and causing pressure on the target server;

[0051] 3. The data solution provided by the embodiment of the present invention can gradually switch the access traffic by controlling the grayscale ratio, and finally achieve the purpose of full switching. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0053] Figure 1 is a flow chart of a grayscale publishing method provided by an embodiment of the present invention;

[0054] Figure 2 It is a schematic diagram of the structure of a grayscale publishing device provided by an embodiment of the present invention;

[0055] Figure 3 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0057] As described in the background technology, in the prior art of grayscale publishing, the traffic switching link is usually controlled based on the subjective experience of technicians, or no switching control is performed, which leads to the problem of poor grayscale publishing effect. The technical solution disclosed in the embodiment of the present invention obtains the identification value of the original server corresponding to the access request, and determines the switching direction of the traffic based on whether the identification value meets the grayscale hit condition, so that the traffic switching of the grayscale publishing is carried out in an orderly manner, avoiding invalid grayscale publishing. The specific technical solution is as follows:

[0058] like Figure 1 As shown, a grayscale release method includes:

[0059] S1. Get access request.

[0060] As mentioned above, the access request is related to the business service provided by the system. If it is a query service, the access request is a query request; if it is an update service, the access request is an update request; if it is a delete service, the access request is a delete request; if it is a cache service, the access request is a cache request.

[0061] In the process of obtaining the access request, the request information included in the access request can be read. The request information may include: request source, request method, request content, etc., where the request source is the acquisition interface, the request method indicates GET, DELETE, SET, OPTIONS, etc., and the request information indicates the specific access address. For example, if the access request is a cache request, the cache file name in the request information is read; if the access request is a query request, the query file name in the request information is read.

[0062] S2. Calculate the Boolean hit value corresponding to the access request according to the unique identifier of the access request.

[0063] As mentioned above, the unique identifier of the access request represents the uniqueness of the access request, which can be obtained from the request information or manually defined. The unique identifier can be a combination of the source of the access request, the request method, and the request content, or only one or two of them. For example: the unique identifier of the access request can be the name or code of the file that the access request needs to access; or when the access request is a request to store a file, the unique identifier value is the name or code of the file to be stored; or the unique identifier of the access request represents the combination of the request interface and the request method at the time of the request.

[0064] The Boolean hit value is calculated based on the unique identifier. Since the unique identifier uniquely corresponds to the access request, the Boolean hit value also uniquely corresponds to the access request.

[0065] In one embodiment, step S2 includes:

[0066] Read the unique identification value;

[0067] Convert the unique identification value into a numerical value to determine the switching reference value;

[0068] Calculates a Boolean hit value based on the switch reference value.

[0069] In the above, the switching reference value can be a preset value corresponding to the unique identification value, or can be obtained by converting the unique identification value from a character string to a numerical value. Preferably, the unique identification can be converted into a numerical value by using a calculation of converting a character string to a numerical value, and the numerical value is the switching reference value. Specifically, the algorithm for converting a character string to a numerical value can be any algorithm in the prior art, such as CRC32, md5, etc.

[0070] In one embodiment, the embodiment of the present invention uses CRC32 to convert the unique identification value into a numerical value.

[0071] As mentioned above, CRC32 is mainly used for data verification in the prior art. In long-distance data communication, in order to ensure accurate data transmission, it is necessary to perform error control, i.e., verification, on the data. CRC, as a cyclic redundancy check algorithm, verifies the transmission database. The embodiment of the present invention utilizes the feature that the CRC32 algorithm can convert a string into a unique numerical ID of the long type.

[0072] In one embodiment, calculating the Boolean hit value according to the switching reference value includes:

[0073] Get the grayscale calculation base;

[0074] A modulo calculation is performed based on the switching reference value and the grayscale calculation base to obtain a Boolean hit value.

[0075] As mentioned above, the grayscale calculation modulus is the basic unit of grayscale control, and its reciprocal is expressed as the minimum grayscale granularity supported.

[0076] S3. Determine whether the access request meets the grayscale hit condition according to the Boolean hit value.

[0077] As mentioned above, the grayscale hit condition is preset by the technicians. The grayscale hit condition includes the grayscale ratio (gray percentage), which is related to the grayscale ratio. The grayscale ratio represents the ratio of access request switching and can be expressed in decimal form. The minimum value is 0 and the maximum value is 1.

[0078] In one embodiment, the grayscale hit condition is set according to the grayscale ratio and the grayscale calculation base.

[0079] The grayscale hit condition may be specifically a combination of grayscale ratio and grayscale calculation result. Preferably, the grayscale hit condition is: the Boolean hit value obtained by modulo calculation of the switching reference value and the grayscale calculation base is less than the product of the grayscale ratio and the grayscale calculation base.

[0080] S4. If the access request meets the grayscale hit condition, the access request is sent to the target server; if the access request does not meet the grayscale hit condition, the access request is sent to the original server.

[0081] In the above, the target server refers to the server that stores the updated data or performs the updated business function. The original server refers to the server that the access request accessed before the grayscale release.

[0082] In one embodiment, the method disclosed in the present invention further comprises:

[0083] It is determined whether the grayscale ratio meets the target grayscale ratio. If not, the grayscale ratio is updated according to the preset update conditions, so that the grayscale ratio is increased according to the preset amplitude until the grayscale ratio meets the target grayscale ratio.

[0084] As mentioned above, the target grayscale ratio can be manually set between 0 and 1. If the purpose of full switching is to be achieved in the end, the target grayscale ratio is set to 1. The preset range can be set according to the actual operation of the target server.

[0085] As described above, the grayscale publishing method provided by the embodiment of the present invention controls the switching of access requests through the unique identification mark of the access request and the grayscale hit condition, so that the traffic switching link in the grayscale publishing is switched in an orderly manner to avoid the failure of the grayscale operation.

[0086] The grayscale publishing method provided in the embodiment of the present invention sets the grayscale hit condition according to the grayscale ratio, and can control and adjust the switching granularity according to the actual switching demand, so as to prevent the grayscale publishing switching traffic from being too large and causing pressure on the target server.

[0087] The grayscale publishing method provided in the embodiment of the present invention can gradually switch the access traffic by controlling the grayscale ratio, and finally achieve the purpose of full switching.

[0088] like Figure 2 As shown, based on the above-mentioned grayscale publishing method, an embodiment of the present invention further provides a grayscale publishing device, including:

[0089] The request acquisition module 201 is used to acquire an access request.

[0090] The request calculation module 202 is used to calculate the Boolean hit value corresponding to the access request according to the unique identifier of the access request.

[0091] The grayscale judgment module 203 is used to judge whether the access request meets the grayscale hit condition according to the Boolean hit value.

[0092] The request switching module 204 is used to send the access request to the target server when the access request meets the grayscale hit condition, and to send the access request to the original server when the access request does not meet the grayscale hit condition.

[0093] As mentioned above, the access request is related to the business services provided by the system. In the process of obtaining the access request, the request information included in the access request can be read. The request information may include: request source, request method, request content, etc., where the request source is the acquisition interface, the request method represents GET, DELETE, SET, OPTIONS, etc., and the request information represents the specific access address. The unique identifier of the access request represents the uniqueness of the access request, which can be obtained from the request information or manually defined. The unique identifier can be combined to represent the source of the access request, the request method, and the request content, or only one or two of them can be represented separately. The grayscale hit condition is preset by the technician. The grayscale hit condition includes the gray percentage, which is related to the gray percentage. The gray percentage is the ratio of the access request switch, which can be expressed in decimal form, with a minimum value of 0 and a maximum value of 1.

[0094] In one embodiment, the request calculation module 202 includes:

[0095] A unique identification reading module, used for reading a unique identification;

[0096] A switching reference value calculation module, used to convert the unique identifier into a numerical value to determine the switching reference value;

[0097] The Boolean hit value calculation module is used to calculate the Boolean hit value according to the switching reference value.

[0098] As mentioned above, the switching reference value can be a preset value corresponding to the unique identification value, or can be obtained by converting the unique identification value from a string to a value. The unique identification value can be converted into a value by converting a string to a value, and the value is the switching reference value.

[0099] In one embodiment, the switching reference value calculation module is specifically used to:

[0100] Perform CRC32 calculation on the unique identifier to obtain the switching reference value.

[0101] The above uses the feature of the CRC32 algorithm that can convert a string into a unique numeric ID of type long.

[0102] In one embodiment, the Boolean hit value calculation module is specifically used to:

[0103] Get the grayscale calculation base;

[0104] Perform modulo calculation on the switching reference value and the grayscale calculation base to obtain a Boolean hit value.

[0105] As mentioned above, the grayscale calculation modulus is the basic unit of grayscale control, and its reciprocal is expressed as the minimum grayscale granularity supported.

[0106] In one embodiment, the grayscale hit condition is set according to the grayscale ratio and the grayscale calculation base, specifically: the Boolean hit index obtained by the modulus calculation of the switching reference value and the grayscale calculation base is less than the product of the grayscale ratio and the grayscale calculation base.

[0107] In one embodiment, the present invention further includes:

[0108] The adjustment module is used to determine whether the grayscale ratio meets the target grayscale ratio. If not, the grayscale ratio is updated according to a preset update condition so that the grayscale ratio is increased according to a preset amplitude until the grayscale ratio meets the target grayscale ratio.

[0109] As mentioned above, the target grayscale ratio can be manually set between 0 and 1. If the purpose of full switching is to be achieved in the end, the target grayscale ratio is set to 1. The preset range can be set according to the actual operation of the target server.

[0110] As described above, the grayscale publishing device provided in the embodiment of the present invention completes the main steps of the grayscale publishing method disclosed in the embodiment of the present invention through a request acquisition module, a request calculation module, a grayscale judgment module, and a request switching module. The device can be independently set in a computer system or nested in a business system for switching control of access traffic.

[0111] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present invention, which will not be described in detail here.

[0112] The technical solution disclosed in the present invention is described in detail below in conjunction with a specific business scenario of cache service upgrade.

[0113] The cache server is a data storage server that is not easily changed and is frequently called on top of the underlying source database to relieve the access pressure of the source database. In the case of a huge amount of cached data, a cache service cluster with multiple cache nodes is usually used to provide cache services.

[0114] In the field of data cache services, in order to achieve a smooth upgrade of cache services, a grayscale release method is usually adopted, that is, the cache data is gradually switched from the old cache node to the new cache service node. In the prior art, the link of switching traffic is usually based on the relevant experience of technicians, or no switching control is performed. Therefore, in actual operation, the data storage node and the reading node are often inconsistent, resulting in a cache read failure. Furthermore, if a large number of cache read failures occur, the traffic will be sent to the source database, causing great pressure on the source database, and may even cause downtime.

[0115] In order to solve the technical problems existing in the cache service upgrade process, the present invention provides a grayscale release method, and the specific technical solution is as follows:

[0116] The grayscale calculation modulus and grayscale percentage are read from the configuration. The grayscale calculation modulus is 1 million by default, and the grayscale percentage is 0 by default. The grayscale percentage is 1 when the full value is set.

[0117] Get the cache access request, and read the unique identifier (key) corresponding to the cache access request, where the unique identifier is the file name of the to-be-cached file corresponding to the cache access request.

[0118] The unique identifier is converted into a numerical value using the CRC32 algorithm, and the switching reference value corresponding to the unique identifier is calculated.

[0119] The switching reference value and the grayscale calculation base are modulo calculated to obtain the Boolean hit index, as shown in the following formula:

[0120] Boolean hit=value%modulus

[0121] Determine whether the Boolean hit indicator meets the grayscale hit condition, as shown in the following formula:

[0122] Boolean hit=value%modulus<gray percentage·modulus

[0123] If the above grayscale hit conditions are met, the cache access request is sent to the upgraded target cache server. If the above grayscale hit conditions are not met, the cache access request is sent to the original cache server.

[0124] Determine whether the grayscale ratio is 1. If not, gradually enlarge the grayscale ratio by ten times as a step and perform flow conversion until the grayscale ratio is 1.

[0125] In addition, an embodiment of the present invention further provides an electronic device, including:

[0126] one or more processors; and

[0127] A memory associated with the one or more processors, the memory is used to store program instructions, and when the program instructions are read and executed by the one or more processors, the grayscale publishing method disclosed in the above embodiment is executed.

[0128] in, Figure 3 The system architecture of the electronic device is exemplarily shown, which may include a processor 310, a video display adapter 311, a disk drive 312, an input / output interface 313, a network interface 314, and a memory 320. The processor 310, the video display adapter 311, the disk drive 312, the input / output interface 313, the network interface 314, and the memory 320 may be communicatively connected via a communication bus 330.

[0129] Among them, the processor 310 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc., to execute relevant programs to implement the technical solution provided in this application.

[0130] The memory 320 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 320 can store an operating system 321 for controlling the operation of the electronic device and a basic input and output system (BIOS) for controlling the low-level operation of the electronic device. In addition, a web browser 323, a data storage management system 324, and a device identification information processing system 325, etc. can also be stored. The above-mentioned device identification information processing system 325 can be an application program that specifically implements the operations of the aforementioned steps in the embodiment of the present application. In short, when the technical solution provided by the present application is implemented by software or firmware, the relevant program code is stored in the memory 320 and is called and executed by the processor 310.

[0131] The input / output interface 313 is used to connect the input / output module to realize information input and output. The input / output module can be configured as a component in the device (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0132] The network interface 314 is used to connect to a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0133] The bus 330 comprises a pathway for transmitting information between the various components of the device (eg, the processor 310, the video display adapter 311, the disk drive 312, the input / output interface 313, the network interface 314, and the memory 320).

[0134] In addition, the electronic device can also obtain information on specific collection conditions from the virtual resource object collection condition information database for use in condition judgment, etc.

[0135] It should be noted that, although the above device only shows a processor 410, a video display adapter 411, a disk drive 412, an input / output interface 413, a network interface 414, a memory 420, a bus 430, etc., in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include components necessary for implementing the solution of the present application, and does not necessarily include all the components shown in the figure.

[0136] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a memory, or installed from a ROM. When the computer program is executed by a processor, the above-mentioned functions defined in the method of the embodiment of the present application are executed.

[0137] It should be noted that the computer-readable medium of the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In an embodiment of the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In an embodiment of the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0138] The computer-readable medium may be included in the server; or it may exist independently without being installed in the server. The computer-readable medium carries one or more programs. When the one or more programs are executed by the server, the server: in response to detecting that the peripheral mode of the terminal is not activated, obtains the frame rate of the application on the terminal; when the frame rate meets the screen-off condition, determines whether the user is obtaining the screen information of the terminal; in response to the judgment result that the user is not obtaining the screen information of the terminal, controls the screen to enter the immediate dimming mode.

[0139] Computer program code for performing the operation of the embodiments of the present application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer, partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., using an Internet service provider to connect through the Internet).

[0140] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.

[0141] The technical solution provided by the present application is described in detail above. The principle and implementation method of the present application are described in detail using specific examples. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as limiting the present application.

[0142] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A grayscale release method, characterized in that: include: Get access request; Calculating a Boolean hit value corresponding to the access request according to a unique identifier of the access request, wherein the unique identifier is used to combine and characterize one or more of a source of the access request, a request method, and a request content; Determining whether the access request meets the grayscale hit condition according to the Boolean hit value, wherein the grayscale hit condition is set according to the grayscale ratio and the grayscale calculation base, specifically: the Boolean hit value is less than the product of the grayscale ratio and the grayscale calculation base; If the access request meets the grayscale hit condition, the access request is sent to the target server; if the access request does not meet the grayscale hit condition, the access request is sent to the original server; The method for calculating the Boolean hit value corresponding to the access request includes: Based on the CRC32 algorithm, the unique identifier is converted into a numerical value to determine a switching reference value; A modulo calculation is performed on the switching reference value and the grayscale calculation base to obtain the Boolean hit value.

2. The method according to claim 1, characterized in that The calculating the Boolean hit value corresponding to the access request according to the unique identifier of the access request includes: Reading the unique identifier; Convert the unique identifier into a numerical value to determine a switching reference value; The Boolean hit value is calculated according to the switching reference value.

3. The method according to claim 2, characterized in that The converting the unique identifier into a numerical value to determine the switching reference value includes: Perform CRC32 calculation on the unique identifier to obtain the switching reference value.

4. The method according to claim 2, characterized in that The calculating the Boolean hit value according to the switching reference value comprises: Get the grayscale calculation base; A modulo calculation is performed on the switching reference value and the grayscale calculation base to obtain the Boolean hit value.

5. The method according to claim 1, characterized in that The method further comprises: It is determined whether the grayscale ratio meets the target grayscale ratio. If not, the grayscale ratio is updated according to a preset update condition so that the grayscale ratio is increased according to a preset amplitude until the grayscale ratio meets the target grayscale ratio.

6. A grayscale publishing device, characterized in that: include: A request acquisition module, used to acquire access requests; A request calculation module, used to calculate a Boolean hit value corresponding to the access request according to a unique identifier of the access request, wherein the unique identifier is used to combine and characterize one or more of a source of the access request, a request method, and a request content; A grayscale judgment module, used for judging whether the access request meets the grayscale hit condition according to the Boolean hit value, wherein the grayscale hit condition is set according to the grayscale ratio and the grayscale calculation base, specifically: the Boolean hit value is less than the product of the grayscale ratio and the grayscale calculation base; A request switching module, configured to send the access request to a target server when the access request meets the grayscale hit condition, and to send the access request to an original server when the access request does not meet the grayscale hit condition; The method for calculating the Boolean hit value corresponding to the access request includes: Based on the CRC32 algorithm, the unique identifier is converted into a numerical value to determine a switching reference value; A modulo calculation is performed on the switching reference value and the grayscale calculation base to obtain the Boolean hit value.

7. An electronic device, characterized in that: include: one or more processors; as well as A memory associated with the one or more processors, the memory being used to store program instructions, wherein the program instructions, when read and executed by the one or more processors, execute any of the methods described in 1-5.

8. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.