Gray level configuration method, program product, electronic equipment and storage medium

By using a grayscale configuration method on the server, the scope of impact of APP configuration files is controlled, and the problem of uncontrollable impact of configuration file updates on users in the existing technology is solved, and a safer and more controllable configuration release process is achieved.

CN120010901APending Publication Date: 2025-05-16SHANGHAI DEWU INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510115312.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-24
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

In the prior art, the scope of impact of the APP configuration file update on users is uncontrollable, resulting in a high risk of online problems.

Method used

The grayscale configuration method is adopted. The server generates configuration files based on the grayscale configuration, and receives the grayscale configuration operation identifier reported by the client to count the number of effective clients. When the number of effective clients meets the requirements, the configuration file is offline to prevent subsequent clients from pulling.

Benefits of technology

Through the grayscale configuration method, the server can control the impact range of new configuration changes, reduce the risk of online problems, improve user experience, and save storage costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120010901A_ABST
    Figure CN120010901A_ABST
Patent Text Reader

Abstract

The invention provides a gray level configuration method, a program product, electronic equipment and a storage medium, which are applied to a server side and comprise the following steps: generating a configuration file according to gray level configuration; gray level configuration operation identifiers reported by the clients are received, and the number of effective clients with the configuration files effective is counted according to the reported number of the received gray level configuration operation identifiers; the gray level configuration operation identifier is sent after gray level configuration of the client takes effect for the first time; and if the number of the effective clients meets the gray level number requirement, the configuration file including the gray level configuration is offline, so that the subsequent clients cannot pull the configuration file including the gray level configuration. Through the gray level configuration method, the server side can control the influence range of the new configuration change, so that the online problem risk caused by the configuration change is reduced. The server can flexibly manage the whole process of gray release according to the number of the received effective clients, so that the gray configuration is more controllable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a grayscale configuration method, a program product, an electronic device, and a storage medium. Background Art

[0002] In order to cope with complex and ever-changing business and technical scenarios, the App (Application) side has generated a series of configuration update requirements. The configuration center is a platform that can carry the configuration content changes of the App. In the existing technology, for the update of the APP, the configuration file will be updated in the configuration center and take effect on online users. This update method has an uncontrollable impact on the user range. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a grayscale configuration method, a program product, an electronic device, and a storage medium to improve the problem that the impact of configuration file updates on users is uncontrollable.

[0004] In the first aspect, an embodiment of the present application provides a grayscale configuration method, which is applied to a server, including: generating a configuration file based on the grayscale configuration; the grayscale configuration includes a grayscale configuration operation identifier; the grayscale configuration operation identifier is used to identify the version of the configuration change; receiving the grayscale configuration operation identifier reported by the client, and counting the number of effective clients for which the configuration file is effective based on the reported number of received grayscale configuration operation identifiers; the grayscale configuration operation identifier is sent after the grayscale configuration of the client takes effect for the first time; if the number of effective clients meets the grayscale number requirement, the configuration file including the grayscale configuration is taken offline so that subsequent clients cannot pull the configuration file including the grayscale configuration.

[0005] In the above implementation process, through the grayscale configuration method, the server can control the scope of the new configuration change, thereby reducing the risk of online problems caused by configuration changes. The server can flexibly manage the entire process of grayscale release according to the number of effective clients received, making grayscale configuration more controllable.

[0006] Optionally, in an embodiment of the present application, the grayscale configuration includes a grayscale end time; if the number of effective clients meets the grayscale number requirement, the configuration file including the grayscale configuration is taken offline, including: judging whether the grayscale number requirement is met based on the number of effective clients; if the grayscale number requirement is met, the configuration file including the grayscale configuration is taken offline; if the grayscale number requirement is not met, the grayscale end time is dynamically updated based on the number of effective clients, so that subsequent clients determine whether to perform grayscale configuration based on the updated grayscale end time.

[0007] In the above implementation process, the server can accurately control the number of clients for grayscale release, and fully tested configuration changes will be applied to more users, which can improve the user experience. In addition, the server only needs to judge the received grayscale configuration operation identifier without storing the client's device information, saving storage costs. By dynamically adjusting the grayscale end time, the server can flexibly control the rhythm of grayscale release according to actual conditions.

[0008] Optionally, in an embodiment of the present application, the grayscale end time is dynamically updated according to the number of effective clients, including: calculating the time interval between the start time of generating the configuration file and the current time of obtaining the number of effective clients; the time interval represents the length of time the grayscale process has been performed; determining the number of active users per unit time according to the number of effective clients and the time interval; obtaining the remaining grayscale amount based on a preset grayscale amount and the number of effective clients; determining the estimated remaining time based on the remaining grayscale amount and the number of active users per unit time; and dynamically updating the grayscale end time according to the estimated remaining time calculated in real time.

[0009] In the above implementation process, the server can flexibly adjust the rhythm of grayscale release according to actual conditions instead of following a fixed grayscale schedule. It can adapt to different user activity and response speeds, and will not waste resources due to premature termination of grayscale release, or cause the number of grayscale configuration users to exceed expectations due to late termination. The management of grayscale configuration is more scientific and precise.

