Grayscale release method, device, equipment and storage medium
By configuring diversified grayscale publishing strategies and dynamically analyzing user identities, the problem of inaccurate target user classification and reliance on manual adjustment in the existing technology has been solved, and more efficient and accurate grayscale publishing and intelligent interception and current limiting have been achieved, reducing costs. Manual adjustment for error risk.
Patent Information
- Application Number
- CN202010594051.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-24
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-06-24
AI Technical Summary
The existing grayscale publishing method has a coarse granularity in user target classification, and the target users obtained are not accurate enough. It relies on manual adjustment and a single strategy, has high risks and high labor costs, and lacks advanced features such as intelligent interception and current limiting.
By pre-configuring diversified grayscale publishing strategies, including multiple grayscale publishing rules and priorities, it analyzes whether the user is a target user based on user identification and policies, dynamically allocates server resources, and supports diversified strategies and intelligent interception and current limiting.
It improves the efficiency and user experience of grayscale publishing, obtains more accurate target user classification, reduces the risk of manual adjustment errors, supports diversified strategies and advanced features, and improves system stability.
Smart Images

Figure CN111736853B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of operation and maintenance technology, and in particular to a grayscale publishing method, device, electronic device and computer-readable storage medium. Background Art
[0002] Gray release, also known as canary release, refers to a release method that can smoothly transition between black and white. The specific form of gray release is to allow some users to continue to use product feature A of the Internet product (or application), and some users to start using product feature B of the Internet product (or application). If users have no objection to product feature B, then gradually expand the scope to allow more users to experience product feature B. This shows that determining the target users is particularly important for gray release.
[0003] In the existing grayscale publishing method, the user's identity (ID) carried in the data request sent by the client is subjected to a modulo operation, and the user whose remainder is a specified number is determined as the target user. Alternatively, the user in the specified area is determined as the target user based on the Internet Protocol Address (IP) of the user carried in the data request. However, these two methods have a coarse granularity for user classification, and the target users obtained are not accurate enough.
[0004] In addition, grayscale monitoring is completely dependent on manual adjustment. By arranging dedicated personnel to be on duty in real time, manual adjustment is made based on the grayscale data of the day, and the grayscale ratio is completely dependent on the calculation of management personnel. If the calculation is wrong, it will cause production failure. Due to excessive reliance on manual processing and empirical data, the grayscale ratio is not adjusted in time, the accuracy is poor, and the risk is high; the grayscale monitoring personnel have a heavy workload and high labor costs.
[0005] In addition, the existing grayscale release solution has the following disadvantages: 1. It requires operation and maintenance personnel to participate and deploy manually, which has a high probability of making mistakes; 2. The supported grayscale strategies are relatively simple and do not support a variety of grayscale strategies; 3. It does not support advanced features such as intelligent interception and current limiting. Summary of the invention
[0006] In view of the above, the present invention provides a grayscale publishing method, device, electronic device and computer-readable storage medium, the main purpose of which is to improve the efficiency of grayscale publishing.
[0007] To achieve the above object, the present invention provides a grayscale release method, which comprises:
[0008] Pre-configuring a grayscale publishing strategy for a target publishing object, the grayscale publishing strategy comprising: a plurality of grayscale publishing rules, priorities of the plurality of grayscale publishing rules, and user matching conditions corresponding to the plurality of grayscale publishing rules;
[0009] Receiving an access request sent by a user through a client, wherein the access request includes a target publishing object and a user identifier;
[0010] Analyzing whether the user is a target user of the target publishing object according to the user identifier and the grayscale publishing strategy;
[0011] When the user is a target user of the target publishing object, the first server is used as the target server corresponding to the user; when the user is not a target user of the target publishing object, the second server is used as the target server corresponding to the user; and
[0012] The access request is sent to the target server, the target data of the target publishing object fed back by the target server is received, and the target data is returned to the client.
[0013] In addition, to achieve the above-mentioned purpose, the present invention also provides a grayscale publishing device, which includes:
[0014] Configuration module, used to pre-configure the grayscale release strategy of the target release object;
[0015] A receiving module, used to receive an access request sent by a user through a client, wherein the access request includes a target publishing object and a user identifier;
[0016] A judgment module, used for analyzing whether the user is a target user of the target release object according to the user identifier and the grayscale release strategy;
[0017] a confirmation module, configured to use the first server as the target server corresponding to the user when the user is the target user of the target publishing object, and use the second server as the target server corresponding to the user when the user is not the target user of the target publishing object; and
[0018] The publishing module is used to send the access request to the target server, receive the target data of the target publishing object fed back by the target server, and return the target data to the client.
[0019] In addition, to achieve the above-mentioned purpose, the present invention also provides an electronic device, which includes: a memory and a processor, wherein the memory stores a grayscale release program that can be run on the processor, and when the grayscale release program is executed by the processor, any step in the grayscale release method described above can be implemented.
[0020] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, which includes a grayscale publishing program. When the grayscale publishing program is executed by a processor, any step in the grayscale publishing method as described above can be implemented.
[0021] The grayscale publishing method, device, electronic device and computer-readable storage medium provided by the present invention are pre-configured to support diversified grayscale publishing rules and grayscale publishing strategies. Compared with a single grayscale publishing rule, the present invention is more in line with actual needs and improves grayscale publishing efficiency and user experience. In the process of determining the target user, different target user matching conditions are called in sequence according to the priority order to determine whether the current user is the target user. The target user determined by the present invention is more representative and avoids the problem of inaccurate target users caused by the coarse granularity of target user division. When calculating the abnormal rate of the target publishing object, the present invention first calculates the abnormal rate according to the granularity of the grayscale publishing rule, and then comprehensively calculates the comprehensive abnormal rate of the target publishing object, thereby improving the accuracy of the abnormal rate of the target publishing object and improving the efficiency of grayscale publishing. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A schematic diagram of an optional application environment for each embodiment of the present invention;
[0023] Figure 2 A schematic diagram of an optional hardware architecture of the electronic device of the present invention;
[0024] Figure 3 This is a flowchart of a first embodiment of the grayscale publishing method of the present invention;
[0025] Figure 4 This is a flowchart of a second embodiment of the grayscale publishing method of the present invention;
[0026] Figure 5 It is a module schematic diagram of a preferred embodiment of the grayscale publishing device of the present invention.
[0027] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. 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.
[0029] It should be noted that the descriptions of "first", "second", etc. in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0030] Reference Figure 1 The figure shows an optional application environment diagram of each embodiment of the present invention.
[0031] In this embodiment, the present invention can be applied to an application environment including, but not limited to, a client 1, an electronic device 2, a first server 3, and a second server 4. Among them, the client 1 can be a terminal device such as a mobile phone, a smart phone, a desktop computer, a laptop computer, a PAD (tablet computer), etc. The electronic device 2 can be a terminal device with data processing function such as a server, a smart phone, a tablet computer, a portable computer, a desktop computer, etc. The first server 3 and the second server 4 can be a rack server, a blade server, a tower server or a cabinet server. The client 1, the electronic device 2, the first server 3 and the second server 4 transmit data through a network (not shown in the figure). Among them, the network can be a wireless or wired network such as an intranet, the Internet, the Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi, and a call network.
[0032] The electronic device 2 is connected to one or more clients 1 (only one is shown in the figure), the first server 3 and the second server 4 through the network 3, and each client 1 is installed and runs a client application corresponding to the electronic device 2. The client application is used to respond to the operation of the client user and create a connection between the client application and the electronic device 2, so that the client application can perform data transmission and interaction with the electronic device 2.
[0033] In this embodiment, when a grayscale publishing program 20 is installed and running in the electronic device 2, when the grayscale publishing program 20 is running, the electronic device 2 pre-configures the grayscale publishing policy of the target publishing object, detects the access request information sent by the client user, queries the grayscale publishing policy when receiving the access request information, and then determines whether the user is the target user, and sends the access request to the first server 3 or the first server 4 based on the determination result, and receives the target data returned by the first server 3 or the first server 4.
[0034] The present invention provides an electronic device 2.
[0035] Reference Figure 2 , which is a schematic diagram of an optional hardware architecture of the electronic device 2 of the present invention.
[0036] In this embodiment, the application electronic device 2 may include, but is not limited to, a memory 21, a processor 22, and a network interface 23 that can be interconnected and communicated via a system bus.
[0037] The memory 21 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 21 may be an internal storage unit of the electronic device 2, such as a hard disk of the electronic device 2. In other embodiments, the memory 21 may also be an external storage device of the electronic device 2, such as a plug-in hard disk equipped on the electronic device 2, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Further, the memory 21 may also include both an internal storage unit of the electronic device 2 and an external storage device.
[0038] The memory 21 can be used not only to store application software and various data installed in the electronic device 2, such as the grayscale publishing program 20, but also to temporarily store data that has been output or is to be output.
[0039] In some embodiments, the processor 22 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 21, such as the grayscale release program 20.
[0040] The network interface 23 may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is generally used to establish a communication connection between the electronic device 2 and other electronic devices, such as a client (not shown in the figure).
[0041] It should be pointed out that Figure 2 Only the electronic device 2 having components 21-23 is shown, and those skilled in the art will understand that Figure 2 The structure shown does not constitute a limitation on the electronic device 2 , and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0042] Optionally, the electronic device 2 may further include a user interface, which may include a display (Display) and an input unit such as a keyboard (Keyboard). The optional user interface may also include a standard wired interface and a wireless interface.
[0043] Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an organic light-emitting diode (OLED) touch device, etc. The display may also be referred to as a display screen or a display unit, which is used to display information processed in the electronic device 2 and to display a visual user interface.
[0044] exist Figure 2 In the embodiment of the electronic device 2 shown, the program code of the grayscale publishing program 20 is stored in the memory 21 as a computer storage medium, and when the processor 22 executes the program code of the grayscale publishing program 20, the following steps are implemented:
[0045] Step A1, pre-configuring a grayscale publishing strategy for a target publishing object, wherein the grayscale publishing strategy includes: a plurality of grayscale publishing rules, priorities of the plurality of grayscale publishing rules, and user matching conditions corresponding to the plurality of grayscale publishing rules.
[0046] The above-mentioned target release object can be any new software product released on the Internet, or it can be a functional module in the software product, for example, a new interface color of the software product, a new sharing function added to the application, a way to like, a way to follow friends, etc. The specific content of the new product features is not limited here.
[0047] Before grayscale publishing the target release object, the grayscale publishing manager sets a grayscale publishing strategy, which includes multiple grayscale publishing rules, multiple user matching conditions (ie, grayscale publishing scopes) and priorities.
[0048] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned grayscale release strategy, the above-mentioned grayscale release strategy can also be stored in a blockchain node.
[0049] In this embodiment, the strategy supports multiple grayscale release rules at the same time, including: switching by whitelist, switching by traffic, switching by region, and switching by organization; among which:
[0050] 1) Switch by whitelist:
[0051] Pre-set a whitelist for grayscale release. For example, if the whitelist is a list of testers, testers can be used as target users for the target release object in the whitelist. Of course, in addition to testers, online users with high loyalty to the target release object can also be used as release users for the target object in the whitelist. Users in the whitelist are given priority for grayscale release, and intelligent switching is performed based on the internal test results.
[0052] User matching condition: whitelist.
[0053] 2) Switch by traffic:
[0054] The user ratio for grayscale release is pre-set. The system will randomly assign some requests to the grayscale environment and the remaining requests to the formal environment. For example, 5% of the traffic is assigned to the grayscale environment and 95% to the formal environment.
[0055] User matching conditions: limited to old users, and the number of currently grayed-out users does not exceed 5% of the user base.
[0056] 3) Switch by region:
[0057] Pre-set the area for grayscale release, perform grayscale verification and intelligent switching based on the user's account or region;
[0058] User matching conditions: target geographic location area (determine the user's region based on the IP address and determine whether the region matches the target geographic location area).
[0059] 4) Switch by specific enterprise user (for example, organization):
[0060] Pre-set agencies for grayscale releases, for example, 211 agencies will conduct verification first, and then release to national agencies after verification.
[0061] User matching conditions: A grayscale release list generated based on specified enterprise users.
[0062] After determining the above grayscale release rules, set the priorities corresponding to the above grayscale release rules, for example, switch by whitelist > switch by traffic > switch by region > switch by organization.
[0063] According to the above different grayscale release rules, priorities and user matching conditions, the mapping relationship is determined, and the mapping data is generated and saved to the preset storage path. It should be noted that the priorities and user matching conditions of different grayscale release rules can be adjusted according to actual needs.
[0064] Step A2: receiving an access request sent by a user through a client, wherein the access request includes a target publishing object and a user identifier.
[0065] In this embodiment, a client application is installed on the client, and the current user operates the application on the client to issue an access request.
[0066] The above user identifier uniquely indicates a user. The user identifier can be the user's contact information, social account, client machine code (i.e. machine identification code, which can be obtained by hashing the machine's network card address or IMEI code, and is the identification code carried by the machine itself), user IP, and other information that can reflect the user's identity. The user identifier can also be the account information registered by the user in the application, such as the account name.
[0067] Step A3: analyzing whether the user is the target user of the target publishing object according to the user identifier and the phased publishing strategy.
[0068] After receiving the access request of the target publishing object sent by the current user, it is necessary to determine whether the user is the target user of the target publishing object. Specifically, the step of analyzing whether the user is the target user of the target publishing object according to the user identifier and the grayscale publishing strategy includes:
[0069] a1. Obtain the priority and user matching conditions corresponding to the plurality of grayscale release rules from the grayscale release strategy;
[0070] a2. Call the user matching condition corresponding to the grayscale publishing rule with the highest priority in the grayscale publishing strategy as the target user matching condition;
[0071] a3. Match the user ID and the target user matching conditions;
[0072] a4. If the match is successful, determine the target user matching conditions corresponding to the grayscale publishing rules for the target user corresponding to the grayscale publishing rules, determine the user as the target grayscale publishing rules corresponding to the target user;
[0073] a5. If the match fails, determine whether there is an uncalled user matching condition in the grayscale release strategy. If so, select the user matching condition with a priority second only to the target user matching condition as the next target user matching condition, and return to execute a3. If not, execute a6.
[0074] a6. Determine that the user is not the target user of the target publishing object.
[0075] For example, the pre-configured grayscale release strategy in step A1 includes:
[0076] Grayscale release rule X1-priority 1-user matching condition X1;
[0077] Grayscale release rule X2-priority 2-user matching condition X2;
[0078] Grayscale release rule X3-priority 3-user matching condition X3;
[0079] Grayscale release rule X4-priority 4-user matching condition X4.
[0080] According to the above mapping data, the calling order of the above matching conditions is determined as follows: user matching condition X1> user matching condition X2> user matching condition X3> user matching condition X4. In accordance with the above calling order, the target matching conditions are called in sequence to match the user ID of the current user. If the match is successful, the current user is determined to be the target user of the grayscale publishing rule corresponding to the successfully matched user matching condition, and the next step of determining the target server is executed. If the match fails, the next target matching condition is called for matching. If all user matching conditions fail to match, the current user is determined to be a non-target user.
[0081] Step A4: when the user is the target user of the target publishing object, the first server is used as the target server corresponding to the user; when the user is not the target user of the target publishing object, the second server is used as the target server corresponding to the user.
[0082] In this embodiment, the gray version data of the target publishing object is stored in the first server, and the original version data of the target publishing object is stored in the second server.
[0083] In other embodiments, the first server includes multiple servers. When determining the target server corresponding to the target user, the real-time load of each server in the first server is calculated, and the server with the smallest load is selected as the target server for the current user; similarly, the second server includes multiple servers. When determining the target server corresponding to the non-target user, the real-time load of each server in the second server is calculated, and the server with the smallest load is selected as the target server for the current user.
[0084] Step A5: sending the access request to the target server, receiving the target data of the target publishing object fed back by the target server, and returning the target data to the client.
[0085] When the target server receives the access request, it responds to the request and returns the target object data corresponding to the access request. For example, if the current user is the target user, the first target data, that is, the gray version data of the target published object, is returned; if the current user is not the target user, the second target object data, that is, the original version data of the target published object, is returned.
[0086] After receiving the returned target data, the client installs or updates it.
[0087] In other embodiments, the grayscale publishing strategy further includes: the same or different grayscale publishing contents corresponding to different grayscale publishing rules.
[0088] For example, the grayscale release rule X1 corresponds one-to-one to the grayscale release content Y1 of the application level, the grayscale release rule X3 and the grayscale release rule X4 correspond to the grayscale release content Y3 of the application level, the grayscale release rule X4 can also correspond to the grayscale release content Y2 of the application level, and the grayscale release rule X2 can also correspond to the grayscale release content Y2 of the application level.
[0089] By establishing a mapping relationship among grayscale release rules, priorities, user matching conditions, and grayscale release content, when determining the target data later, the grayscale release content corresponding to the grayscale release rules corresponding to the target user will be returned to the target user as the target data based on the mapping relationship between the grayscale release rules and the grayscale release content. No further details will be given here.
[0090] In other embodiments, when the processor 22 executes the program code of the grayscale publishing program 20, the following steps are further implemented:
[0091] Step A6, receiving feedback information sent by all target users through the client based on the target data, and calculating the abnormal rates corresponding to the multiple grayscale publishing rules in the grayscale publishing strategy according to the feedback information;
[0092] Step A7, calculating the comprehensive abnormality rate of the target publishing object based on the abnormality rates corresponding to the multiple grayscale publishing rules; and
[0093] Step A8: When the comprehensive abnormality rate of the target publishing object is less than or equal to the preset threshold, the user matching conditions corresponding to the multiple grayscale publishing rules are updated; when the comprehensive abnormality rate of the target publishing object is greater than the preset threshold, the grayscale publishing is suspended or the version is rolled back.
[0094] It is understandable that after using the gray version of the target published object, the target user will send feedback information to the target server, and the feedback information includes: service normal / service abnormal.
[0095] First, taking the grayscale release rule as the granularity, calculate the abnormal rate of the target release object corresponding to the grayscale release rule. Taking the grayscale release rule X1 as an example, obtain the feedback information of all target users corresponding to the grayscale release rule X1, and calculate the abnormal rate EX1 corresponding to the grayscale release rule X1. The calculation formula is:
[0096] EX1=NX1 / TX1
[0097] Among them, NX1 indicates the number of service anomalies for which feedback information of grayscale release rule X1 is received, and TX1 indicates the total number of target users corresponding to grayscale release rule X1. By default, services that have not received feedback information are considered normal.
[0098] Then, the corresponding weight is determined according to the priority of each grayscale release rule. For example, the weights in order from high to low priority are: 0.35, 0.3, 0.25, 0.1. The weights can be adjusted according to actual conditions.
[0099] Finally, the comprehensive anomaly rate E corresponding to each grayscale release rule is calculated comprehensively. The calculation formula is:
[0100] E=γi*EXi
[0101] Among them, γi represents the weight corresponding to the i-th grayscale release rule, and EXi represents the abnormal rate corresponding to the i-th grayscale release rule.
[0102] It is understandable that when the comprehensive anomaly rate is less than or equal to the preset threshold, it means that the gray version basically meets the needs, so the scope of gray release can be expanded, which requires updating the user matching conditions. The number of users matching the user matching conditions after the update is greater than the number of users matching the user matching conditions before the update. When the comprehensive anomaly rate is greater than the preset threshold, it means that there are obvious problems with the gray version, and you can choose to stop the gray release, re-release the gray version after the problem is resolved, or roll back the version.
[0103] The present invention also provides a grayscale publishing method, which can be executed by an electronic device, and the electronic device can be implemented by software and / or hardware.
[0104] Reference Figure 3 The figure shows a flow chart of the first embodiment of the grayscale publishing method of the present invention.
[0105] In this embodiment, the grayscale release method includes: steps S1 to S5.
[0106] Step S1, pre-configuring a grayscale publishing strategy for a target publishing object, wherein the grayscale publishing strategy includes: a plurality of grayscale publishing rules, priorities of the plurality of grayscale publishing rules, and user matching conditions corresponding to the plurality of grayscale publishing rules.
[0107] The above-mentioned target release object can be any new software product released on the Internet, or it can be a functional module in the software product, for example, a new interface color of the software product, a new sharing function added to the application, a way to like, a way to follow friends, etc. The specific content of the new product features is not limited here.
[0108] Before grayscale publishing the target release object, the grayscale publishing manager sets a grayscale publishing strategy, which includes multiple grayscale publishing rules, multiple user matching conditions (ie, grayscale publishing scopes) and priorities.
[0109] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned grayscale release strategy, the above-mentioned grayscale release strategy can also be stored in a blockchain node.
[0110] In this embodiment, the strategy supports multiple grayscale release rules at the same time, including: switching by whitelist, switching by traffic, switching by region, and switching by organization; among which:
[0111] 1) Switch by whitelist:
[0112] Pre-set a whitelist for grayscale release. For example, if the whitelist is a list of testers, testers can be used as target users for target release objects in the whitelist. Of course, in addition to testers, online users with high loyalty to the target release objects can also be used as target users for target release objects in the whitelist. Users in the whitelist are given priority for grayscale release, and intelligent switching is performed based on internal testing results.
[0113] User matching condition: whitelist.
[0114] 2) Switch by traffic:
[0115] The user ratio for grayscale release is pre-set. The system will randomly assign some requests to the grayscale environment and the remaining requests to the formal environment. For example, 5% of the traffic is assigned to the grayscale environment and 95% to the formal environment.
[0116] User matching conditions: limited to old users, and the number of currently grayed-out users does not exceed 5% of the user base.
[0117] 3) Switch by region:
[0118] Pre-set the area for grayscale release, perform grayscale verification and intelligent switching based on the user's account or region;
[0119] User matching conditions: target geographic location area (determine the user's region based on the IP address and determine whether the region matches the target geographic location area).
[0120] 4) Switch by specific enterprise user (for example, organization):
[0121] Pre-set agencies for grayscale releases, for example, 211 agencies will conduct verification first, and then release to national agencies after verification.
[0122] User matching conditions: A grayscale release list generated based on specified enterprise users.
[0123] After determining the above grayscale release rules, set the priorities corresponding to the above grayscale release rules, for example, switch by whitelist > switch by traffic > switch by region > switch by organization.
[0124] According to the above different grayscale release rules, priorities and user matching conditions, the mapping relationship is determined, and the mapping data is generated and saved to the preset storage path. It should be noted that the priorities and user matching conditions of different grayscale release rules can be adjusted according to actual needs.
[0125] Step S2: receiving an access request sent by a user through a client, wherein the access request includes a target publishing object and a user identifier.
[0126] In this embodiment, a client application is installed on the client, and the current user operates the application on the client to issue an access request.
[0127] The above user identifier uniquely indicates a user. The user identifier can be the user's contact information, social account, client machine code (i.e. machine identification code, which can be obtained by hashing the machine's network card address or IMEI code, and is the identification code carried by the machine itself), user IP, and other information that can reflect the user's identity. The user identifier can also be the account information registered by the user in the application, such as the account name.
[0128] In order to intercept malicious access requests, in other embodiments, before step S2, the grayscale publishing method further includes:
[0129] Obtaining the token information carried in the access request, and judging the legitimacy of the user token information carried in the access request;
[0130] When the user token information is legal, the access request is determined to be a legal request, and step S2 is executed; and
[0131] When the user token information is illegal, the access request is determined to be an illegal request and the access request is intercepted.
[0132] By intelligently intercepting illegal requests, the system can be protected from malicious attacks and its stability can be improved.
[0133] Step S3: analyzing whether the user is a target user of the target publishing object according to the user identifier and the grayscale publishing strategy.
[0134] After receiving the access request of the target publishing object sent by the current user, it is necessary to determine whether the user is the target user of the target publishing object. Specifically, the step of analyzing whether the user is the target user of the target publishing object according to the user identifier and the grayscale publishing strategy includes:
[0135] a1. Obtain the priority and user matching conditions corresponding to the plurality of grayscale release rules from the grayscale release strategy;
[0136] a2. Call the user matching condition corresponding to the grayscale publishing rule with the highest priority in the grayscale publishing strategy as the target user matching condition;
[0137] a3. Match the user ID and the target user matching conditions;
[0138] a4. If the match is successful, determine the target user matching conditions corresponding to the grayscale publishing rules for the target user corresponding to the grayscale publishing rules, determine the user as the target grayscale publishing rules corresponding to the target user;
[0139] a5. If the match fails, determine whether there is an uncalled user matching condition in the grayscale release strategy. If so, select the user matching condition with a priority second only to the target user matching condition as the next target user matching condition, and return to execute a3. If not, execute a6.
[0140] a6. Determine that the user is not the target user of the target publishing object.
[0141] For example, the grayscale release strategy pre-configured in step S1 includes:
[0142] Grayscale release rule X1-priority 1-user matching condition X1;
[0143] Grayscale release rule X2-priority 2-user matching condition X2;
[0144] Grayscale release rule X3-priority 3-user matching condition X3;
[0145] Grayscale release rule X4-priority 4-user matching condition X4.
[0146] According to the above mapping data, the calling order of the above matching conditions is determined as follows: user matching condition X1> user matching condition X2> user matching condition X3> user matching condition X4. In accordance with the above calling order, the target matching conditions are called in sequence to match the user ID of the current user. If the match is successful, the current user is determined to be the target user of the grayscale publishing rule corresponding to the successfully matched user matching condition, and the next step of determining the target server is executed. If the match fails, the next target matching condition is called for matching. If all user matching conditions fail to match, the current user is determined to be a non-target user.
[0147] Step S4: when the user is the target user of the target publishing object, the first server is used as the target server corresponding to the user; when the user is not the target user of the target publishing object, the second server is used as the target server corresponding to the user.
[0148] In this embodiment, the gray version data of the target publishing object is stored in the first server, and the original version data of the target publishing object is stored in the second server.
[0149] In other embodiments, the first server includes multiple servers. When determining the target server corresponding to the target user, the real-time load of each server in the first server is calculated, and the server with the smallest load is selected as the target server for the current user; similarly, the second server includes multiple servers. When determining the target server corresponding to the non-target user, the real-time load of each server in the second server is calculated, and the server with the smallest load is selected as the target server for the current user.
[0150] Step S5: sending the access request to the target server, receiving the target data of the target publishing object fed back by the target server, and returning the target data to the client.
[0151] When the target server receives the access request, it responds to the request and returns the target object data corresponding to the access request. For example, if the current user is the target user, the first target data, that is, the gray version data of the target published object, is returned; if the current user is not the target user, the second target object data, that is, the original version data of the target published object, is returned.
[0152] After receiving the returned target data, the client installs or updates it.
[0153] In order to further improve the efficiency of the grayscale release, in other embodiments, sending the access request to the target server includes:
[0154] Calculating the comprehensive load rate of the target server in real time, and obtaining a load rate threshold of the target server, wherein the load rate threshold is related to the number of servers; and
[0155] When the comprehensive load rate exceeds the load rate threshold, capacity expansion prompt information is generated and fed back to the preset terminal.
[0156] Among them, the above-mentioned preset terminal is a terminal device used by operation and maintenance personnel, and is used by the operation and maintenance personnel to expand the capacity of the server after receiving the expansion prompt information.
[0157] In this embodiment, different numbers of servers correspond to different load rate thresholds. For example, taking the target server as the first server, when the number of first servers is 1, the load rate threshold is 80%, when the number of first servers is 2, the load rate threshold is 85%, when the number of first servers is 3, the load rate threshold is 90%, when the number of first servers is 4, the load rate threshold is 95%, ... By setting different load rate thresholds and traffic monitoring, the expansion reminder is more in line with the actual situation, and the expansion reminder can be issued in a timely manner to ensure system stability.
[0158] In other embodiments, the grayscale publishing strategy further includes: the same or different grayscale publishing contents corresponding to different grayscale publishing rules.
[0159] For example, the grayscale release rule X1 corresponds one-to-one to the grayscale release content Y1 of the application level, the grayscale release rule X3 and the grayscale release rule X4 correspond to the grayscale release content Y3 of the application level, the grayscale release rule X4 can also correspond to the grayscale release content Y2 of the application level, and the grayscale release rule X2 can also correspond to the grayscale release content Y2 of the application level.
[0160] By establishing a mapping relationship among grayscale release rules, priorities, user matching conditions, and grayscale release content, when determining the target data later, the grayscale release content corresponding to the grayscale release rules corresponding to the target user will be returned to the target user as the target data based on the mapping relationship between the grayscale release rules and the grayscale release content. No further details will be given here.
[0161] like Figure 4 , which is a flow chart of the second embodiment of the grayscale publishing method of the present invention.
[0162] In this embodiment, the grayscale release method includes steps S1 to S8, wherein the specific implementation of steps S1 to S5 is substantially the same as that of the first embodiment, and will not be described in detail here.
[0163] Step S6, receiving feedback information sent by all target users through the client based on the target data, and calculating the abnormal rates corresponding to the multiple grayscale publishing rules in the grayscale publishing strategy according to the feedback information;
[0164] Step S7, calculating the comprehensive abnormality rate of the target publishing object based on the abnormality rates corresponding to the multiple grayscale publishing rules; and
[0165] Step S8, when the comprehensive anomaly rate of the target publishing object is less than or equal to the preset threshold, update the user matching conditions corresponding to the multiple grayscale publishing rules; when the comprehensive anomaly rate of the target publishing object is greater than the preset threshold, suspend the grayscale publishing or perform a version rollback.
[0166] It is understandable that after using the gray version of the target published object, the target user will send feedback information to the target server, and the feedback information includes: service normal / service abnormal.
[0167] First, taking the grayscale release rule as the granularity, calculate the abnormal rate of the target release object corresponding to the grayscale release rule. Taking the grayscale release rule X1 as an example, obtain the feedback information of all target users corresponding to the grayscale release rule X1, and calculate the abnormal rate EX1 corresponding to the grayscale release rule X1. The calculation formula is:
[0168] EX1=NX1 / TX1
[0169] Among them, NX1 indicates the number of service anomalies for which feedback information of grayscale release rule X1 is received, and TX1 indicates the total number of target users corresponding to grayscale release rule X1. By default, services that have not received feedback information are considered normal.
[0170] Then, the corresponding weight is determined according to the priority of each grayscale release rule. For example, the weights in order from high to low priority are: 0.35, 0.3, 0.25, 0.1. The weights can be adjusted according to actual conditions.
[0171] Finally, the comprehensive anomaly rate E corresponding to each grayscale release rule is calculated comprehensively. The calculation formula is:
[0172] E=γi*EXi
[0173] Among them, γi represents the weight corresponding to the i-th grayscale release rule, and EXi represents the abnormal rate corresponding to the i-th grayscale release rule.
[0174] It is understandable that when the comprehensive anomaly rate is less than or equal to the preset threshold, it means that the gray version basically meets the needs, so the scope of gray release can be expanded, which requires updating the user matching conditions. The number of users matching the user matching conditions after the update is greater than the number of users matching the user matching conditions before the update. When the comprehensive anomaly rate is greater than the preset threshold, it means that there are obvious problems with the gray version, and you can choose to stop the gray release, re-release the gray version after the problem is resolved, or roll back the version.
[0175] The grayscale publishing method provided in the above embodiment is pre-configured to support diversified grayscale publishing rules and grayscale publishing strategies. Compared with a single grayscale publishing rule, the present invention is more in line with actual needs and improves grayscale publishing efficiency and user experience; in the process of determining the target user, different target user matching conditions are called in sequence according to the priority order to determine whether the current user is the target user. The target user determined by the present invention is more representative and avoids the problem of inaccurate target users caused by the coarse granularity of target user division; when calculating the abnormality rate of the target publishing object, the present invention first calculates the abnormality rate according to the granularity of the grayscale publishing rule, and then comprehensively calculates the comprehensive abnormality rate of the target publishing object, thereby improving the accuracy of the abnormality rate of the target publishing object and improving the efficiency of grayscale publishing.
[0176] The present invention also provides a grayscale publishing device.
[0177] Reference Figure 5 The figure is a module diagram of a preferred embodiment of the grayscale publishing device of the present invention.
[0178] The grayscale publishing device 10 of this embodiment may include modules 110 to 150 according to the functions to be implemented. The module described in this invention may also be called a unit, which refers to a series of computer program segments that can be executed by a processor of an electronic device and can complete fixed functions, and is stored in the memory of the electronic device.
[0179] In one embodiment of the grayscale publishing device 10 of the present invention, the functions of each module / unit are as follows:
[0180] Configuration module 110, used to pre-configure the grayscale release strategy of the target release object;
[0181] The receiving module 120 is used to receive an access request sent by a user through a client, wherein the access request includes a target publishing object and a user identifier;
[0182] A judgment module 130, configured to analyze whether the user is a target user of the target publishing object according to the user identifier and the grayscale publishing strategy;
[0183] A confirmation module 140 is used to use the first server as the target server corresponding to the user when the user is the target user of the target publishing object, and use the second server as the target server corresponding to the user when the user is not the target user of the target publishing object; and
[0184] The publishing module 150 is used to send the access request to the target server, receive the target data of the target publishing object fed back by the target server, and return the target data to the client.
[0185] The functions or operation steps implemented by the modules 110-150 are similar to those described above and will not be described in detail here.
[0186] In addition, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium includes a grayscale publishing program 20, and when the grayscale publishing program 20 is executed by a processor, any step of the grayscale publishing method is implemented. The specific implementation of the computer-readable storage medium of the present invention is substantially the same as the above-mentioned method embodiment, and will not be repeated here.
[0187] Furthermore, if the module / unit integrated in the electronic device 2 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-usable storage medium can store an operating system and an application required for at least one function, for example, a grayscale release program 20. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).
[0188] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0189] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.
[0190] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0191] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0192] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A grayscale publishing method, applicable to electronic equipment, characterized in that: The method includes: Pre-configure a grayscale release strategy for a target release object, the grayscale release strategy including: multiple grayscale release rules, priorities of the multiple grayscale release rules, and user matching conditions corresponding to the multiple grayscale release rules, the multiple grayscale release rules including switching by whitelist, switching by traffic, switching by region, and switching by organization, the priorities corresponding to the multiple grayscale release rules are switching by whitelist>switching by traffic>switching by region>switching by organization, and the organization is an enterprise user; Receiving an access request sent by a user through a client, wherein the access request includes a target publishing object and a user identifier; Analyzing whether the user is a target user of the target publishing object according to the user identifier and the grayscale publishing strategy; When the user is the target user of the target publishing object, the first server is used as the target server corresponding to the user, and when the user is not the target user of the target publishing object, the second server is used as the target server corresponding to the user; and Sending the access request to the target server, receiving the target data of the target publishing object fed back by the target server, and feeding back the target data to the client; Wherein, analyzing whether the user is the target user of the target publishing object according to the user identifier and the grayscale publishing strategy includes: a1. obtaining the priorities and user matching conditions corresponding to the multiple grayscale publishing rules from the grayscale publishing strategy; a2. calling the user matching condition corresponding to the grayscale publishing rule with the highest priority in the grayscale publishing strategy as the target user matching condition; a3. matching the user identifier and the target user matching condition; a4. if the match is successful, determining that the grayscale publishing rule corresponding to the target user matching condition is the target grayscale publishing rule corresponding to the user, and determining that the user is the target user corresponding to the target grayscale publishing rule; a5. if the match fails, determining whether there is an uncalled user matching condition in the grayscale publishing strategy, and if so, selecting the user matching condition with the priority second only to the target user matching condition as the next target user matching condition, and returning to execute a3, if not, executing a6; a6. determining that the user is not the target user of the target publishing object; The sending of the access request to the target server includes: calculating the comprehensive load rate of the target server in real time, and obtaining a load rate threshold of the target server, wherein the load rate threshold is related to the number of servers; and when the comprehensive load rate exceeds the load rate threshold, generating capacity expansion prompt information and feeding it back to a preset terminal; The method further includes: receiving feedback information sent by all target users through the client based on the target data, and calculating the abnormal rates corresponding to the multiple grayscale publishing rules in the grayscale publishing strategy according to the feedback information; calculating the comprehensive abnormal rate of the target publishing object based on the abnormal rates corresponding to the multiple grayscale publishing rules; and when the comprehensive abnormal rate of the target publishing object is less than or equal to a preset threshold, updating the user matching conditions corresponding to the multiple grayscale publishing rules; when the comprehensive abnormal rate of the target publishing object is greater than the preset threshold, suspending the grayscale publishing or performing a version rollback; The calculation process of the comprehensive abnormality rate includes: first, taking the grayscale release rule as the granularity, calculating the abnormality rate of the target release object corresponding to the grayscale release rule, obtaining the feedback information of all target users corresponding to the grayscale release rule, and calculating the abnormality rate EXi corresponding to the grayscale release rule. The calculation formula is: EXi=NXi / TXi Among them, NXi indicates that the feedback information of the grayscale release rule Xi is the number of service anomalies, and TXi indicates the total number of target users corresponding to the grayscale release rule Xi; Then, the corresponding weight is determined according to the priority of each grayscale release rule; Finally, the comprehensive anomaly rate E corresponding to each grayscale release rule is calculated comprehensively. The calculation formula is: E=γi*EXi Among them, γi represents the weight corresponding to the i-th grayscale release rule, EXi represents the abnormal rate corresponding to the i-th grayscale release rule, and Xi represents the i-th grayscale release rule.
2. The grayscale release method according to claim 1, characterized in that: The first server stores the gray version data of the target publishing object, and the second server stores the original version data of the target publishing object.
3. The grayscale release method according to any one of claims 1 to 2, characterized in that: The grayscale release strategy also includes: the same or different grayscale release contents corresponding to different grayscale release rules.
4. The grayscale release method according to any one of claims 1 to 2, characterized in that: Before receiving the access request sent by the user through the client, the method further includes: Obtaining the token information carried in the access request, and judging the legitimacy of the user token information carried in the access request; When the user token information is legal, determining that the access request is a legal request, and receiving the access request sent by the user through the client; and When the user token information is illegal, the access request is determined to be an illegal request and the access request is intercepted.
5. A grayscale publishing device, used to implement the grayscale publishing method according to any one of claims 1 to 4, characterized in that: The device includes: Configuration module, used to pre-configure the grayscale release strategy of the target release object; A receiving module, used to receive an access request sent by a user through a client, wherein the access request includes a target publishing object and a user identifier; A judgment module, used for analyzing whether the user is a target user of the target release object according to the user identifier and the grayscale release strategy; a confirmation module, configured to use the first server as the target server corresponding to the user when the user is the target user of the target publishing object, and use the second server as the target server corresponding to the user when the user is not the target user of the target publishing object; and The publishing module is used to send the access request to the target server, receive the target data of the target publishing object fed back by the target server, and return the target data to the client.
6. An electronic device, characterized in that: The device includes a memory and a processor, wherein the memory stores a grayscale publishing program that can be run on the processor, and when the grayscale publishing program is executed by the processor, the grayscale publishing method as described in any one of claims 1 to 4 is implemented.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a grayscale publishing program, and when the grayscale publishing program is executed by a processor, the grayscale publishing method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Grayscale release control method, device and equipment and storage medium
CN107864175A
Gray release method and system based on user identification, a medium and equipment
CN109871224A
Gray release method and processing method thereof, node, system and storage device
CN110661835A
