CN113918237A - Gray scale publishing method, device, equipment and computer readable medium - Google Patents

Gray scale publishing method, device, equipment and computer readable medium Download PDF

Info

Publication number
CN113918237A
CN113918237A CN202111115551.9A CN202111115551A CN113918237A CN 113918237 A CN113918237 A CN 113918237A CN 202111115551 A CN202111115551 A CN 202111115551A CN 113918237 A CN113918237 A CN 113918237A
Authority
CN
China
Prior art keywords
access request
gray scale
hit
boolean
gray level
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111115551.9A
Other languages
Chinese (zh)
Inventor
伍尚侨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Pinwei Software Co Ltd
Original Assignee
Guangzhou Pinwei Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Pinwei Software Co Ltd filed Critical Guangzhou Pinwei Software Co Ltd
Priority to CN202111115551.9A priority Critical patent/CN113918237A/en
Publication of CN113918237A publication Critical patent/CN113918237A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44536Selecting among different versions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1004Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Abstract

The invention discloses a gray level publishing method, device and equipment and a computer readable medium, and belongs to the technical field of computers. The method comprises the following steps: acquiring an access request; calculating a Boolean hit value corresponding to the access request according to the unique identifier of the access request; judging whether the access request meets a gray level hit condition or not according to the Boolean hit value; and if the access request meets the gray level hit condition, sending the access request to a target server, and if the access request does not meet the gray level hit condition, sending the access request to an original server. The access request switching is controlled through the unique identification mark of the access request and the gray level hit condition, so that the flow switching links in gray level issuing are switched in order, and the failure of gray level operation is avoided.

Description