[0010] In the second aspect, an embodiment of the present application provides a grayscale configuration method, which is applied to a client, including: pulling a configuration file from a server; the configuration file includes parameter information required during the use of the client application; if the configuration file includes a grayscale configuration, obtaining a grayscale configuration operation identifier from the configuration file; the grayscale configuration operation identifier is used to identify the version of the configuration change; applying the grayscale configuration in the client, and when the grayscale configuration takes effect for the first time, reporting the grayscale configuration operation identifier to the server.

[0011] In the above implementation process, through the gradual implementation of the grayscale configuration, the client can smoothly transition to the new configuration and reduce the impact on users. By reporting the grayscale configuration operation identifier to the server, the server can collect data on the actual implementation of the configuration change to provide support for further decision-making.

[0012] Optionally, in an embodiment of the present application, if the configuration file includes a grayscale configuration, a grayscale configuration operation identifier is obtained from the configuration file, including: parsing the configuration file, querying whether there is a preset grayscale field in the parsed configuration file; if so, verifying whether the grayscale configuration in the configuration file is valid; if the grayscale configuration is valid, extracting the grayscale configuration operation identifier from the configuration file.

[0013] In the above implementation process, by verifying the validity of the grayscale configuration, the client can avoid applying invalid or malicious configuration information, and by accurately extracting and reporting the grayscale configuration operation identifier, the client can accurately implement the grayscale release strategy.

[0014] Optionally, in an embodiment of the present application, the grayscale configuration includes a grayscale end time; applying the grayscale configuration in the client includes: determining the current operation time of the grayscale configuration operation identifier obtained from the configuration file; if the current operation time does not exceed the grayscale end time, applying the grayscale configuration in the client.

[0015] In the above implementation process, by comparing the current time with the grayscale end time, the client can accurately control the grayscale configuration effective time to ensure that the configuration changes are carried out as planned. It can also prevent outdated configurations from being applied incorrectly, reducing potential risks caused by configuration errors.

[0016] Optionally, in an embodiment of the present application, when the grayscale configuration takes effect for the first time, the grayscale configuration operation identifier is reported to the server, including: determining whether the grayscale configuration operation identifier is recorded locally on the client; if not recorded, determining that the grayscale configuration takes effect for the first time, and reporting the grayscale configuration operation identifier to the server; if recorded, determining that the grayscale configuration is not taking effect for the first time, and there is no need to report the grayscale configuration operation identifier to the server.

[0017] In the above implementation process, by reporting the grayscale configuration operation identifier only when it takes effect for the first time, each client only reports the grayscale configuration operation identifier that takes effect for the first time once, and the server can obtain the accurate number of grayscale configurations that take effect, thereby more accurately evaluating the effect of grayscale release. Avoiding repeated reporting of the same grayscale configuration operation identifier can reduce unnecessary network traffic and server load, and improve system efficiency.

[0018] In the third aspect, the embodiment of the present application also provides a first grayscale configuration device, which is applied to the server, including: a configuration file generation module, which is used to generate a configuration file according to the grayscale configuration; the grayscale configuration includes a grayscale configuration operation identifier; the grayscale configuration operation identifier is used to identify the version of the configuration change; a receiving identification module, which is used to receive the grayscale configuration operation identifier reported by the client, and count the number of effective clients for which the configuration file is effective according to the reported number of received grayscale configuration operation identifiers; the grayscale configuration operation identifier is sent after the grayscale configuration of the client takes effect for the first time; a judgment module, which is used to take the configuration file including the grayscale configuration offline if the number of effective clients meets the grayscale number requirement, so that subsequent clients cannot pull the configuration file including the grayscale configuration.

[0019] In the fourth aspect, the embodiment of the present application also provides a second grayscale configuration device, which is applied to the client, including: a configuration pulling module, used to pull the configuration file from the server; the configuration file includes parameter information required during the use of the client application; an extraction identification module, used to obtain the grayscale configuration operation identifier from the configuration file if the configuration file includes the grayscale configuration; the grayscale configuration operation identifier is used to identify the version of the configuration change; a reporting module, used to apply the grayscale configuration in the client, and when the grayscale configuration takes effect for the first time, report the grayscale configuration operation identifier to the server.

[0020] In a fifth aspect, an embodiment of the present application further provides a computer program product, including computer program instructions, which, when executed by a processor, execute the method provided by the first aspect or any one of the implementations of the first aspect.

[0021] In a sixth aspect, an embodiment of the present application further provides an electronic device, comprising: a processor and a memory, the memory storing computer program instructions, and the computer program instructions, when executed by the processor, execute the method provided by the first aspect or any one of the implementations of the first aspect.

[0022] In the seventh aspect, an embodiment of the present application further provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method provided by the first aspect or any one of the implementations of the first aspect is executed.

