[0044] Reference figure 2 , Which shows the first embodiment of an application publishing method of this application, including the following steps:
[0045] Step 101: Receive a user request sent by a client, where the user request includes a Uniform Resource Locator (URL, Uniform Resource Locator) to be accessed.
[0046] After receiving the user request sent by the client, the server will pass the user request to the application publishing system. In addition to the URL of the application, the user request may also include information such as a user identification (ID). The application publishing system can read the relevant information in the user request according to actual needs.
[0047] Step 102: Based on the user request information and the application configuration information obtained from the configuration server, the user request information is processed. The processing includes: if the current user meets the conditions for entering the gray release version, rewriting the current user request URL.
[0048] Application configuration information is uniformly managed by the configuration server. The configuration server can store the configuration information of multiple applications and maintain a configuration table to ensure that applications correspond to their respective configuration information. The application server obtains application configuration information in real time through interaction with the configuration server. The application configuration information may include the uniform resource locator corresponding to the application, the rules for rewriting the uniform resource locator, the distribution strategy, and so on.
[0049] Whether the current user meets the conditions for entering the gray-scale release version may be: first determine whether the URL requested by the current user matches the pre-stored URL, and if it matches, the diversion strategy is used to determine whether the current user meets the conditions for entering the gray-scale release version. It can be understood that when judging by the diversion strategy, according to the diversion strategy, other information of the current user can also be obtained to help realize the judgment.
[0050] For example, the diversion strategy may include a general diversion strategy or a specific diversion strategy. General diversion strategies generally include random diversion or diversion based on user ID, and so on. The random distribution strategy is to randomly select users within a set ratio as users who enter the gray release version. At this time, the judgment can be realized only by the URL in the user request. The user ID shunt strategy is to obtain the user ID from the user request. After the ID is processed according to the predetermined rules, the users are grouped according to the processed value. For example, if the ID is mod, the remainder is set The value interval is used to select users who enter the gray release version. The specific diversion strategy can be determined according to the actual situation. For example, grouping according to membership business. Assuming that there are ordinary members, gold members and diamond members, you can set the proportion of these three members to enter the gray release version and other diversion strategy information. At this time, you can identify the group where the user is by obtaining the user ID in the user request To determine whether the user request enters the gray release version.
[0051] It can be understood that this application may also include updating application configuration information. When a new application is released, the publisher can select the general diversion strategy or specific diversion strategy required for grayscale publishing, and add the uniform resource locator and other information of the new application as the new application configuration information to the configuration server. Then update the configuration table and establish data communication with the application server corresponding to the new application to realize the gray release of the new application.
[0052] In addition, updating the application configuration information also includes the modification of the original application configuration information. When the application publisher modifies the application configuration information, for example, when it needs to expand the gray release range, the corresponding shunt strategy can be modified in the configuration server. At this time, the monitoring unit set in the configuration server can monitor the modification operation, and will query the configuration table to obtain the application server corresponding to the modified application configuration information, and then synchronize the modified application configuration information to the application server, thereby Realize the real-time update of the application configuration information in the application server, thereby ensuring the accuracy of the streaming data when the application is released. It can be understood that the configuration information of all applications can be stored in the configuration server, and data synchronization is realized through the configuration server. Reference image 3 After the background management modifies the application configuration information in the configuration server, the monitoring device placed in the configuration server can first monitor the modification operation, find the modified application configuration information, and then synchronize it to the corresponding application server.
[0053] Rewriting the uniform resource locator in the current user request is implemented according to the rules for rewriting the uniform resource locator in the application configuration information, for example, adding an identifier to the uniform resource locator in the current user request. It can be understood that if the current user does not meet the conditions for entering the gray release version, he may not do the processing, or he may rewrite the uniform resource locator in his request. At this time, it can be distinguished by adding different identifiers to the uniform resource locator that conforms to and does not conform. For example, a qualified uniform resource locator is added to a qualified uniform resource locator, and a non-compliant uniform resource locator is added to a non-compliant uniform resource locator. Taking the graypub parameter as an identifier as an example, when the graypub parameter takes different values, they respectively indicate whether they are in compliance. For example, if graypub=0 is attached or there is no such parameter, it means that the graypublished version cannot be entered; if graypub=1 is added, it means that the graypublished version can be entered. In addition, if there are other offloading strategies, for example, according to specific service grouping, the specific service grouping can be represented by adding graypub=x (x is a number greater than 2). For example, setting 2 means ordinary member, 3 means gold member, 4 means diamond member and so on. When graypub=2 is added to the URL, it means that you can enter the gray-scale release version of ordinary members.
[0054] Step 103: Pass the processed URL to the application, and the application determines the version entered by the current user according to the processed URL and application configuration information.
[0055] The application configuration information contains a URL rewriting rule. After the URL is rewritten, the URL can be parsed according to the rewriting rule. After the processing module placed in the application server rewrites the URL, it will pass the user access request to the application. The application will set a specific logic judgment module and contain different versions of the running code. After the application receives the request, it will determine the version code entered by the current user according to the identifier in the URL and the rewrite rule in the application configuration information. For example, taking the rewriting rule of the aforementioned application configuration information as an example, if there is a parameter of graypub=1 in the URL, it is considered that it needs to enter the gray release version. If there is graypub=0 or there is no such parameter in the URL, it is considered that it is not necessary to enter Grayscale release version. For another example, if there is a parameter of graypub=2 in the URL, it is considered that it is necessary to enter the gray release version corresponding to the ordinary member.
[0056] Reference Figure 4 , Which shows the trend of user requests during the implementation of this application. In a specific scenario, the application publishing system determines whether the user request should enter the gray-scale publishing and the URL rewriting can be implemented by apache or nginx placed in the application server.
[0057] First, the user request is routed to an application server through load balancing. The apache/nginx placed in the application server determines whether the current user needs to perform a grayscale release version through the application configuration information obtained from the configuration server. As a result, the URL in the current user request is rewritten, that is, the corresponding gray-scale release rewrite mark is added to the URL. In this example, the gray publishing rewrite flag is the graypub parameter. If graypub=0 or without this parameter, it is considered that the gray publishing version has not been entered; if graypub=1, the gray publishing version is entered; if graypub=x (x is a A number greater than 2) means grouping according to specific services.
[0058] In the application server, when the Web application party receives a request, it first reads the URL requested by the user and makes a judgment based on the application configuration information. If there is a parameter of graypub=1, it is considered that it is necessary to enter the gray release version and control the new code that enters the gray release; if there is no graypub parameter or the graypub parameter is 0, it is considered that it does not need to enter, and the control enters the original code execution; if Graypub is other parameters, which means that it is processed according to the business situation and controlled to enter the corresponding code.
[0059] In this application, application configuration information of various applications that need to be published in grayscale are placed in the configuration server, and each application server only needs to communicate with the configuration server to obtain the corresponding application configuration information. When the application server receives the access request, it can make real-time judgments based on the configuration information and the user request information to determine the version the user has entered. Through the configuration server in the background, the application configuration information of each application can be modified in real time, such as the threshold value in the shunt strategy, etc., which can accurately control the scope and accuracy of gray release. For example, when the scope of gray-scale publishing of an application needs to be expanded from 20% to 50%, there is no need to re-modify the publishing environment of the application server, and there is no need to add or remove application servers. You can directly modify the application configuration information in the configuration server. Then, through the data communication between the configuration server and the application server, the modified application configuration information is synchronized to the corresponding application server. There is no need to change the test environment and application server in this way, which reduces the complexity of gray release and improves the versatility of gray release. In addition, the configuration server can store application configuration information of multiple applications, and establish data communication with multiple application servers respectively, and the configuration information of each application can be managed and maintained uniformly, reducing the cost of gray release.
[0060] Reference Figure 5 , Which shows the first embodiment of the application publishing system of the present application, including a user request receiving module 10, a configuration information acquiring module 50, a processing module 20, and a request transmitting module 30.
[0061] The user request receiving module 10 is configured to receive a user request sent by a client, and the user request includes a uniform resource locator to be accessed.
[0062] The configuration information obtaining module 50 is used to obtain application configuration information in the configuration server.
[0063] The processing module 20 is configured to process the current user request based on the user request information and the application configuration information obtained from the configuration server. The processing includes: if the current user meets the conditions for entering the gray release version, then rewrite the current The uniform resource locator in the user request. Preferably, the processing module 20 further includes a judging unit for judging whether the uniform resource locator of the current user matches the uniform resource locator in the application configuration information, and if they match, judge whether the current user is eligible for entry according to the shunt strategy. Conditions for the grayscale release version.
[0064] Preferably, the processing module 20 further includes an identification adding unit. If the current user meets the conditions for entering the gray-scale release, then the compliant identification is added to the uniform resource locator requested by the current user, otherwise, the non-compliant identification is added to the current user's request. In the uniform resource locator; or if the current user meets the conditions for entering the gray release, the mark is added to the uniform resource locator requested by the current user, otherwise, no processing is performed.
[0065] Specifically, the processing module can write the corresponding parameter to the uniform resource locator according to the rule of rewriting the uniform resource locator in the predetermined application configuration information. For example, if graypub=0 or not adding this parameter, it means that no access is allowed. Gray release version; if graypub=1 is attached, it means that it can enter the gray release version. In addition, if there are other offloading strategies, for example, based on specific service groupings, you can add graypub=x (x is a number greater than 2) to indicate specific service groupings.
[0066] The request delivery module 30 is used to deliver the processed uniform resource locator to the application, and the application determines the version entered by the current user according to the processed uniform resource locator and application configuration information.
[0067] Preferably, the application publishing system further includes a monitoring module for monitoring modification operations of the application configuration information in the configuration server, and querying the application server corresponding to the modified application configuration information, and then synchronizing the modified application configuration information to the application server. Among them, a configuration table may be maintained in the configuration server to record all the applications stored therein, the configuration information corresponding to each application, and the application server corresponding to the application. When it is monitored that the application configuration information is updated, the application server corresponding to the application is queried, and the updated application configuration information is synchronized to the application server.