Gray scale publishing method, device, equipment and computer readable medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a computer readable medium for gray scale publishing.
Background
In the traditional server upgrading method, application source codes or program packages need to be uploaded to a server, an original server providing the original version service is stopped, and a target server is started after a target server providing the new version service is upgraded and tested successfully. In the above conventional upgrading method, the server needs to be interrupted during upgrading, and if the target server has a problem, the rollback operation will cause a longer service interruption.
In order to solve the problem of upgrading the traditional server, a gray level publishing method is adopted in the prior art to realize the switching of the flow between the new server and the old server. The gray scale publishing method is to gradually switch the access flow from the original server to the target server, the terminal service of the original server is not needed when the server is upgraded, and the access flow is gradually switched to the target server, so that the gray scale publishing can also avoid large-scale service interruption caused by the fault of the target server.
In the prior art, the flow switching of the gray scale release is usually controlled based on the related experience of technicians in the flow switching link, or the switching control is not performed, so that the flow switching of the gray scale release is easily ineffective, the switching effect is poor, and the technical defect existing in the traditional server upgrading still cannot be overcome.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide a method, an apparatus, a device, and a computer-readable medium for gray scale publishing. The technical scheme is as follows:
in a first aspect, a method for issuing grayscale is provided, the method including:
acquiring an access request;
calculating a Boolean hit value corresponding to the access request according to the unique identifier of the access request;
judging whether the access request meets a gray level hit condition or not according to the Boolean hit value;
and if the access request meets the gray level hit condition, sending the access request to a target server, and if the access request does not meet the gray level hit condition, sending the access request to an original server.
Further, the calculating a boolean hit value corresponding to the access request according to the unique identification value of the access request includes:
reading the unique identification;
converting the unique identifier into a numerical value, and determining a switching reference value;
and calculating the Boolean hit value according to the switching reference value.
Further, the converting the unique identifier into a numerical value and determining the handover reference value includes:
and performing CRC32 calculation on the unique identifier to obtain the switching reference value.
Further, the calculating the boolean hit value according to the switching reference value includes:
acquiring a gray level calculation base number;
and performing modulus calculation on the switching reference value and the gray level calculation base number to obtain the Boolean hit value.
Further, the gradation hit condition is set according to a gradation ratio and a gradation calculation base.
Further, the gray hit condition is:
the Boolean hit value is less than a product of the gray scale and the gray scale calculation base.
Further, the method further comprises:
and judging whether the gray scale accords with the target gray scale, if not, updating the gray scale according to a preset updating condition, so that the gray scale is increased according to a preset amplitude until the gray scale accords with the target gray scale.
In a second aspect, there is provided a gradation issuance apparatus, comprising:
the request acquisition module is used for acquiring an access request;
the request calculation module is used for calculating a Boolean hit value corresponding to the access request according to the unique identifier of the access request;
the gray level judging module is used for judging whether the access request meets a gray level hit condition or not according to the Boolean hit value;
and the request switching module is used for sending the access request to a target server when the access request meets the gray level hit condition, and sending the access request to an original server when the access request does not meet the gray level hit condition.
Further, a request computation module comprising:
the unique identifier reading module is used for reading the unique identifier;
the switching reference value calculation module is used for converting the unique identifier into a numerical value and determining a switching reference value;
and the Boolean hit value calculating module is used for calculating the Boolean hit value according to the switching reference value.
Further, the switching reference value calculating module is specifically configured to:
and performing CRC32 calculation on the unique identifier to obtain a switching reference value.
Further, the boolean hit value calculation module is specifically configured to:
acquiring a gray level calculation base number;
and performing modulus calculation on the switching reference value and the gray level calculation base number to obtain a Boolean hit value.
Further, the gradation hit condition is set according to the gradation ratio and the gradation calculation base number.
Further, the gray level hit condition is specifically:
the Boolean hit index obtained by the modulo calculation of the switching reference value and the gray scale calculation base is smaller than the product of the gray scale proportion and the gray scale calculation base
Further, the device disclosed by the invention also comprises:
and the adjusting module is used for judging whether the gray scale meets the target gray scale, if not, updating the gray scale according to a preset updating condition, so that the gray scale is improved according to a preset amplitude until the gray scale meets the target gray scale.
In a third aspect, an electronic device is provided, including:
one or more processors; and
memory associated with the one or more processors for storing program instructions which, when read and executed by the one or more processors, perform the method of any of the first aspects.
In a fourth aspect, a computer-readable medium is provided, on which a computer program is stored, wherein the program, when executed by a processor, implements the method according to any of the first aspects.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
1. according to the data scheme provided by the embodiment of the invention, the access request switching is controlled through the unique identification mark of the access request and the gray level hit condition, so that the flow switching link in gray level release is switched orderly, and the gray level operation failure is avoided;
2. according to the data scheme provided by the embodiment of the invention, the gray scale hit condition is set according to the gray scale proportion, the switching granularity can be controlled and adjusted according to the actual switching requirement, and the pressure on a target server caused by overlarge gray scale issuing switching flow is prevented;
3. the data scheme provided by the embodiment of the invention can gradually switch the access flow by controlling the gray scale, and finally realizes the purpose of full-scale switching.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a gray scale publishing method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a gray scale issuing device according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As described in the background art, in the prior art of gray scale publishing, a flow switching link is generally controlled according to subjective experience of a technician or is not controlled, thereby causing a problem of poor gray scale publishing effect. The technical scheme disclosed by the embodiment of the invention obtains the identification value of the original server corresponding to the access request, and determines the switching direction of the flow according to whether the identification value meets the gray scale hit condition, so that the flow switching of the gray scale issue is performed orderly, and the invalid gray scale issue is avoided. The specific technical scheme is as follows:
as shown in fig. 1, a gray scale issuing method includes:
and S1, acquiring the access request.
The access request is related to a service provided by the system, and if the access request is a query service, the access request is a query request; if the service is the updating service, the access request is the updating request; if the service is deleted, the access request is a deletion request; and if the cache service is adopted, the access request is a cache request.
The request information included in the access request can be read in the process of obtaining the access request, and the request information may include: the request source is an acquisition interface, the request mode represents GET, DELETE, SET, OPTIONS and the like, and the request information represents a specific access address. For example, if the access request is a cache request, reading a cache file name in the request information; and if the access request is a query request, reading the query file name in the request information.
And S2, calculating a Boolean hit value corresponding to the access request according to the unique identifier of the access request.
The unique identifier of the access request represents the uniqueness of the access request, and can be obtained from the request information or artificially defined. The unique identifier may be used in conjunction with characterizing the source of the access request, the manner of the request, the content of the request, or only one or two of them individually. For example: the unique identification of the access request can be the name or code of the file to be accessed by the access request; or when the access request is a file storage request, the unique identification value is the name or code of the file to be stored; or the unique identifier of the access request characterizes the combination of the request interface and the request mode in the request.
The Boolean hit value is calculated and obtained according to the unique identifier, and the Boolean hit value is uniquely corresponding to the access request because the unique identifier is uniquely corresponding to the access request.
In one embodiment, step S2 includes:
reading the unique identification value;
converting the unique identification value into a numerical value, and determining a switching reference value;
and calculating a Boolean hit value according to the switching reference value.
The switching reference value may be a preset numerical value corresponding to the unique identification value, or obtained by performing string-to-numerical value conversion calculation on the unique identification value. Preferably, the unique identifier may be converted into a numerical value by a calculation of converting a character string into the numerical value, and the numerical value is a switching reference value. Specifically, the algorithm for converting the character string into the numerical value may be any one of algorithms in the related art, such as CRC32, md5, and the like.
In one embodiment, embodiments of the present invention use CRC32 to convert the unique identification value to a numerical value.
As described above, CRC32 is mainly used for data check in the prior art, and in long-distance data communication, in order to ensure accurate data transmission of high-accuracy data, error control, i.e., check, must be performed on the data. The embodiment of the invention utilizes the characteristic that the CRC32 algorithm can convert the character string into a long type unique numerical value ID.
In one embodiment, calculating the boolean hit value from the switching reference value comprises:
acquiring a gray level calculation base number;
and performing modulus calculation according to the switching reference value and the gray level calculation base number to obtain a Boolean hit value.
As described above, the gradation calculation basis number (modulus) is a basic unit of gradation control, and its reciprocal is expressed as the minimum gradation granularity supported.
And S3, judging whether the access request meets the gray scale hit condition according to the Boolean hit value.
The gray scale hit condition is preset by a technician, and includes a gray scale (gray scale), which is a scale representing switching of the access request and can be expressed in decimal form, and the minimum value is 0 and the maximum value is 1.
In one embodiment, the gradation hit condition is set according to the gradation proportion and the gradation calculation base.
As described above, the gradation hit condition may be specifically a combination calculation of the gradation ratio and the gradation calculation result. Preferably, the gray hit condition is: the Boolean hit value obtained by the modulo calculation of the switching reference value and the gradation calculation base is smaller than the product of the gradation proportion and the gradation calculation base.
And S4, if the access request meets the gray level hit condition, sending the access request to a target server, and if the access request does not meet the gray level hit condition, sending the access request to an original server.
The target server means a server that stores updated data or performs an updated service function. The original server refers to a server which is accessed by the access request before the gray scale is released.
In one embodiment, the method of the present disclosure further comprises:
and judging whether the gray scale accords with the target gray scale, if not, updating the gray scale according to a preset updating condition, so that the gray scale is increased according to a preset amplitude until the gray scale accords with the target gray scale.
The target gray scale may be set between 0 and 1, and is set to 1 if the purpose of switching the full scale is to be achieved. The preset amplitude can be set according to the running condition of the actual target server.
As described above, according to the gray scale publishing method provided by the embodiment of the present invention, the access request switching is controlled through the unique identification identifier of the access request and the gray scale hit condition, so that the flow switching link in the gray scale publishing is switched in order, and the gray scale operation failure is avoided.
The gray scale publishing method provided by the embodiment of the invention sets the gray scale hit condition according to the gray scale proportion, can control and adjust the switching granularity according to the actual switching requirement, and prevents the pressure of the target server caused by overlarge gray scale publishing switching flow.
The gray scale issuing method provided by the embodiment of the invention can gradually switch the access flow by controlling the gray scale proportion, and finally realizes the purpose of full-scale switching.
As shown in fig. 2, based on the gray scale issuing method, an embodiment of the present invention further provides a gray scale issuing apparatus, including:
a request obtaining module 201, configured to obtain an access request.
And the request calculating module 202 is configured to calculate a boolean hit value corresponding to the access request according to the unique identifier of the access request.
And the gray level judging module 203 is used for judging whether the access request meets the gray level hit condition according to the boolean hit value.
The request switching module 204 is configured to send the access request to the target server when the access request meets the gray level hit condition, and send the access request to the original server when the access request does not meet the gray level hit condition.
As described above, the access request is related to a business service provided by the system. The request information included in the access request can be read in the process of obtaining the access request, and the request information may include: the request source is an acquisition interface, the request mode represents GET, DELETE, SET, OPTIONS and the like, and the request information represents a specific access address. The unique identifier of the access request represents the uniqueness of the access request, and can be obtained from the request information or artificially defined. The unique identifier may be used in conjunction with characterizing the source of the access request, the manner of the request, the content of the request, or only one or two of them individually. The gray scale hit condition is preset by a technician, and includes a gray scale (gray scale), which is a scale representing switching of an access request and can be expressed in a decimal form, and the minimum value is 0 and the maximum value is 1.
In one embodiment, the request calculation module 202 includes:
the unique identifier reading module is used for reading the unique identifier;
the switching reference value calculation module is used for converting the unique identifier into a numerical value and determining a switching reference value;
and the Boolean hit value calculating module is used for calculating the Boolean hit value according to the switching reference value.
The switching reference value may be a preset numerical value corresponding to the unique identification value, or obtained by performing string-to-numerical value conversion calculation on the unique identification value. The unique identification value may be converted into a numerical value, which is a switching reference value, using a string-to-numerical calculation.
In an embodiment, the switching reference value calculating module is specifically configured to:
and performing CRC32 calculation on the unique identifier to obtain a switching reference value.
The feature that the CRC32 algorithm can convert the string into a long type unique numerical ID is utilized.
In one embodiment, the boolean hit value calculation module is specifically configured to:
acquiring a gray level calculation base number;
and performing modulus calculation on the switching reference value and the gray level calculation base number to obtain a Boolean hit value.
As described above, the gradation calculation basis number (modulus) is a basic unit of gradation control, and its reciprocal is expressed as the minimum gradation granularity supported.
In one embodiment, the gray scale hit condition is set according to the gray scale and the gray scale calculation base, specifically: the Boolean hit index obtained by the modulo calculation of the switching reference value and the gray scale calculation base is smaller than the product of the gray scale proportion and the gray scale calculation base.
In one embodiment, an embodiment of the present invention further includes:
and the adjusting module is used for judging whether the gray scale meets the target gray scale, if not, updating the gray scale according to a preset updating condition, so that the gray scale is improved according to a preset amplitude until the gray scale meets the target gray scale.
The target gray scale may be set between 0 and 1, and is set to 1 if the purpose of switching the full scale is to be achieved. The preset amplitude can be set according to the running condition of the actual target server.
As described above, the gray scale publishing device provided in the embodiment of the present invention completes the main steps of the gray scale publishing method disclosed in the embodiment of the present invention through the request obtaining module, the request calculating module, the gray scale judging module, and the request switching module, and the gray scale publishing device can be independently installed in a computer system or embedded in a service system for switching control of access traffic.
All the above-mentioned optional technical solutions can be combined arbitrarily to form the optional embodiments of the present invention, and are not described herein again.
The technical solution disclosed in the present invention is described in detail below with reference to a specific service scenario of cache service upgrade.
The cache server is above the underlying source database, and stores a data storage server which is not easy to change and is frequently called in order to relieve the access pressure of the source database. In the case of a large amount of cache data, a cache service cluster having a plurality of cache nodes is generally used to provide a cache service.
In the field of data caching service, in order to achieve smooth upgrade of caching service, a method of gray-scale publishing is generally adopted, that is, cache data is gradually switched from an old cache node to a new cache service node. In the prior art, a link of switching traffic is usually based on related experience of technicians, or switching control is not performed, so that inconsistency between a data storage node and a reading node often occurs during actual operation, which results in failure of reading a cache.
In order to solve the technical problem existing in the cache service upgrading process, the invention provides a gray level publishing method, which comprises the following specific technical scheme:
the grayscale calculation basis (modulus) and the grayscale proportion (gray percentage) are read from the configuration, the grayscale calculation basis is 100 ten thousand by default, the grayscale proportion is 0 by default, and the configuration is 1 in the total amount.
And obtaining a cache access request, and reading a unique identifier (key) corresponding to the cache access request, wherein the unique identifier is the file name of a file to be cached corresponding to the cache access request.
And converting the unique identifier into a numerical value by using a CRC32 algorithm, and calculating a switching reference value corresponding to the unique identifier.
Performing modulus calculation on the switching reference value and the gray level calculation base number to obtain a Boolean hit index, which is shown as the following formula:
Boolean hit=value%modulus
judging whether the Boolean hit index meets the gray level hit condition or not, as shown in the following formula:
Boolean hit=value%modulus<gray percentage·modulus
and if the gray scale hit condition is met, sending the cache access request to an upgraded target cache server, and if the gray scale hit condition is not met, sending the cache access request to the original cache server.
Judging whether the gray scale is 1, if not, gradually amplifying the gray scale by ten times of step length, and executing flow conversion until the gray scale is 1.
In addition, an embodiment of the present invention further provides an electronic device, including:
one or more processors; and
a memory associated with the one or more processors for storing program instructions that, when read and executed by the one or more processors, perform the gray scale issuance method disclosed in the above embodiments.
Fig. 3 schematically shows a system architecture of an electronic device, which may specifically 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 by a communication bus 330.
The processor 310 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits, and is configured to execute related programs to implement the technical solution provided in the present Application.
The Memory 320 may be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, or the like. The memory 320 may store an operating system 321 for controlling the operation of the electronic device, a Basic Input Output System (BIOS) for controlling low-level operations of the electronic device. In addition, a web browser 323, a data storage management system 324, and a device identification information processing system 325, and the like may also be stored. The device identification information processing system 325 may be an application program that implements the operations of the foregoing steps in this embodiment of the present application. In summary, 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 called to be executed by the processor 310.
The input/output interface 313 is used for connecting an input/output module to realize information input and output. The i/o module may be configured as a component in a device (not shown) or may be external to the device to provide a corresponding function. The input devices may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output devices may include a display, a speaker, a vibrator, an indicator light, etc.
The network interface 314 is used for connecting a communication module (not shown in the figure) to realize communication interaction between the device and other devices. The communication module can realize communication in a wired mode (such as USB, network cable and the like) and also can realize communication in a wireless mode (such as mobile network, WIFI, Bluetooth and the like).
Bus 330 includes a path that transfers information between various components of the device, such as processor 310, video display adapter 311, disk drive 312, input/output interface 313, network interface 314, and memory 320.
In addition, the electronic device may further obtain information of specific pickup conditions from the virtual resource object pickup condition information database for performing condition judgment, and the like.
It should be noted that although the above-mentioned devices only show the processor 410, the video display adapter 411, the disk drive 412, the input/output interface 413, the network interface 414, the memory 420, the bus 430 and so on, in a specific implementation, the device may also include other components necessary for normal operation. Furthermore, it will be understood by those skilled in the art that the apparatus described above may also include only the components necessary to implement the solution of the present application, and not necessarily all of the components shown in the figures.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means, or installed from the memory, or installed from the ROM. The computer program, when executed by a processor, performs the above-described functions defined in the methods of embodiments of the present application.
It should be noted that the computer readable medium of the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In embodiments of the application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In embodiments of the present application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the server; or may exist separately and not be assembled into the server. The computer readable medium carries one or more programs which, when executed by the server, cause the server to: when the peripheral mode of the terminal is detected to be not activated, acquiring a frame rate of an application on the terminal; when the frame rate meets the screen information condition, judging whether a user is acquiring the screen information of the terminal; and controlling the screen to enter an immediate dimming mode in response to the judgment result that the user does not acquire the screen information of the terminal.
Computer program code for carrying out operations for embodiments of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may 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 the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the system or system embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described system and system embodiments are only illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The technical solutions provided by the present application are introduced in detail, and specific examples are applied in the description to explain the principles and embodiments of the present application, and the descriptions of the above examples are only used to help understanding the method and the core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, the specific embodiments and the application range may be changed. In view of the above, the description should not be taken as limiting the application.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (10)