[0023] By adopting a grayscale configuration method, program product, electronic device and storage medium provided by the present application, the server can control the scope of influence of new configuration changes through the grayscale configuration method, thereby reducing the risk of online problems caused by configuration changes. The server can flexibly manage the entire process of grayscale release according to the number of effective clients received, making grayscale configuration more controllable. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0025] Figure 1 A schematic diagram of a process flow of a first grayscale configuration method provided in an embodiment of the present application;

[0026] Figure 2 A schematic diagram of a flow chart of a second grayscale configuration method provided in an embodiment of the present application;

[0027] Figure 3 A schematic diagram of the structure of a first grayscale configuration device provided in an embodiment of the present application;

[0028] Figure 4 A schematic diagram of the structure of a second grayscale configuration device provided in an embodiment of the present application;

[0029] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] The following embodiments of the technical solution of the present application are described in detail in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present application, and are therefore only used as examples, and cannot be used to limit the scope of protection of the present application.

[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application.

[0032] In the description of the embodiments of the present application, the technical terms "first", "second", etc. are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0033] In the prior art, for updates to an APP, a configuration file is updated in a configuration center and takes effect on all online users. If there is a problem with the updated version, it may have a wide range of impacts.

[0034] In order to improve the problem that the scope of impact of configuration file updates on users is uncontrollable, the embodiments of the present application provide a grayscale configuration method, a program product, an electronic device, and a storage medium. Through the grayscale configuration method, the server can control the scope of impact of new configuration changes, thereby reducing the risk of online problems caused by configuration changes. The server can flexibly manage the entire process of grayscale release, including start, statistics, and end, according to the number of effective clients received, making the grayscale configuration more controllable.

[0035] Before describing the gray configuration method, the concept of gray configuration in the embodiment of the present application is first introduced: Gray Release Configuration refers to the process of software (update) release, in order to reduce the risk of the new version online, gradually push the configuration of the new version to a part of users, rather than all users at once. Through this strategy, developers test the performance of the new version in a controllable and smaller range before fully promoting the new version, collect feedback, and make adjustments when necessary. The gray configuration method is described below.

[0036] See also Figure 1 The flowchart of the first grayscale configuration method provided by the embodiment of the present application is shown. The grayscale configuration method provided by the first embodiment of the present application can be applied to the server, and the server can be operated by an electronic device, which can include a physical device such as a server, a PC, a tablet computer or a smart phone, or a virtual device such as a virtual machine or a container. The electronic device can be a single device, or a combination of multiple devices or a cluster of a large number of devices. The grayscale configuration method may include:

[0037] Step S110: Generate a configuration file according to the grayscale configuration; the grayscale configuration includes a grayscale configuration operation identifier; the grayscale configuration operation identifier is used to identify a version of a configuration change.

[0038] Step S120: receiving the grayscale configuration operation identifier reported by the client, and counting the number of effective clients for which the configuration file is effective according to the reported number of received grayscale configuration operation identifiers; the grayscale configuration operation identifier is sent after the grayscale configuration of the client is effective for the first time.

[0039] Step S130: If the number of effective clients meets the grayscale number requirement, the configuration file including the grayscale configuration is taken offline so that subsequent clients cannot pull the configuration file including the grayscale configuration.

[0040] In step S110, the server first generates a configuration file based on the defined grayscale configuration. For example, the original configuration file of the App that needs to be updated is obtained, and the content of the grayscale configuration is added to the original configuration file to generate a configuration file. The grayscale configuration includes configuration changes and grayscale configuration operation identifiers (opsId) and other contents. Configuration changes refer to the configuration content to be changed in the grayscale configuration, and the configuration changes may include actual configuration items and their new values. The grayscale configuration operation identifier (opsId) refers to a unique identifier generated for each configuration change, which is used to track and record configuration changes. For example, for an App that needs to be updated, three grayscale configurations are released, and the configuration content (such as fields) of each configuration change is different. The corresponding grayscale configuration operation identifier can be set for each grayscale configuration. In this way, after receiving the grayscale configuration operation identifier reported by the user, it can be determined which version of the grayscale configuration is effective for the client, thereby effectively managing each version of the grayscale configuration.

[0041] In an optional embodiment, the grayscale configuration may further include a grayscale end timestamp, and the grayscale end timestamp is used to specify the end time of the grayscale configuration taking effect. After this time, the grayscale configuration will no longer take effect.

[0042] After generating the configuration file containing the grayscale configuration, the server uploads the configuration file containing the grayscale configuration to the configuration center, distributed configuration storage system or other network, so that the configuration file can be actively accessed and obtained by the client. As an implementation method, a notification mechanism such as long polling, WebSocket connection, message queue or subscription model can also be adopted to actively push the configuration file to the client.

[0043] After the client obtains the configuration file, it will determine whether the configuration file includes grayscale configuration. If it does, it will parse the grayscale configuration part. If the grayscale configuration is effective on the client for the first time, that is, the client obtains the grayscale configuration operation identifier for the first time, the client will apply the grayscale configuration to the local configuration, start using the new configuration value, and report the effective grayscale configuration operation identifier to the server.

[0044] In step S120, the server receives the grayscale configuration operation identifier reported by the client, and counts the number of effective clients for which the configuration file is effective based on the number of reported grayscale configuration operation identifiers received. The server can count the number of operation identifiers that have been reported, so as to know how many clients have made the grayscale configuration effective. For example, the number of reported grayscale configuration operation identifiers obtained by statistics can be used as the number of effective clients. Of course, the number of reported grayscale configuration operation identifiers obtained by statistics can also be verified twice to filter out clients that are not truly effective, and the filtered data can be used as the number of effective clients.

[0045] In step S130, the server will determine whether the number of valid clients received meets the conditions based on the preset grayscale number requirements. If so, it means that the grayscale release phase can be ended. Therefore, the server can take offline the configuration file that currently contains the grayscale configuration to prevent subsequent clients from pulling files containing the grayscale configuration. Taking the configuration file including the grayscale configuration offline represents the end of the grayscale configuration phase of this version, and subsequent clients will only be able to pull stable version configuration files. Subsequent clients refer to clients that need to pull configuration files from the server in the future.

[0046] It can be understood that if multiple grayscale configurations are carried out at the same time, each grayscale configuration has a corresponding grayscale configuration operation identifier. After receiving the grayscale configuration operation identifier reported by the client, each grayscale configuration operation identifier is counted separately according to the grayscale configuration operation identifier. Then, based on the statistical results, it is determined whether multiple grayscale configurations meet the grayscale quantity requirements. Different grayscale configuration operation identifiers can set their corresponding grayscale quantity requirements respectively to meet personalized needs and achieve fine control of multiple grayscale configurations.

[0047] In the implementation process of the above embodiment: through the grayscale configuration method, the server can control the impact range of the new configuration change, thereby reducing the risk of online problems caused by configuration changes. The server can flexibly manage the entire process of grayscale release according to the number of effective clients received, making the grayscale configuration more controllable.

[0048] Optionally, in an embodiment of the present application, the grayscale configuration includes a grayscale end time; for example, the server sets an estimated grayscale end time at the beginning of the grayscale release. This time is determined based on the expected number of grayscale covered users and historical user activity data.

[0049] If the number of effective clients meets the grayscale requirement, the configuration file grayscale process ends, including:

[0050] Determine whether the grayscale quantity requirement is met based on the number of effective clients. For example, the server receives the grayscale configuration operation identifier reported by the client, and performs a secondary check on the reported number of the received grayscale configuration operation identifier to determine the number of effective clients, and then compares the number of effective clients with the preset grayscale quantity requirement to determine whether the grayscale quantity requirement is met.

[0051] The process of performing a secondary check on the number of reports of the received grayscale configuration operation identifiers is, for example, filtering the number of ineffective grayscale configurations and erroneous reports. An ineffective grayscale configuration means that if a grayscale configuration operation identifier is no longer effective when reported (i.e., the grayscale end timestamp has been exceeded), the report is ignored, and this type of report is filtered. An erroneous report means that if the reported grayscale configuration operation identifier does not exist in the valid grayscale configuration recorded by the server, or the reporting format is incorrect, the report is ignored, and this type of report is also filtered. The number of reports remaining after filtering is then used as the number of effective clients.

[0052] After secondary verification and filtering, the server calculates the number of effective clients, which represents the number of clients with truly effective grayscale configuration.

[0053] If the grayscale quantity requirement is met, the configuration file including the grayscale configuration will be taken offline, that is, the configuration file grayscale process ends, and subsequent clients cannot pull the configuration file including the grayscale configuration.

[0054] If the grayscale quantity requirement is not met, the grayscale end time is dynamically updated according to the number of effective clients, and the updated grayscale end time is used to replace the grayscale end time, so that subsequent clients determine whether to perform grayscale configuration based on the updated grayscale end time.

[0055] When the client pulls the configuration file, it will check the grayscale end time. If the current time is before the new grayscale end timestamp, the client will continue to check and apply the grayscale configuration. If the current time exceeds the new grayscale end timestamp, the client will stop applying the grayscale configuration and can use its original configuration file without updating it; it can also wait for the next configuration file update.

[0056] In the implementation process of the above embodiment: the server can accurately control the number of clients for grayscale release, and fully tested configuration changes will be applied to more users, which can improve the user experience. And the server only needs to judge the received grayscale configuration operation identifier without storing the client's device information, saving storage costs. By dynamically adjusting the grayscale end time, the server can flexibly control the rhythm of grayscale release according to actual conditions.

[0057] Optionally, in an embodiment of the present application, dynamically updating the grayscale end time according to the number of valid clients includes:

[0058] Calculate the time interval between the start time of generating the configuration file and the current time when the number of effective clients is obtained; the time interval represents the length of time the grayscale process has been in progress.

[0059] The number of active users per unit time is determined based on the number of effective clients and the time interval. For example, if the time interval is 10 hours, then the number of effective clients is divided by 10 hours to obtain the number of effective clients per hour as the number of active users per unit time. Of course, in order to improve accuracy, the time interval can also be converted into minutes or seconds to calculate the number of active users per unit time with higher accuracy.

[0060] Based on the preset grayscale quantity and the number of effective clients, the remaining grayscale quantity is obtained. The preset grayscale quantity is set according to actual needs. This step is used to evaluate the current progress. The preset grayscale quantity requirement is subtracted from the number of currently effective clients to obtain the client data that still needs to be grayscale configured, that is, the remaining grayscale quantity.

[0061] Based on the remaining grayscale amount and the number of active users per unit time, the estimated remaining time is determined; according to the estimated remaining time calculated in real time, the grayscale end time is dynamically updated.

[0062] As an implementation method, the ratio of the remaining grayscale amount to the number of active users per unit time can be used as the estimated remaining time. Then the current time plus the estimated remaining time is used as the updated grayscale end time.

[0063] Considering that the number of active users per unit time in each time period is not consistent, for example, the number of active users per unit time in the daytime period and the nighttime period is inconsistent, for such cases where the number of active users per unit time is significantly different, if the number of active users per unit time is determined using the number of effective clients and time intervals that have been received, the estimated remaining time calculated may be affected by the number of active users per unit time. Therefore, the number of active users per unit time in the same period of historical time can be used as the basis for updating the grayscale end time. For example, the remaining grayscale amount is divided by the number of active users per unit time in the same period of historical time to obtain the estimated remaining time, thereby improving the inaccurate time calculation caused by inaccurate estimation of the number of active users per unit time.

[0064] During the implementation of the above embodiment: the server can flexibly adjust the rhythm of grayscale release according to actual conditions, instead of following a fixed grayscale schedule, and can adapt to different user activities and response speeds. It will not waste resources due to premature termination of grayscale release, or cause the number of people in grayscale configuration to exceed expectations due to late termination, and the management of grayscale configuration will be more scientific and precise.

[0065] See also Figure 2 The flowchart of the second grayscale configuration method provided by the embodiment of the present application is shown. The grayscale configuration method provided by the first embodiment of the present application can be applied to a client, and the client can be operated by an electronic device. The grayscale configuration method may include:

[0066] Step S210: Pull a configuration file from the server; the configuration file includes parameter information required during the operation of the client application.

[0067] Step S220: If the configuration file includes grayscale configuration, a grayscale configuration operation identifier is obtained from the configuration file; the grayscale configuration operation identifier is used to identify a version of a configuration change.

[0068] Step S230: Apply the grayscale configuration in the client, and when the grayscale configuration takes effect for the first time, report the grayscale configuration operation identifier to the server.

[0069] In step S210, the client pulls the configuration file from the server; the pulling method can be that the client pulls periodically, or automatically pulls when the application starts, or after the user manually clicks the update button or the update push message, the client sends a configuration file request to the server, and then pulls the configuration file from the server.

[0070] In step S220, the client parses the pulled configuration file to check whether it contains grayscale configuration. Grayscale configuration usually has a specific identifier or is stored in a specific area of ​​the configuration file. Therefore, it is possible to determine whether the configuration file includes grayscale configuration by querying whether there is a preset grayscale field in the parsed configuration file, or by searching a specific area of ​​the configuration file. If the configuration file includes grayscale configuration, the grayscale configuration operation identifier is obtained from the configuration file.

[0071] In step S230, the grayscale configuration is applied in the client, and the client applies the extracted grayscale configuration to the current configuration, overwriting or adding corresponding parameter settings, so that the client uses the new configuration parameters, i.e., the grayscale configuration, in the subsequent operation process. And after overwriting or adding corresponding parameter settings, the grayscale configuration can be deleted to avoid the configuration file becoming larger due to grayscale information.

[0072] The client determines whether the grayscale configuration is effective for the first time. If it is effective for the first time, the grayscale configuration operation identifier is reported to the server. The reporting step can be completed through an asynchronous task, such as through an HTTP request or a specific reporting interface.

[0073] In the implementation process of the above embodiment: through the gradual effectiveness of the gray configuration, the client can smoothly transition to the new configuration, reducing the impact on the user. By reporting the gray configuration operation identifier to the server, the server can collect data on the actual effectiveness of the configuration change to provide support for further decision-making.

[0074] Optionally, in an embodiment of the present application, if the configuration file includes a grayscale configuration, obtaining a grayscale configuration operation identifier from the configuration file includes:

[0075] Parse the configuration file and query whether there is a preset grayscale field in the parsed configuration file. The preset grayscale field is agreed upon by the server and the client and is used to identify the area containing grayscale configuration information. For example, the grayscale configuration may be stored in fields such as "_gray", "_sdk" or "experiment".

[0076] If there is a preset grayscale field in the configuration file, verify whether the grayscale configuration in the configuration file is valid. Verify the validity of the grayscale configuration, including at least one of version verification, timestamp verification, or integrity verification; wherein, version verification refers to confirming that the version of the grayscale configuration is compatible with the client. Timestamp verification refers to checking the effective time and expiration time of the grayscale configuration, and confirming that the current time is within the validity period of the grayscale configuration. Integrity verification refers to ensuring that the grayscale configuration contains all necessary information, such as the grayscale configuration operation identifier and the new configuration value.

[0077] When confirming that the grayscale configuration is valid, the client extracts the grayscale configuration operation identifier from the grayscale configuration part. For example, the client can traverse all items in the grayscale configuration and find the configuration item containing the grayscale configuration operation identifier.

[0078] As an implementation manner, the grayscale configuration operation identifier extracted by the client may be a field value, and the field value is a unique identifier for identifying a configuration change version.

[0079] In the implementation process of the above embodiment: by verifying the validity of the grayscale configuration, the client can avoid invalid or malicious configuration information, and by accurately extracting and reporting the grayscale configuration operation identifier, the client can accurately implement the grayscale release strategy.

[0080] Optionally, in the embodiment of the present application, the grayscale configuration includes a grayscale end time; and determining the grayscale configuration as the current configuration includes:

[0081] Determine the current operation time of obtaining the gray configuration operation identifier from the configuration file; when the client obtains the gray configuration information, it records the current timestamp as the current operation time. This can be achieved through the API provided by the system to ensure the accuracy of the time.

[0082] If the current operation time does not exceed the grayscale end time, the grayscale configuration will be determined as the current configuration, overwriting or adding corresponding parameter settings. If the current operation time exceeds the grayscale end time, it means that the grayscale configuration has expired, and the client will ignore the grayscale configuration and continue to use the original configuration or wait for the new configuration to be updated.

[0083] In the implementation process of the above embodiment: by comparing the current time with the grayscale end time, the client can accurately control the grayscale configuration effective time to ensure that the configuration change is carried out as planned. It can also prevent outdated configurations from being applied incorrectly, reducing potential risks caused by configuration errors.

[0084] Optionally, in an embodiment of the present application, when the grayscale configuration takes effect for the first time, reporting the grayscale configuration operation identifier to the server includes:

[0085] Determine whether the grayscale configuration operation identifier is recorded locally on the client. For example, the client maintains a record set locally, and the record set is used to store the grayscale configuration operation identifier (opsId) that has taken effect. This set can be a data structure in memory, or a persistent storage such as a database, file system, etc. Each electronic device corresponding to a client records the effectiveness of its own configuration. If the effective configuration file includes the grayscale configuration, the grayscale configuration operation identifier of the grayscale configuration also needs to be recorded. It is understandable that different users access the App at different times, and the pulled configuration files may be different, so different grayscale configurations will take effect, which improves the randomness of the grayscale configuration.

[0086] When the client obtains the grayscale configuration operation identifier from the configuration file, it checks whether the grayscale configuration operation identifier already exists in the local record set. For example, a query operation can be performed first, and the client queries the local record set for a specific grayscale configuration operation identifier.

[0087] If it is not recorded locally on the client, it is determined that the grayscale configuration is effective for the first time, and the grayscale configuration operation identifier is reported to the server. If it is recorded locally on the client, it is determined that the grayscale configuration is not effective for the first time, and there is no need to report the grayscale configuration operation identifier to the server.

[0088] If it has been recorded locally on the client, it means that this grayscale configuration has been effective on the client before. If it has not been recorded, it means that this is the first time that the grayscale configuration has been effective on the client. If the grayscale configuration operation identifier has not been recorded, the client adds this grayscale configuration operation identifier to the local record collection and initiates a network request to report the grayscale configuration operation identifier to the server. If the grayscale configuration operation identifier has been recorded, the client does not perform the reporting operation because this grayscale configuration has been reported before. To avoid repeated counting on the server, the reporting operation is not performed. In this way, the server only needs to count the number of effective clients for the configuration file based on the number of reports of the received grayscale configuration operation identifiers, without having to store specific device information, saving storage resources on the server.

[0089] In the implementation process of the above embodiment: by reporting the grayscale configuration operation identifier only when it takes effect for the first time, each client only reports the grayscale configuration operation identifier that takes effect for the first time once, and the server can obtain the accurate number of grayscale configurations that take effect, so as to more accurately evaluate the effect of grayscale release. Avoiding repeated reporting of the same grayscale configuration operation identifier can reduce unnecessary network traffic and server load, and improve system efficiency.

[0090] In an optional embodiment, the server generates a configuration file according to the grayscale configuration, and the client pulls the configuration file from the server. The client parses the pulled configuration file to check whether it contains the grayscale configuration, and if the configuration file contains the grayscale configuration, obtains the grayscale configuration operation identifier from the configuration file.

[0091] The client determines the current operation time of the grayscale configuration operation identifier obtained from the configuration file; if the current operation time does not exceed the grayscale end time, the grayscale configuration is applied in the client. Then, it is determined whether the grayscale configuration operation identifier is recorded locally on the client; if not, it is determined that the grayscale configuration is effective for the first time, and the grayscale configuration operation identifier is reported to the server.

[0092] The server receives the grayscale configuration operation identifier reported by the client, and counts the number of effective clients for which the configuration file is effective according to the number of grayscale configuration operation identifiers received. In this process, the number of grayscale configuration operation identifiers reported can also be verified twice to filter out clients that are not actually effective, and the filtered data is used as the number of effective clients.

[0093] The server determines whether the number of effective clients received meets the conditions according to the preset grayscale quantity requirements. If the grayscale quantity requirements are met, it means that the grayscale release phase can be ended. Therefore, the server can offline the configuration file that currently contains the grayscale configuration to prevent subsequent clients from pulling the file containing the grayscale configuration. If the grayscale quantity requirements are not met, the grayscale end time is dynamically updated according to the number of effective clients. The grayscale configuration can adapt to different user activity and response speed, and there will be no waste of resources due to premature termination of grayscale release, or the number of grayscale configuration users will exceed expectations due to late termination, making the management of grayscale configuration more scientific and accurate.

[0094] See also Figure 3 The structure diagram of the first grayscale configuration device provided by the embodiment of the present application is shown; the embodiment of the present application provides a first grayscale configuration device 300, which is applied to the server, including:

[0095] The configuration file generation module 310 is used to generate a configuration file according to the grayscale configuration; the grayscale configuration includes a grayscale configuration operation identifier; the grayscale configuration operation identifier is used to identify a version of a configuration change;

[0096] The receiving identification module 320 is used to receive the gray configuration operation identification reported by the client, and count the number of effective clients for which the configuration file is effective according to the number of reported gray configuration operation identifications received; the gray configuration operation identification is sent after the gray configuration of the client is first effective;

[0097] The judgment module 330 is used to take the configuration file including the grayscale configuration offline if the number of effective clients meets the grayscale number requirement, so that subsequent clients cannot pull the configuration file including the grayscale configuration.

[0098] Optionally, in an embodiment of the present application, the grayscale configuration device 300, the grayscale configuration includes a grayscale end time; the judgment module 330 is specifically used to judge whether the grayscale quantity requirement is met according to the number of effective clients; if the grayscale quantity requirement is met, the configuration file including the grayscale configuration is taken offline; if the grayscale quantity requirement is not met, the grayscale end time is dynamically updated according to the number of effective clients, so that subsequent clients determine whether to perform grayscale configuration based on the updated grayscale end time.

[0099] Optionally, in an embodiment of the present application, the grayscale configuration device 300 and the judgment module 330 are specifically used to calculate the time interval between the start time of generating the configuration file and the current time of obtaining the number of effective clients; the time interval represents the length of time the grayscale process has been carried out; the number of active users per unit time is determined according to the number of effective clients and the time interval; the remaining grayscale amount is obtained based on the preset grayscale amount and the number of effective clients; the estimated remaining time is determined based on the remaining grayscale amount and the number of active users per unit time; and the grayscale end time is dynamically updated according to the estimated remaining time calculated in real time.

[0100] See also Figure 4 The structure diagram of the second grayscale configuration device provided in the embodiment of the present application is shown; the embodiment of the present application provides a second grayscale configuration device 400, which is applied to a client and includes:

[0101] Pull configuration module 410, used to pull configuration files from the server; the configuration files include parameter information required during the operation of the client application;

[0102] The extraction identification module 420 is used to obtain the grayscale configuration operation identification from the configuration file if the configuration file includes the grayscale configuration; the grayscale configuration operation identification is used to identify the version of the configuration change;

[0103] The reporting module 430 is used to apply the grayscale configuration in the client, and report the grayscale configuration operation identifier to the server when the grayscale configuration takes effect for the first time.

[0104] Optionally, in an embodiment of the present application, the grayscale configuration device 400, the extraction identification module 420, is specifically used to parse the configuration file, and query whether there is a preset grayscale field in the parsed configuration file; if so, verify whether the grayscale configuration in the configuration file is valid; if the grayscale configuration is valid, extract the grayscale configuration operation identifier from the configuration file.

[0105] Optionally, in an embodiment of the present application, the grayscale configuration device 400, the grayscale configuration includes a grayscale end time; the reporting module 430 is also used to determine the current operation time of the grayscale configuration operation identifier obtained from the configuration file; if the current operation time does not exceed the grayscale end time, the grayscale configuration is applied in the client.

[0106] Optionally, in an embodiment of the present application, the grayscale configuration device 400 and the reporting module 430 are also used to determine whether the grayscale configuration operation identifier is recorded locally on the client; if it has not been recorded, it is determined that the grayscale configuration is effective for the first time, and the grayscale configuration operation identifier is reported to the server; if it has been recorded, it is determined that the grayscale configuration is not effective for the first time, and there is no need to report the grayscale configuration operation identifier to the server.

