Gray scale test method and apparatus, computer program product, electronic device
By receiving client requests, matching and controlling the gray-scale function configuration table, the problem of insufficient gray-scale testing scope is solved, achieving precise gray-scale testing control and an automated, seamless gaming experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NETEASE (HANGZHOU) NETWORK CO LTD
- Filing Date
- 2026-02-11
- Publication Date
- 2026-06-09
Smart Images

Figure CN122173395A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a grayscale testing method and apparatus, computer program products, and electronic devices. Background Technology
[0002] Gray-scale testing refers to a testing method where new features, content, or versions of a game are rolled out to a limited number of target users during an update. Common gray-scale testing methods include: supporting random selection of players, supporting blacklist / whitelist gray-scale testing, and supporting tiered gray-scale testing across different device models.
[0003] However, grayscale testing methods in related technologies lack diversity and specificity in their testing scope, and are unable to perform grayscale testing on complex logical combinations. Summary of the Invention
[0004] This disclosure provides a grayscale testing method to at least partially address the problems of insufficient diversity and specificity in related technologies.
[0005] According to a first aspect of this disclosure, a grayscale testing method is provided, applied to a server, the method comprising: Receive a grayscale test request sent by the client, read the grayscale function configuration table, match the grayscale test request with the grayscale function configuration table, and determine the target grayscale function corresponding to the grayscale test request; Based on the grayscale function data of the target grayscale function, grayscale control is performed on the client to obtain the grayscale control result of the client; The grayscale control result is sent to the client so that the client can determine to start the grayscale test corresponding to the target grayscale function based on the grayscale control result.
[0006] According to a second aspect of this disclosure, a grayscale testing method is provided, applied to a client, the method comprising: In response to the launch of the target application, load the first grayscale control result stored locally during the previous login of the current login, and determine to perform grayscale testing of the target grayscale function corresponding to the first grayscale control result based on the first grayscale control result. Generate grayscale request data, send the grayscale request data to the server, receive the second grayscale control result corresponding to the grayscale request data sent by the server, and store the second grayscale control result locally so that when the target application is restarted, the second grayscale control result is loaded and the corresponding grayscale test is executed according to the second grayscale control.
[0007] According to a third aspect of this disclosure, a grayscale testing device is provided for use on a server, the device comprising: The grayscale function matching module is used to receive grayscale test requests sent by the client, read the grayscale function configuration table, match the grayscale test request with the grayscale function configuration table, and determine the target grayscale function corresponding to the grayscale test request. A grayscale function control module is used to perform grayscale control on the client based on the grayscale function data of the target grayscale function, and obtain the grayscale control result of the client. A grayscale control result sending module is used to send the grayscale control result to the client, so that the client determines to start the grayscale test corresponding to the target grayscale function based on the grayscale control result.
[0008] According to a fourth aspect of this disclosure, a grayscale testing apparatus is provided for use on a client side, the apparatus comprising: The grayscale test initiation module is used to respond to the startup of the target application, load the first grayscale control result stored locally during the last login, and determine the grayscale test to be performed on the target grayscale function corresponding to the first grayscale control result based on the first grayscale control result. The grayscale control result storage module is used to generate grayscale request data, send the grayscale request data to the server, receive the second grayscale control result corresponding to the grayscale request data sent by the server, and store the second grayscale control result locally so that when the target application is restarted, the second grayscale control result is loaded and the corresponding grayscale test is executed according to the second grayscale control.
[0009] According to a fifth aspect of this disclosure, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method of the first aspect described above and possible implementations thereof.
[0010] According to a sixth aspect of this disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method of the first aspect and possible implementations thereof by executing the executable instructions.
[0011] This disclosure provides a grayscale testing method that receives a grayscale test request from a client, reads a grayscale function configuration table, matches the grayscale test request with the grayscale function configuration table to determine the target grayscale function corresponding to the grayscale test request, performs grayscale control on the client based on the grayscale function data of the target grayscale function to obtain the grayscale control result of the client, and sends the grayscale control result to the client so that the client determines to start the grayscale test corresponding to the target grayscale function based on the grayscale control result. On the one hand, the gray-scale strategy is configured through a gray-scale function configuration table, which enables complex gray-scale testing logic and solves the problems of insufficient diversity and specificity in the scope of gray-scale testing in related technologies. On the other hand, after matching and determining the target gray-scale function corresponding to the gray-scale test request, gray-scale control is performed on the client to obtain the corresponding gray-scale control result, achieving precise control over the gray-scale test scope. Furthermore, after obtaining the gray-scale control result, it is sent to the client to ensure that each client only obtains its own matched gray-scale configuration, rather than the full gray-scale function configuration table, reducing data transmission volume and avoiding interference from irrelevant gray-scale function configurations with client logic. At the same time, after receiving the gray-scale control result, the client determines to start the gray-scale test corresponding to the target gray-scale function based on the gray-scale control result. The entire process is fully automated, and the opening / closing of gray-scale functions is imperceptible to players, avoiding the impact of gray-scale operations on the normal gameplay experience. Attached Figure Description
[0012] Figure 1 A flowchart illustrating a grayscale testing method in this exemplary embodiment is shown; Figure 2 This exemplary embodiment shows a method flowchart for matching the grayscale test request with the grayscale function configuration table to determine the target grayscale function corresponding to the grayscale test request; Figure 3 This illustration shows a schematic diagram of sorting grayscale function data with the same name in this exemplary embodiment; Figure 4 This example illustrates a flowchart of a method for traversing first grayscale function data in this exemplary embodiment; Figure 5 This exemplary embodiment illustrates a method flowchart for determining grayscale control logic based on the type of the grayscale range, performing grayscale control according to the grayscale control logic, and obtaining the grayscale control result of the client. Figure 6 This diagram illustrates a server-side grayscale test in this exemplary embodiment. Figure 7A flowchart illustrating a grayscale testing method in this exemplary embodiment is shown; Figure 8 This illustration shows a schematic diagram of a client performing a grayscale test in this exemplary embodiment; Figure 9 A block diagram of a grayscale testing apparatus in this exemplary embodiment is shown; Figure 10 A block diagram of a grayscale testing apparatus in this exemplary embodiment is shown; Figure 11 A schematic diagram of the structure of an electronic device in this exemplary embodiment is shown. Detailed Implementation
[0013] Exemplary embodiments of this disclosure will be described more fully below with reference to the accompanying drawings.
[0014] The accompanying drawings are schematic illustrations of this disclosure and are not necessarily drawn to scale. Some block diagrams shown in the drawings may be functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in hardware modules or integrated circuits, or in networks, processors, or microcontrollers. Implementations can be carried out in various forms and should not be construed as limited to the examples set forth herein. The features, structures, or characteristics described in this disclosure can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough description of embodiments of this disclosure. However, those skilled in the art will recognize that one or more specific details may be omitted when implementing the technical solutions of this disclosure, or other methods, components, apparatuses, steps, etc., may be used to replace one or more specific details.
[0015] Gray-scale testing refers to a testing method where new features, content, or versions of a game are rolled out to a limited number of target users during an update. Common gray-scale testing methods include: supporting random selection of players, supporting blacklist / whitelist gray-scale testing, and supporting tiered gray-scale testing across different device models.
[0016] However, grayscale testing methods in related technologies lack diversity and specificity in their testing scope, and are unable to perform grayscale testing on complex logical combinations.
[0017] In view of the above problems, an exemplary embodiment of this disclosure provides a grayscale testing method. Referring to 1, the grayscale testing method may include the following steps: Step S110: Receive the grayscale test request sent by the client, read the grayscale function configuration table, match the grayscale test request with the grayscale function configuration table, and determine the target grayscale function corresponding to the grayscale test request. Step S120: Perform grayscale control on the client based on the grayscale function data of the target grayscale function to obtain the grayscale control result of the client; Step S130: Send the grayscale control result to the client so that the client can determine to start the grayscale test corresponding to the target grayscale function based on the grayscale control result.
[0018] In the above grayscale testing method, a grayscale test request sent by the client is received, a grayscale function configuration table is read, the grayscale test request is matched with the grayscale function configuration table to determine the target grayscale function corresponding to the grayscale test request, grayscale control is performed on the client based on the grayscale function data of the target grayscale function to obtain the grayscale control result of the client, and the grayscale control result is sent to the client so that the client determines to start the grayscale test corresponding to the target grayscale function according to the grayscale control result. On the one hand, the gray-scale strategy is configured through a gray-scale function configuration table, which enables complex gray-scale testing logic and solves the problems of insufficient diversity and specificity in the scope of gray-scale testing in related technologies. On the other hand, after matching and determining the target gray-scale function corresponding to the gray-scale test request, gray-scale control is performed on the client to obtain the corresponding gray-scale control result, achieving precise control over the gray-scale test scope. Furthermore, after obtaining the gray-scale control result, it is sent to the client to ensure that each client only obtains its own matched gray-scale configuration, rather than the full gray-scale function configuration table, reducing data transmission volume and avoiding interference from irrelevant gray-scale function configurations with client logic. At the same time, after receiving the gray-scale control result, the client determines to start the gray-scale test corresponding to the target gray-scale function based on the gray-scale control result. The entire process is fully automated, and the opening / closing of gray-scale functions is imperceptible to players, avoiding the impact of gray-scale operations on the normal gameplay experience.
[0019] The following will provide further explanation and description of steps S110-S130.
[0020] In step S110, a grayscale test request sent by the client is received, the grayscale function configuration table is read, the grayscale test request is matched with the grayscale function configuration table, and the target grayscale function corresponding to the grayscale test request is determined.
[0021] Before logging into the game, the client requests the server to obtain the status of the gray-scale testing feature. The server receives the gray-scale testing request from the client, which includes the device model, system platform, virtual object identifier, game channel identifier, login credentials, etc. This disclosure does not specifically limit the request data included in the gray-scale testing request. After receiving the gray-scale testing request, the server can perform validity checks on the request data included in the gray-scale testing request. When the check fails, it uniformly returns all default settings to avoid functional abnormalities caused by the client having no return value. The validity check may include checking the number and length of parameters included in the request data, etc., and this disclosure does not specifically limit the validity check.
[0022] Once the verification passes, the server first reads the cached grayscale feature configuration table. If it's not cached, it reads the PostgreSQL database to retrieve the information from the grayscale feature configuration table and loads it into the cache. The game server's grayscale strategy relies on the grayscale feature configuration table. For each request from the client, the server's matching algorithm matches the client's grayscale test request with the grayscale feature configuration table one by one to determine the target grayscale feature corresponding to the grayscale test request.
[0023] In one implementation, the grayscale function configuration table includes multiple grayscale function data entries, each of which includes at least a grayscale function name, configuration information, matching priority, and grayscale range. Wherein: The grayscale function name is a string that identifies different grayscale functions. Each grayscale function can be defined by one or more grayscale function data entries.
[0024] The `device_info` configuration information is in JSON string format, used for canary deployments. The corresponding canary deployment will only be enabled if the client's canary deployment test request data matches it. `device_info` supports configuring various information, such as device, platform, and channel, allowing for flexible control over the granularity of the canary deployment. If the configuration is empty (`{}`), the canary deployment can be enabled for all players, or a player's character ID can be configured to enable the canary deployment only for that player. Each configuration in `device_info` is an AND operation; that is, the client's parameters must simultaneously satisfy the configuration of each field in the JSON structure to be considered a match. For example, `device_info: { "platform":" IOS ", "channel":"netease"}` means that the canary deployment will be enabled when the client's device platform is iOS and the channel is netease. Defining multiple grayscale feature data entries with the same name (name) can achieve the "OR" function. For example, when the client's device platform is iOS or Android, to enable the newAgeAlert grayscale feature, two configuration data entries named newAgeAlert can be defined, with device_info as { "platform":" IOS "} and { "platform":" Android"}, respectively.
[0025] The matching priority is a positive integer, starting from 0, with smaller numbers indicating higher priority. Priority is primarily used to differentiate the matching priority of multiple grayscale feature records with the same name. The composite primary key of this grayscale feature configuration table is `name` and `priority`, meaning that multiple grayscale feature records with the same name need to have different priorities.
[0026] The `scope` parameter, a string type, allows you to specify either a percentage or a quantity. The server will categorize the `scope` parameter using a regular expression matching algorithm. If `scope` is a percentage, the server will control the number of players enabling the grayscale feature according to the specified percentage. If `scope` is a number, it represents a specific quantity within the grayscale range, with the unit of grayscale quantity being 1. This allows for precise control over the number of grayscale instances.
[0027] In one optional implementation, the grayscale function configuration table may further include a returned value `value` and a default value. `value` and `default_value` are the grayscale control results returned by the server to the client, and are integers. When the client's grayscale test request data contains the configuration fields in `device_info` and the corresponding values are equal, it is considered a successful match, and `value` is returned to the client. Otherwise, if any field does not match the configuration field, it is considered a failed match, and `default_value` is returned. The value of `value` can be 1, and the value of `default_value` can be 0; this disclosure does not impose specific limitations on these values. The server will return either `value` or `default_value` based on the matching result. Whether to enable the grayscale test corresponding to the grayscale function is determined by the client based on the returned value.
[0028] refer to Figure 2 As shown, the step of matching the grayscale test request with the grayscale function configuration table to determine the target grayscale function corresponding to the grayscale test request includes: Step S210: Traverse the configuration information and match the grayscale test request with the configuration information; Step S220: When the request data of the grayscale test request completely includes the configuration information and the value of the corresponding field of the configuration information is completely equal to that of the request data, the grayscale function corresponding to the configuration information is determined as the target grayscale function.
[0029] The following will further explain and illustrate steps S210 and S220. Specifically, the server iterates through the configuration information in each piece of grayscale function data and matches the request data included in the grayscale test request with the configuration information in each piece of grayscale function data. When the grayscale test request data completely includes the configuration information in any piece of grayscale function data and the values of the fields corresponding to the request data and the configuration information are completely equal, the grayscale function corresponding to the configuration information is determined as the target grayscale function.
[0030] For example, if the grayscale function name is newAgeAlert, and the configuration information corresponding to the grayscale function is device_info:{"platform":"IOS","channel":"netease"}, when the client's device platform is IOS and the channel is netease, the grayscale function corresponding to the grayscale function name newAgeAlert is determined to be the target grayscale function.
[0031] In one implementation, before matching the grayscale test request with the grayscale function configuration table, the method further includes: Determine whether there are multiple first grayscale function data entries with the same grayscale function name in the grayscale function configuration table; When they exist, the multiple grayscale function data with the same grayscale function name are sorted according to the matching priority in the first grayscale function data.
[0032] Specifically, first, it is determined whether there are multiple first grayscale function data entries with the same name in the grayscale function configuration table. If the grayscale function configuration table includes multiple first grayscale function data entries with the same name, these multiple first grayscale function data entries are sorted according to their matching priority. The matching priority of grayscale function data starts from 0, with smaller numbers indicating higher matching priority.
[0033] For example, refer to Figure 3 As shown, the grayscale function configuration table includes three grayscale functions, named N1, N2, and N3. N2 and N3 each contain multiple grayscale function records. The server sorts these records according to matching priority; for grayscale functions with the same name, the sorting order from left to right reflects the highest to lowest matching priority. During the traversal matching, the configuration information of each grayscale function record is iterated from left to right.
[0034] In one implementation, reference Figure 4 As shown, the method further includes: Step S410: Prioritize traversing the first grayscale function data with the highest matching priority, and match the configuration information in the first grayscale function data with the highest matching priority with the request data; Step S420: When a match is successful, the grayscale function corresponding to the first grayscale function data with the highest matching priority is determined as the target grayscale function, and the second grayscale function data is traversed; wherein, the second grayscale function data is data in the grayscale function configuration table whose grayscale function name is different from that of the first grayscale function data. Step S430: If the matching fails, the first grayscale function data is traversed sequentially according to the sorting until the grayscale function data that matches the request data is determined.
[0035] The following will further explain and illustrate steps S410-S430. Specifically, after sorting the multiple first grayscale function data, the configuration information of the first grayscale function data ranked first is traversed. That is, for first grayscale function data with the same grayscale function name, the traversal starts from the configuration information of the first grayscale function data with the highest matching priority. The configuration information of the first grayscale function data with the highest matching priority is matched with the request data of the grayscale test request. When the configuration information of the first grayscale function data with the highest matching priority completely matches the request data, the grayscale function corresponding to the first grayscale function data with the highest matching priority is determined as the target grayscale function, and the traversal of other grayscale function data in the first grayscale function data is stopped. The second grayscale function data in the grayscale function configuration table is traversed. The second grayscale function data is the grayscale function data in the grayscale function configuration table with a different grayscale function name than the first grayscale function data and which has not been traversed. When the first grayscale function data with the highest matching priority does not match the request data, the first grayscale function data is traversed sequentially according to the sorting order until the grayscale function data that completely matches the request data is obtained.
[0036] In this disclosure, grayscale feature data with the same name are sorted according to matching priority. When the grayscale feature data with the highest matching priority matches the request data of the grayscale test request, only the grayscale feature corresponding to the grayscale feature data with the highest matching priority is determined as the target grayscale feature. This reduces the time cost of server traversal and minimizes the impact on client login. Furthermore, when the matching priority of grayscale feature data needs to be modified after deployment, it can be updated through a hot-update configuration table without updating the client code.
[0037] In step S120, grayscale control is performed on the client based on the grayscale function data of the target grayscale function to obtain the grayscale control result of the client.
[0038] After identifying the target grayscale function that matches the request data of the client's grayscale test request, the server can perform grayscale control on the target grayscale function to achieve precise management of clients that have enabled the grayscale function. When performing grayscale control on the client, the control can be based on the grayscale range. The grayscale range can be a percentage or any integer; this disclosure does not specifically limit the grayscale range.
[0039] In one implementation, the grayscale control of the client based on the grayscale function data of the target grayscale function to obtain the grayscale control result of the client includes: Determine the type of the grayscale range in the grayscale function data, determine the grayscale control logic based on the type of the grayscale range, perform grayscale control based on the grayscale control logic, and obtain the grayscale control result of the client.
[0040] Specifically, when performing grayscale control on the client, the grayscale control logic for the client can be determined based on the type of grayscale range in the grayscale function data of the target grayscale function. After determining the grayscale control logic for the client, grayscale control is performed on the client according to the grayscale control logic to obtain the grayscale control result.
[0041] In one implementation, when the grayscale range type is percentage, refer to Figure 5 As shown, the step of determining grayscale control logic based on the type of the grayscale range, performing grayscale control according to the grayscale control logic, and obtaining the grayscale control result of the client includes: Step S510: Concatenate the virtual object identifier corresponding to the client with the grayscale function name of the target grayscale function, perform hash calculation, and take the modulo of the hash calculation result to obtain the first comparison value; Step S520: When the first comparison value is less than the grayscale range, determine that the grayscale control result is to enable the target grayscale function for the client; otherwise, do not enable the target grayscale function.
[0042] The following will further explain and illustrate steps S510 and S520. Specifically, when the grayscale range type is a percentage, grayscale ratio control is performed on the client. The identifier of the virtual object controlled by the client player and the grayscale function name of the target grayscale function are obtained. The virtual object identifier and the grayscale function name of the target grayscale function are concatenated, and a hash calculation is performed on the concatenated data to obtain the calculation result. Then, the target value is moduloed by the calculation result to obtain a first comparison value. The target value can be 100; this disclosure does not specifically limit the target value. The obtained first comparison value is a number between 0 and 99. The first comparison value is compared with the percentage value of the grayscale range. If the first comparison value is less than the percentage value of the grayscale range, the grayscale control result is determined to be that the target grayscale function is enabled on the client, and a value is returned to the client; otherwise, the target grayscale function is not enabled, and a default_value is returned to the client.
[0043] In this disclosure, since each player's virtual object identifier is a UUID, which is uniformly distributed, the uniformity of hash calculation results can be guaranteed. By concatenating the virtual object identifier with the grayscale function name, the grayscale function name acts as the salt for the hash calculation, ensuring that the same player has different hash calculation results for different grayscale functions. This ensures that different grayscale functions are independent and do not affect each other, allowing the same player to participate in multiple grayscale function tests simultaneously, with the activation status of each grayscale function determined individually by the player's hash result under that configuration. Each player's UUID remains unchanged, ensuring that players who have already enabled the grayscale function will continue to enable it after the grayscale range is expanded. New players will be added to the grayscale range proportionally based on their hash results, thus achieving a smooth grayscale expansion and avoiding abrupt changes in player experience.
[0044] In one implementation, when the grayscale range type is quantity, the step of determining grayscale control logic based on the grayscale range type, performing grayscale control based on the grayscale control logic, and obtaining the grayscale control result of the client includes: Obtain the data bitmap corresponding to the target grayscale function and the first number of the target grayscale function that has been enabled stored in the data bitmap. When the first number is less than the target number, determine that the grayscale control result is to enable the target grayscale function for the client.
[0045] Specifically, when the grayscale range type is quantity, a data bitmap corresponding to the target grayscale function is obtained. This data bitmap records the number of clients that have enabled the target grayscale function and the enabling status of each client. After obtaining the data bitmap, the number of clients that have enabled the target grayscale function and the enabling status of each client can be obtained. When the first number of clients that have enabled the target grayscale function in the data bitmap is less than the target number of the grayscale range, the grayscale control result is determined to be enabling the target grayscale function for the client, and the client's data is recorded in the data bitmap to complete the update of the data bitmap, ensuring that clients that have already enabled the target grayscale function are not counted repeatedly. The data bitmap can be a Redis bitmap, and this disclosure does not specifically limit it.
[0046] In this disclosure, a data bitmap is used to record the number of clients that have enabled the target grayscale function and the enabling status of each client. Since the data bitmap only includes two states, 0 and 1, where 0 represents that the target grayscale function is not enabled and 1 represents that the target grayscale function is enabled, when the target grayscale function is enabled for a client multiple times, the bitmap data corresponding to that client will always be 1, ensuring that the client will not be counted repeatedly, thereby ensuring the accuracy of the number of clients with the target grayscale function enabled.
[0047] In one embodiment, the method further includes: The response modifies the target quantity to a first value. Based on the first value, the client whose target grayscale function is to be disabled is determined among the clients whose target grayscale function has been enabled, and the data bitmap is updated. Modify the grayscale control result of the client whose target grayscale function is to be turned off to not enable the target grayscale function.
[0048] Specifically, the server responds to modifications to the target number of the grayscale range by changing the target number to a first value. Changing the target number to the first value can reduce the grayscale range. When the grayscale range is reduced, if the number of clients with the target grayscale function enabled in the data bitmap corresponding to the target grayscale function exceeds the first value, clients whose target grayscale function is enabled can be identified from among those clients, and the data bitmap is updated. After identifying the clients whose target grayscale function is disabled, the grayscale control result for those clients is changed to "not enabled". When identifying the clients whose target grayscale function is disabled, the selection can be randomized based on the first value or by selecting clients in reverse chronological order of their login time; this disclosure does not impose specific limitations on this.
[0049] For example, when the grayscale range of the target grayscale function in the grayscale function configuration table is reduced from 1000 to 800, and the current data bitmap includes 1000 clients with the target grayscale function enabled, it is necessary to identify 200 clients from these 1000 clients and modify the bitmap values of these 200 clients. In the data bitmap, when a client enables the target grayscale function, the bitmap value corresponding to that client is 1; otherwise, it is 0. Therefore, modifying the bitmap values of these 200 clients can be done by changing the bitmap values corresponding to these 200 clients from 1 to 0. Simultaneously, the grayscale control result for these 200 clients needs to be modified to `default_value`, and this `default_value` should be sent to the clients so that when these 200 clients log into the game again, the grayscale test corresponding to the target grayscale function will be automatically closed based on the `default_value`.
[0050] In step S130, the grayscale control result is sent to the client so that the client determines to start the grayscale test corresponding to the target grayscale function based on the grayscale control result.
[0051] After receiving the grayscale control result from the client, the grayscale control result is sent to the client so that the client can save the grayscale control result locally. On the next login, the client can retrieve the grayscale control result and determine whether to perform grayscale testing corresponding to the target grayscale function based on the grayscale control result.
[0052] The following will be through Figure 6 This disclosure provides further explanation and description of the server-side grayscale testing method.
[0053] 1. Listen for and receive canary deployment requests. The server listens for and receives canary deployment test requests from clients and performs validity checks on these requests. 2. Load the grayscale feature configuration table. Upon successful validation, retrieve the grayscale feature configuration table from the cache. If the grayscale feature configuration table does not exist in the cache, retrieve the information from the PostgreSQL database and load it into the cache.
[0054] 3. Matching Priority Sorting. After obtaining the grayscale feature configuration table, the first grayscale feature data with the same grayscale feature name included in the grayscale feature configuration table are sorted according to matching priority. After sorting, the server-side matching algorithm matches the client's grayscale test request with the configuration information of each grayscale feature data in the grayscale feature configuration table according to the sorting order. When a match is successful, grayscale range control is entered; when a match fails, a default_value is returned to the client, and the next grayscale feature for the current grayscale feature is traversed and matched.
[0055] 4. Gray-scale control based on grayscale range. Determine the target grayscale function corresponding to the client's grayscale test request and implement grayscale control for this target grayscale function. The grayscale range can be a percentage or a quantity. When the grayscale range is a percentage, concatenate the virtual object identifier and the grayscale function name of the target grayscale function, perform a hash calculation on the concatenated data to obtain the calculation result, and then use this calculation result to take the modulo of the target value to obtain a first comparison value. Compare this first comparison value with the percentage value of the grayscale range. If the first comparison value is less than the percentage value of the grayscale range, the grayscale control result is determined to be enabling the target grayscale function for the client, and a value is returned to the client; otherwise, the target grayscale function is not enabled, i.e., a default_value is returned to the client. When the grayscale range is a quantity, obtain the data bitmap corresponding to the target grayscale function. This data bitmap records the number of clients that have enabled the target grayscale function and the enabling status of each client. After obtaining the data bitmap, the number of clients that have enabled the target grayscale function and the enabling status of each client can be obtained. When the first number of clients that have enabled the target grayscale function in the data bitmap is less than the number of grayscale ranges, the grayscale control result is determined to enable the target grayscale function for the client, the value is returned to the client, and the client's data is recorded in the data bitmap to complete the update of the data bitmap stored in the Redis database.
[0056] 5. Return Results. Send the grayscale control results to the client.
[0057] This disclosure also provides a grayscale testing method for client-side applications, see reference. Figure 7 As shown, the method includes: Step S710: In response to the startup of the target application, load the first grayscale control result stored locally during the previous login of the current login, and determine to perform grayscale testing of the target grayscale function corresponding to the first grayscale control result based on the first grayscale control result.
[0058] Upon startup, the target application first loads the first grayscale control result stored locally on the client during the last login. This first grayscale control result is then loaded into memory and provided to the local interface. The local interface determines whether to perform grayscale testing of the target grayscale function corresponding to the first grayscale control result based on this result. The local interface can be a C++ interface, a Java interface, or an Objective-C interface; no specific limitation is made in this disclosure.
[0059] In one implementation, after loading the first grayscale control result stored locally during the previous login of the currently logged-in user, the method further includes: Clear the first grayscale control result stored locally.
[0060] Specifically, after loading the initial grayscale control results stored locally into memory, these results can be cleared. Clearing these results prevents new grayscale strategies (such as disabling features or adjusting ranges) from failing to take effect promptly upon the next login due to outdated data, thus avoiding inconsistencies between configuration and actual functionality. Furthermore, clearing the initial grayscale control results facilitates rollback.
[0061] In one implementation, after the client launches the game, a standardized login process is also required. This involves sending a queuing request to the game gateway server, verifying server load, and obtaining a login queue number. Account login is then performed, completing identity verification for the account password / verification code / third-party login, obtaining a temporary login credential, and using this credential to verify with the billing server to confirm the account's payment status, anti-addiction information, etc., thus completing final login authentication and entering the game.
[0062] Step S720: Generate grayscale request data, send the grayscale request data to the server, receive the second grayscale control result corresponding to the grayscale request data sent by the server, and store the second grayscale control result locally so that when the target application is restarted, the second grayscale control result is loaded and the corresponding grayscale test is executed according to the second grayscale control.
[0063] Specifically, during the login process, the client automatically collects device dimension information, player dimension information, etc., generates a gray-scale test request, sends the gray-scale test request to the server, receives the second gray-scale control result corresponding to the gray-scale request data of the gray-scale test request from the server, and stores the second gray-scale control result locally. When the target application is restarted, the second gray-scale control result is loaded into memory so that it can be provided to the local interface. The local interface determines whether to execute the gray-scale test of the target gray-scale function corresponding to the second gray-scale control result based on the second gray-scale control result.
[0064] The following will combine Figure 8 This section provides further explanation and elaboration on the client-side gray-scale testing method. Specifically: 1. Start the target application process.
[0065] 2. Load the first grayscale control result stored locally during the last login, and determine whether to perform grayscale testing based on the first grayscale control result.
[0066] 3. Clear the first grayscale control result stored locally.
[0067] 4. Perform the basic login process: queue verification, unisdk account login, billing login, and enter the game.
[0068] 5. Initiate a canary test request. After successful billing login, the client automatically triggers and sends a canary test request to the server.
[0069] 6. Receive and save the second grayscale control result sent by the server.
[0070] Exemplary embodiments of this disclosure also provide a grayscale testing device, applied to a server, with reference to... Figure 9 As shown, it includes: The grayscale function matching module 910 is used to receive a grayscale test request sent by the client, read the grayscale function configuration table, match the grayscale test request with the grayscale function configuration table, and determine the target grayscale function corresponding to the grayscale test request. The grayscale function control module 920 is used to perform grayscale control on the client based on the grayscale function data of the target grayscale function, and obtain the grayscale control result of the client. The grayscale control result sending module 930 is used to send the grayscale control result to the client so that the client can determine to start the grayscale test corresponding to the target grayscale function based on the grayscale control result.
[0071] Exemplary embodiments of this disclosure also provide a grayscale testing device, applied to a client, with reference to... Figure 10 As shown, it includes: The grayscale test initiation module 1010 is used to respond to the startup of the target application, load the first grayscale control result stored locally during the last login, and determine, based on the first grayscale control result, to perform grayscale test of the target grayscale function corresponding to the first grayscale control result. The grayscale control result storage module 1020 is used to generate grayscale request data, send the grayscale request data to the server, receive the second grayscale control result corresponding to the grayscale request data sent by the server, and store the second grayscale control result locally so that when the target application is restarted, the second grayscale control result is loaded and the corresponding grayscale test is executed according to the second grayscale control.
[0072] In one exemplary embodiment, the grayscale function configuration table includes multiple grayscale function data entries, each of which includes at least a grayscale function name, configuration information, matching priority, and grayscale range. The grayscale function matching module includes: The configuration information matching module is used to traverse the configuration information and match the grayscale test request with the configuration information; The target grayscale function determination module is used to determine the grayscale function corresponding to the configuration information as the target grayscale function when the request data of the grayscale test request completely includes the configuration information and the value of the corresponding field of the configuration information is completely equal to that of the request data.
[0073] In one exemplary embodiment, the grayscale function matching module includes: The first grayscale function data determination module is used to determine whether there are multiple first grayscale function data with the same grayscale function name in the grayscale function configuration table; The grayscale function data matching module is used to sort the multiple grayscale function data with the same grayscale function name according to the matching priority in the first grayscale function data when they exist.
[0074] In one exemplary embodiment, the grayscale function matching module includes: The first grayscale function data traversal module is used to prioritize traversing the first grayscale function data with the highest matching priority, and to match the configuration information in the first grayscale function data with the highest matching priority with the request data. The second grayscale function data traversal module is used to determine the grayscale function corresponding to the first grayscale function data with the highest matching priority as the target grayscale function when a match is successful, and to traverse the second grayscale function data; wherein, the second grayscale function data is data in the grayscale function configuration table that has a different grayscale function name from the first grayscale function data. The second grayscale function data traversal module is used to traverse the first grayscale function data sequentially according to the sorting order when the matching fails, until the grayscale function data in the first grayscale function data that matches the requested data is determined.
[0075] In one exemplary embodiment, the grayscale function control module includes: The grayscale control result acquisition module is used to determine the type of the grayscale range in the grayscale function data, determine the grayscale control logic based on the type of the grayscale range, perform grayscale control based on the grayscale control logic, and obtain the grayscale control result of the client.
[0076] In one exemplary embodiment, when the grayscale range is a percentage, the grayscale function control module includes: The first comparison value determination module is used to concatenate the virtual object identifier corresponding to the client with the grayscale function name of the target grayscale function, perform hash calculation, and take the modulo of the hash calculation result to obtain the first comparison value; The target grayscale function enabling module is used to determine that the grayscale control result is to enable the target grayscale function for the client when the first comparison value is less than the grayscale range; otherwise, the target grayscale function is not enabled.
[0077] In one exemplary embodiment, when the grayscale range is of type quantity, the grayscale function control module includes: The quantity comparison module is used to obtain the data bitmap corresponding to the target grayscale function and the first quantity of the target grayscale function that has been enabled stored in the data bitmap. When the first quantity is less than the target quantity, the grayscale control result is determined to enable the target grayscale function for the client.
[0078] In one exemplary embodiment, the grayscale function control module includes: The data bitmap update module is used to respond to modifying the target quantity to a first value, and based on the first value, to determine the client whose target grayscale function is to be disabled among the clients whose target grayscale function has been enabled, and to update the data bitmap. The grayscale control result modification module is used to modify the grayscale control result of the client whose target grayscale function is to be turned off to not enable the target grayscale function.
[0079] In one exemplary embodiment, the grayscale test activation module includes: The grayscale control result clearing module is used to clear the first grayscale control result stored locally.
[0080] The specific details of each part of the above-mentioned device have been described in detail in the method section of the implementation plan. For any undisclosed details, please refer to the implementation plan of the method section, and therefore will not be repeated here.
[0081] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to exemplary embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0082] Furthermore, although the steps of the method in this invention are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.
[0083] Exemplary embodiments of this disclosure also provide a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the above-described game processing method.
[0084] In one implementation, the computer program product can be a tangible product containing a computer program, such as a computer-readable storage medium storing the computer program. The readable storage medium can be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory, hard disk drive (HDD), solid-state drive (SSD), etc. For example, the computer program product can be implemented as a non-volatile storage medium storing a computer program, such as read-only memory, NAND flash memory, etc.
[0085] In one implementation, the computer program product can be an intangible product containing a computer program. For example, the computer program product can be implemented as a virtual digital product, such as an executable file, installation package, or other digital file storing the computer program.
[0086] Computer program code can be written in one or more programming languages. Examples of programming languages include C, Java, and C++. Program code can execute entirely on the user's computing device, partially on the user's computing device, or as a standalone software package. It can also execute partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, such as a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via an internet connection provided by a mobile network operator).
[0087] Computer programs can be carried or transmitted via signals such as electricity, magnetism, light, electromagnetic fields, and infrared radiation. Electronic devices can convert signals carrying computer programs into digital signals, thereby running the computer programs. When a computer program runs on an electronic device, its code is used to cause the electronic device to execute (more specifically, the processor of the electronic device to execute) the method steps of various exemplary embodiments of this disclosure, such as the virtual object control method described above, which includes the following steps: Step S110: Receive a grayscale test request sent by a client, read a grayscale function configuration table, match the grayscale test request with the grayscale function configuration table, and determine the target grayscale function corresponding to the grayscale test request; Step S120: Perform grayscale control on the client based on the grayscale function data of the target grayscale function to obtain the grayscale control result of the client; Step S130: Send the grayscale control result to the client so that the client determines to start the grayscale test corresponding to the target grayscale function according to the grayscale control result.
[0088] The above method steps are implemented through a computer program. On the one hand, the grayscale strategy is configured through a grayscale function configuration table. This table enables complex grayscale testing logic, solving the problems of insufficient diversity and specificity of grayscale range in related technologies. On the other hand, after matching and determining the target grayscale function corresponding to the grayscale test request, grayscale control is performed on the client to obtain the corresponding grayscale control result, achieving precise control over the grayscale test range. Furthermore, after obtaining the grayscale control result, it is sent to the client to ensure that each client only obtains its own matched grayscale configuration, rather than the full grayscale function configuration table, reducing data transmission volume and avoiding interference from irrelevant grayscale function configurations with client logic. Upon receiving the grayscale control result, the client determines whether to start the grayscale test corresponding to the target grayscale function based on the result. The entire process is fully automated, and the opening / closing of grayscale functions is imperceptible to players, avoiding the impact of grayscale operations on the normal gameplay experience.
[0089] In an exemplary embodiment of the present invention, an electronic device capable of implementing the above-described method is also provided. The electronic device may include a processor and a memory. The memory stores executable instructions of the processor, such as a computer program. The processor executes the executable instructions to perform the method steps of various exemplary embodiments of the present disclosure. Furthermore, the electronic device may also include a display for displaying a graphical user interface.
[0090] Those skilled in the art will understand that various aspects of the present invention can be implemented as systems, methods, or program products. Therefore, various aspects of the present invention can be specifically implemented in the following forms: entirely in hardware, entirely in software (including firmware, microcode, etc.), or in a combination of hardware and software, collectively referred to herein as “circuit,” “module,” or “system.”
[0091] The following reference Figure 11 To describe an electronic device 1100 according to this embodiment of the present invention. Figure 11 The electronic device 1100 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0092] like Figure 11 As shown, the electronic device 1100 is manifested in the form of a general-purpose computing device. The components of the electronic device 1100 may include, but are not limited to: at least one processing unit 1110, at least one storage unit 1120, a bus 1130 connecting different system components (including storage unit 1120 and processing unit 1110), and a display unit 1140.
[0093] The storage unit stores program code that can be executed by the processing unit 1110, causing the processing unit 1110 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of the present invention. For example, the processing unit 1110 can perform actions such as... Figure 1 Step S110: Receive a grayscale test request sent by the client, read the grayscale function configuration table, match the grayscale test request with the grayscale function configuration table, and determine the target grayscale function corresponding to the grayscale test request; Step S120: Perform grayscale control on the client based on the grayscale function data of the target grayscale function to obtain the grayscale control result of the client; Step S130: Send the grayscale control result to the client so that the client determines to start the grayscale test corresponding to the target grayscale function according to the grayscale control result.
[0094] Storage unit 1120 may include readable media in the form of volatile storage units, such as random access memory (RAM) 11201 and / or cache memory 11202, and may further include read-only memory (ROM) 11203.
[0095] Storage unit 1120 may also include a program / utility 11204 having a set (at least one) program module 11205, such program module 11205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0096] Bus 1130 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.
[0097] Electronic device 1100 can also communicate with one or more external devices 1200 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 1100, and / or with any device that enables electronic device 1100 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 1150. Furthermore, electronic device 1100 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 1160. As shown, network adapter 1160 communicates with other modules of electronic device 1100 via bus 1130. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 1000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID (Redundant Arrays of Independent Disks) systems, tape drives, and data backup storage systems.
[0098] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, portable hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the method according to the embodiments of the present invention.
[0099] In exemplary embodiments of the present invention, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of the present invention may also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of the present invention described in the "Exemplary Methods" section above.
[0100] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0101] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention described herein. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not invented herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of the invention are indicated by the claims.
Claims
1. A grayscale testing method, characterized in that, Applied to the server side, the method includes: Receive a grayscale test request sent by the client, read the grayscale function configuration table, match the grayscale test request with the grayscale function configuration table, and determine the target grayscale function corresponding to the grayscale test request; Based on the grayscale function data of the target grayscale function, grayscale control is performed on the client to obtain the grayscale control result of the client; The grayscale control result is sent to the client so that the client can determine to start the grayscale test corresponding to the target grayscale function based on the grayscale control result.
2. The method according to claim 1, characterized in that, The grayscale function configuration table includes multiple grayscale function data entries. Each grayscale function data entry includes at least a grayscale function name, configuration information, matching priority, and grayscale range. Matching the grayscale test request with the grayscale function configuration table to determine the target grayscale function corresponding to the grayscale test request includes: Traverse the configuration information and match the grayscale test request with the configuration information; When the request data of the grayscale test request completely includes the configuration information and the values of the corresponding fields of the configuration information are completely equal, the grayscale function corresponding to the configuration information is determined to be the target grayscale function.
3. The method according to claim 2, characterized in that, Before matching the grayscale test request with the grayscale function configuration table, the method further includes: Determine whether there are multiple first grayscale function data entries with the same grayscale function name in the grayscale function configuration table; When they exist, the multiple grayscale function data with the same grayscale function name are sorted according to the matching priority in the first grayscale function data.
4. The method according to claim 3, characterized in that, The method further includes: First, iterate through the first grayscale function data with the highest matching priority, and match the configuration information in the first grayscale function data with the request data. When a match is successful, the grayscale function corresponding to the first grayscale function data with the highest matching priority is determined as the target grayscale function, and the second grayscale function data is traversed; wherein, the second grayscale function data is data in the grayscale function configuration table whose grayscale function name is different from that of the first grayscale function data; If a match fails, the first grayscale function data is traversed sequentially according to the sorting until a grayscale function data matching the request data is determined in the first grayscale function data.
5. The method according to claim 2, characterized in that, The grayscale control of the client based on the grayscale function data of the target grayscale function, to obtain the grayscale control result of the client, includes: Determine the type of the grayscale range in the grayscale function data, determine the grayscale control logic based on the type of the grayscale range, perform grayscale control based on the grayscale control logic, and obtain the grayscale control result of the client.
6. The method according to claim 5, characterized in that, When the grayscale range type is a percentage, the grayscale control logic is determined according to the grayscale range type, grayscale control is performed according to the grayscale control logic, and the grayscale control result of the client is obtained, including: The virtual object identifier corresponding to the client is concatenated with the grayscale function name of the target grayscale function, and a hash calculation is performed. The result of the hash calculation is moduloed to obtain the first comparison value. When the first comparison value is less than the grayscale range, the grayscale control result is determined to enable the target grayscale function for the client; otherwise, the target grayscale function is not enabled.
7. The method according to claim 5, characterized in that, When the grayscale range type is quantity, the grayscale control logic is determined according to the grayscale range type, grayscale control is performed according to the grayscale control logic, and the grayscale control result of the client is obtained, including: Obtain the data bitmap corresponding to the target grayscale function and the first number of the target grayscale function that has been enabled stored in the data bitmap. When the first number is less than the target number, determine that the grayscale control result is to enable the target grayscale function for the client.
8. The method according to claim 7, characterized in that, The method further includes: The response modifies the target quantity to a first value. Based on the first value, the client whose target grayscale function is to be disabled is determined among the clients whose target grayscale function has been enabled, and the data bitmap is updated. Modify the grayscale control result of the client whose target grayscale function is to be turned off to not enable the target grayscale function.
9. A grayscale testing method, characterized in that, Applied to a client, the method includes: In response to the launch of the target application, load the first grayscale control result stored locally during the last login, and determine to perform grayscale testing of the target grayscale function corresponding to the first grayscale control result based on the first grayscale control result. Generate grayscale request data, send the grayscale request data to the server, receive the second grayscale control result corresponding to the grayscale request data sent by the server, and store the second grayscale control result locally so that when the target application is restarted, the second grayscale control result is loaded and the corresponding grayscale test is executed according to the second grayscale control.
10. The method according to claim 9, characterized in that, After loading the first grayscale control result stored locally during the previous login of the currently logged-in user, the method further includes: Clear the first grayscale control result stored locally.
11. A grayscale testing device, characterized in that, The device includes: The grayscale function matching module is used to receive grayscale test requests sent by the client, read the grayscale function configuration table, match the grayscale test request with the grayscale function configuration table, and determine the target grayscale function corresponding to the grayscale test request. A grayscale function control module is used to perform grayscale control on the client based on the grayscale function data of the target grayscale function, and obtain the grayscale control result of the client. A grayscale control result sending module is used to send the grayscale control result to the client, so that the client determines to start the grayscale test corresponding to the target grayscale function based on the grayscale control result.
12. A grayscale testing device, characterized in that, The device includes: The grayscale test initiation module is used to respond to the startup of the target application, load the first grayscale control result stored locally during the last login, and determine the grayscale test to be performed on the target grayscale function corresponding to the first grayscale control result based on the first grayscale control result. The grayscale control result storage module is used to generate grayscale request data, send the grayscale request data to the server, receive the second grayscale control result corresponding to the grayscale request data sent by the server, and store the second grayscale control result locally so that when the target application is restarted, the second grayscale control result is loaded and the corresponding grayscale test is executed according to the second grayscale control.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method according to any one of claims 1 to 10.
14. An electronic device, characterized in that, include: processor; Memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1 to 10 by executing the executable instructions.