1. A gray scale issuing method characterized by comprising:
acquiring an access request;
calculating a Boolean hit value corresponding to the access request according to the unique identifier of the access request;
judging whether the access request meets a gray level hit condition or not according to the Boolean hit value;
and if the access request meets the gray level hit condition, sending the access request to a target server, and if the access request does not meet the gray level hit condition, sending the access request to an original server.
2. The method of claim 1, wherein said calculating a boolean hit value corresponding to the access request based on the unique identification of the access request comprises:
reading the unique identification;
converting the unique identifier into a numerical value, and determining a switching reference value;
and calculating the Boolean hit value according to the switching reference value.
3. The method of claim 2, wherein said converting said unique identifier into a numerical value, determining said handover reference value, comprises:
and performing CRC32 calculation on the unique identifier to obtain the switching reference value.
4. The method of claim 2, wherein said calculating the boolean hit value from the switching reference value comprises:
acquiring a gray level calculation base number;
and performing modulus calculation on the switching reference value and the gray level calculation base number to obtain the Boolean hit value.
5. The method of any one of claims 1-4, wherein the gray hit condition is set according to a gray scale and a gray scale calculation base.
6. The method of claim 5, wherein the gray hit condition is:
the Boolean hit value is less than a product of the gray scale and the gray scale calculation base.
7. The method of claim 5, wherein the method further comprises:
and judging whether the gray scale accords with the target gray scale, if not, updating the gray scale according to a preset updating condition, so that the gray scale is increased according to a preset amplitude until the gray scale accords with the target gray scale.
8. A gradation issuance apparatus comprising:
the request acquisition module is used for acquiring an access request;
the request calculation module is used for calculating a Boolean hit value corresponding to the access request according to the unique identifier of the access request;
the gray level judging module is used for judging whether the access request meets a gray level hit condition or not according to the Boolean hit value;
and the request switching module is used for sending the access request to a target server when the access request meets the gray level hit condition, and sending the access request to an original server when the access request does not meet the gray level hit condition.
9. An electronic device, comprising:
one or more processors; and
memory associated with the one or more processors for storing program instructions that, when read and executed by the one or more processors, perform the method of any of claims 1-7.
10. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202111115551.9A 2021-09-23 2021-09-23 Gray scale publishing method, device, equipment and computer readable medium Pending CN113918237A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111115551.9A CN113918237A (en) 2021-09-23 2021-09-23 Gray scale publishing method, device, equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111115551.9A CN113918237A (en) 2021-09-23 2021-09-23 Gray scale publishing method, device, equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN113918237A true CN113918237A (en) 2022-01-11