[0107] It should be understood that the device corresponds to the grayscale configuration method embodiment described above and can execute the various steps involved in the method embodiment described above. The specific functions of the device can be found in the description above. To avoid repetition, the detailed description is appropriately omitted here. The device includes at least one software function module that can be stored in a memory in the form of software or firmware or solidified in the operating system (OS) of the device.

[0108] See also Figure 5 An electronic device 500 provided in an embodiment of the present application includes: a processor 510 and a memory 520, wherein the memory 520 stores machine-readable instructions executable by the processor 510, and when the machine-readable instructions are executed by the processor 510, the above method is executed.

[0109] Figure 5 The components shown in the figure can be implemented by hardware, software or a combination thereof. The electronic device 500 may be a physical device, such as a server, a PC, etc., or a virtual device, such as a virtual machine, a virtualized container, etc. Moreover, the electronic device 500 is not limited to a single device, but may also be a combination of multiple devices or a cluster consisting of a large number of devices.

[0110] An embodiment of the present application further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above method is executed.

[0111] Among them, the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable red-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, disk or optical disk.

[0112] In several embodiments provided by the embodiments of the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and a part of the module, program segment or code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0113] In addition, the functional modules in each embodiment of the present application can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part.

[0114] The above description is only an optional implementation manner of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the embodiments of the present application, which should be covered within the protection scope of the embodiments of the present application.

Claims

1. A grayscale configuration method, characterized in that: Applied to the server, including: Generate a configuration file according to the grayscale configuration; the grayscale configuration includes a grayscale configuration operation identifier; the grayscale configuration operation identifier is used to identify a version of a configuration change; Receive the grayscale configuration operation identifier reported by the client, and count the number of effective clients for which the configuration file is effective according to the number of reported grayscale configuration operation identifiers received; the grayscale configuration operation identifier is sent after the grayscale configuration of the client is effective for the first time; If the number of effective clients meets the grayscale number requirement, the configuration file including the grayscale configuration will be offline, so that subsequent clients cannot pull the configuration file including the grayscale configuration.

2. The method according to claim 1, characterized in that The grayscale configuration includes a grayscale end time; If the number of effective clients meets the grayscale number requirement, the configuration file including the grayscale configuration will be offline, including: Determining whether the grayscale quantity requirement is met according to the number of valid clients; If the grayscale quantity requirement is met, the configuration file including the grayscale configuration is offline; If the grayscale quantity requirement is not met, the grayscale end time is dynamically updated according to the number of valid clients, so that subsequent clients determine whether to perform grayscale configuration based on the updated grayscale end time.

3. The method according to claim 2, characterized in that Dynamically updating the grayscale end time according to the number of valid clients, including: Calculate the time interval between the start time of generating the configuration file and the current time of obtaining the number of effective clients; the time interval represents the duration of the grayscale process; Determine the number of active users per unit time according to the number of valid clients and the time interval; Based on the preset grayscale quantity and the number of valid clients, obtaining the remaining grayscale quantity; Determine an estimated remaining time based on the remaining grayscale amount and the number of active users per unit time; The grayscale end time is dynamically updated according to the estimated remaining time calculated in real time.

4. A grayscale configuration method, characterized in that: Applied to the client, including: Pull a configuration file from the server; the configuration file includes parameter information required during the operation of the client application; If the configuration file includes grayscale configuration, a grayscale configuration operation identifier is obtained from the configuration file; the grayscale configuration operation identifier is used to identify a version of a configuration change; The grayscale configuration is applied in the client, and when the grayscale configuration takes effect for the first time, the grayscale configuration operation identifier is reported to the server.

5. The method according to claim 4, characterized in that If the configuration file includes grayscale configuration, obtaining a grayscale configuration operation identifier from the configuration file includes: Parsing the configuration file, and querying whether there is a preset grayscale field in the parsed configuration file; If yes, verify whether the grayscale configuration in the configuration file is valid; When the grayscale configuration is valid, the grayscale configuration operation identifier is extracted from the configuration file.

6. The method according to claim 5, characterized in that The grayscale configuration includes a grayscale end time; Applying the grayscale configuration in the client includes: Determine a current operation time for obtaining a grayscale configuration operation identifier from the configuration file; If the current operation time does not exceed the grayscale end time, the grayscale configuration is applied in the client.

7. The method according to any one of claims 4 to 6, characterized in that: When the grayscale configuration takes effect for the first time, reporting the grayscale configuration operation identifier to the server includes: Determining whether the grayscale configuration operation identifier is recorded locally on the client; If it is not recorded, it is determined that the grayscale configuration is effective for the first time, and the grayscale configuration operation identifier is reported to the server; If it has been recorded, it is determined that the grayscale configuration is not effective for the first time, and there is no need to report the grayscale configuration operation identifier to the server.

8. A computer program product, characterized in that The method comprises computer program instructions, and when the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is executed.

9. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the method according to any one of claims 1 to 7 is executed.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is executed.