Family

ID=79235923

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111115551.9A Pending CN113918237A (en) 2021-09-23 2021-09-23 Gray scale publishing method, device, equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN113918237A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114401187A (en) * 2022-01-17 2022-04-26 中国工商银行股份有限公司 Gray scale distribution method and device, computer equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112433751A (en) * 2020-12-18 2021-03-02 江苏满运物流信息有限公司 Gray scale distribution method and device, electronic equipment and storage medium
WO2021051541A1 (en) * 2019-09-18 2021-03-25 平安科技(深圳)有限公司 Method and apparatus for achieving simultaneous gray release based on microservice framework, and computer device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021051541A1 (en) * 2019-09-18 2021-03-25 平安科技(深圳)有限公司 Method and apparatus for achieving simultaneous gray release based on microservice framework, and computer device
CN112433751A (en) * 2020-12-18 2021-03-02 江苏满运物流信息有限公司 Gray scale distribution method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114401187A (en) * 2022-01-17 2022-04-26 中国工商银行股份有限公司 Gray scale distribution method and device, computer equipment and storage medium
CN114401187B (en) * 2022-01-17 2024-02-23 中国工商银行股份有限公司 Gray scale issuing method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
TWI705336B (en) Equipment and method for supporting online upgrade
CN110825479A (en) Page processing method and device, terminal equipment, server and storage medium
CN108280341B (en) Channel number adding and installation package checking method and device
CN110334297A (en) Loading method, terminal, server and the storage medium of terminal page
WO2019076293A1 (en) Differential upgrading method, device and system
WO2020233045A1 (en) Plug-in update method and device, server and computer readable storage medium
WO2021115177A1 (en) Application installation method and apparatus, terminal device, server and storage medium
CN112947983A (en) Application program updating method and device, electronic equipment and storage medium
CN113918237A (en) Gray scale publishing method, device, equipment and computer readable medium
CN113760536A (en) Data caching method and device, electronic equipment and computer readable medium
CN111107133A (en) Generation method of difference packet, data updating method, device and storage medium
CN109299124B (en) Method and apparatus for updating a model
CN113849752A (en) Page caching method and device and storage medium
CN116450511A (en) Information updating method, device, electronic equipment and computer readable medium
CN116226189A (en) Cache data query method, device, electronic equipment and computer readable medium
CN115842789A (en) Data packet scheduling method and device and readable storage medium
CN111796878B (en) Resource splitting and loading method and device applied to single-page application
CN111950232B (en) Method and device for automatically switching number segments
WO2021097623A1 (en) File processing method and device, and terminal apparatus
WO2021097624A1 (en) File processing method, file processing apparatus, and terminal device
CN108549584B (en) Method and device for degrading gray level of server side
WO2021087662A1 (en) Memory allocation method and apparatus, terminal, and computer readable storage medium
WO2021097758A1 (en) Incremental package generation method, incremental package generation apparatus, and server
CN111259300B (en) Page loading method, device and system
CN110717598A (en) User distribution method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination