Detailed Description
Aiming at the description content of the background art, the application provides that after the configuration file is modified, a plurality of production environment servers deployed at the service end of the whole system can be not restarted to finish loading the modified configuration file, so that the gray level operation steps are simplified, the gray level release efficiency is improved, and the gray level effect of modifying a large amount of files aiming at the production environment servers is simply and quickly realized.
In practical application, for a plurality of production environment servers of a system server, different machine rooms can be deployed, so that in the process of realizing application upgrading and gray level release, one or more servers can be designated to perform gray level validation of configuration files according to practical conditions, and when the configuration files are in error, the online service and user experience are not affected in a large area, and if the production environment servers which do not participate in gray level release of the configuration files at this time are still available for access of a user client, corresponding application services are improved for users.
The following description of the embodiments of the present application will be made with reference to the accompanying drawings, in which it is to be understood that the embodiments described are merely some, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
It is to be understood that the terms "system," "apparatus," "unit," and/or "module" as used herein are one means for distinguishing between different components, elements, parts, portions, or assemblies at different levels. However, if other words can achieve the same purpose, the word can be replaced by other expressions.
As used in the specification and in the claims, the terms "a," "an," "the," and/or "the" are not specific to a singular, but may include a plurality, unless the context clearly dictates otherwise. Generally, the terms "comprises" and "comprising" merely indicate that the steps and elements are explicitly identified, and they do not constitute an exclusive list, as other steps or elements may be included in a method or apparatus. The inclusion of an element as defined by the phrase "comprising one does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises an element.
In the description of the embodiments of the present application, unless otherwise indicated, "/" means or, for example, a/B may represent a or B, and "and/or" herein is merely an associated relationship describing an associated object, and means that there may be three relationships, for example, a and/or B, and that there may be a alone, a and B together, and B alone. In addition, in the description of the embodiments of the present application, "plurality" means two or more than two. The following terms "first", "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature.
In addition, flowcharts are used in the present application to illustrate the operations performed by systems according to embodiments of the present application. It should be appreciated that the preceding or following operations are not necessarily performed in order precisely. Rather, the steps may be processed in reverse order or simultaneously. Also, other operations may be added to or removed from these processes.
Referring to fig. 1, in order to implement a schematic structural diagram of an alternative embodiment of a gray level distribution system of the gray level distribution method provided by the present application, the system may be suitable for gray level distribution of content such as code files and configuration files of new products (such as certain application programs and services) to be developed, and may also be suitable for gray level distribution of modification of configuration files and/or code files for implementing product upgrade in an existing product upgrade application scenario, where the present application does not limit the actual application scenario.
As shown in fig. 1, the system may include, but is not limited to, a file identification control system 110, a packing and publishing system 120, an operation management platform 130, a file server 140, and a system server with a plurality of production environment servers 150 deployed therein, wherein:
The file identifier control system 110 may be configured to receive an update file of any product sent by the client, and an update file identifier corresponding to the update file. It should be noted that, different clients may send update files and their update file identifiers of different products, and the update files and their update file identifiers may be configured by the same or different product developers, so that the implementation process is not limited by the present application.
In the embodiment of the present application, the file identification control system 110 may also be referred to as a code repository, taking the open-source distributed version control system, i.e. Git, as an example, and in the case that a developer needs to update a code file and/or at least one configuration file of a target application, the developer may clone an original code file and an original configuration file of the target application from a corresponding production environment server to a local terminal device, so that the developer can modify the corresponding original file to obtain a modified code/configuration file. Alternatively, the developer may directly write a new code file and/or configuration file, as an update file, request to be updated to run on the production environment server, implement operation and maintenance of an application function, etc., and the present application does not limit how the developer implements the update implementation process of the code file and/or configuration file of the target application, including but not limited to the two implementations described above.
In some embodiments, in a scenario that a large batch of configuration files of a target application need to be modified and updated, in order to improve update efficiency, the update task may be divided into a plurality of subtasks and distributed to different developers, the modification of a part of the configuration files in the large batch of configuration files is implemented by the different developers and sent to a code warehouse for caching, and compared with the modification of the large batch of configuration files implemented by one developer, the work efficiency is improved.
After each modification of the code file and/or the configuration file of the target application, the corresponding update file identifier can be configured for the obtained corresponding update file to be different from the original file identifier of the original file of the target application, so that the update code identifier can be configured for the update code file, and the update configuration identifier can be configured for the update configuration file. Alternatively, the file identifier may be recorded as Tag, and may be a file version number, for example v1.0.0, etc., where the content of the file identifier and the representation mode of the file version number are not limited in the present application, and may be determined according to circumstances.
In some embodiments, after the developer submits the updated file to the file identification control system 110 (e.g., the code repository Git), a test tool or a tester may test the updated file, for example, to detect whether the updated file is configured for the target application, whether the file format meets the preset requirements, etc., and the present application does not limit the test implementation process of the updated file, as the case may be. After passing the test, the configuration update file identification Tag is sent to initiate the update online production environment server application, namely the update instruction aiming at the target application.
The packaging and publishing system 120 may be a system used by an operator to perform automatic construction and deployment, and may be supported by a packaging and publishing server, where the packaging and publishing system and the file identification control system may be integrated in the same computer device, such as a rule server, according to an application requirement, so as to implement a processing procedure before publishing a product or an updated file thereof.
In the embodiment of the present application, after the application developer completes modification of the code file and/or the configuration file thereof according to the method described above, and obtains the corresponding update file (such as all configuration files including at least one modified configuration file and/or all code files including at least one modified code file), the content of the update file needs to be updated to the production environment server (i.e. the production environment server) of the product. As described above, the package publishing system 120 may receive the update instruction for the target application sent by the file identification control system 110, respond to the update instruction, pull the update file corresponding to the update file identification carried by the update instruction, such as the update code file and/or the update configuration file corresponding to the Tag, from the file identification control system 110, compress the pulled update file into at least one update file package according to the update file identification, and output the at least one update file package, such as compressing all code files and all update configuration files corresponding to the Tag into one update code package, that is, a system start package, compress all update configuration files corresponding to the Tag into one update configuration package, naming the update file package with the update file identification, and then upload the obtained update file package to the file server 140 for storage.
Optionally, for the above process of packaging the update files, a preset compression algorithm may be used to compress a plurality of update files into a compression packet with a preset format, such as a zip compression file, which is not limited in the implementation method of compression of the update files. The update files of the same type have the same update file identifier, so that the names of the update file packages obtained through compression are guaranteed, and the file version types of the update files contained in the update file packages can be determined.
The operation management platform 130 may be configured to respond to the gray state configuration operation and output the obtained gray information, and it needs to be described that the gray information may be used to indicate a production environment server where a file to be updated of a target application (such as an application program) is located, and an update relationship between a code package (which may include an original code file and an original configuration file of the target application) of the production environment server and the configuration package, so that a system server may determine, according to the gray information, one or more production environment servers that participate in the file update operation of the target application at this time, and further enable the determined production environment server to pull, according to the content of the gray information, a required update file load from the file server 140.
It can be seen that, according to the update file configured by the developer and the update file identifier thereof, the developer logs in the operation management platform 130 to configure corresponding gray information, for example, only at least one configuration file of the target application needs to be modified at this time, after the update configuration file (i.e. all configuration files supporting the operation of the target application) is obtained, the corresponding update configuration identifier, such as v1.0.1, is configured, before that, the original code file of the target application and the original file identifier of the original configuration file, that is, the names of the original code package (i.e. the original system enabling package) and the original configuration package may be v1.0.0, so that, in order to ensure the normal operation of the target application, the present application needs to configure the update code identifier and the update configuration identifier corresponding to the name of the original code package, thereby determining the gray state relationship between the original code identifier of the original code file in the original code package and the update configuration identifier of the update configuration file, that is needed to load the original code file corresponding to the original code identifier in the gray level validation process, and the update configuration file corresponding to the update configuration file, that the update configuration file and the update configuration file corresponding to the original code identifier of the original code package may not be limited by the implementation of the method of loading the code and the configuration file.
Similarly, for other updated scenes of the target application, such as the situation that the code file and the configuration file of the target application need to be updated, or only the code of the target application is updated, the corresponding gray information can be configured according to the above-described mode. The names and contents of the configured gray information are often different for different update relationships (i.e. corresponding to the different scenes), and the code update related to the target application is often required to be determined according to the actual update requirement of the application.
It should be noted that, for the update file identifier, after the developer obtains the file to be distributed, the update file identifier may be set in the file identifier control system directly, or after logging in the operation management platform, the update file identifier corresponding to each file to be distributed of the currently existing target application is configured. In addition, when the gray information needs to be configured, a developer can log in the operation management platform, set the update configuration identification of the corresponding update configuration file according to the code identification of the code file of the target application of each production environment server, obtain the update gray information of the corresponding production environment server, and send the update gray information to the file server for storage after checking by operation and maintenance personnel.
In some embodiments, different production environment servers deployed in different machine rooms may be an organization structure of a system server deployed by three dimensions, i.e., a machine room, a cluster, and a server, and for one or more dimension effective ranges of updating and upgrading a target application, a corresponding name may be configured according to a preset gray information naming rule, so that a production environment server that needs to be updated may be determined subsequently. The grayscale information naming convention may include, but is not limited to, code_config- $ { DC } - $ { CLUSTER } - $ { SERVER }. Properties.
Based on this, if only a certain enterprise of the target application (for other enterprises, the present application is described by taking aliyun as an example, the enterprise name location in the following names may be replaced by the enterprise name location) is effective for 1.1.1.1.1 of the physical machine room or the prod1 cluster of the cloud machine room, when the gray information can be configured on the operation management platform, the name of the gray information can be determined to be code_configuration-aliyun-prod 1.1.1.1.properties, if the gray information can be effective for all the production environment servers in the prod1 cluster of the enterprise machine room, the name of the gray information can be code_configuration-aliyun-prod 1.properties, if the gray information can be configured for all the production environment servers in all the clusters of the enterprise machine room, and if the gray information can be code_configuration-aliyun.properties.
It should be noted that, if one or more production environment servers in one or more clusters supporting two or more enterprise machine rooms take effect, the names of the corresponding gray information can still be determined according to the naming method described above, which is not described in detail herein.
The file server 140 may be a file storage system for storing the code package, the configuration package, and the gray information content of the resulting target application according to the above-described packaging processing method. It can be understood that under the initial condition, i.e. the development of the target application is completed, when the first gray level is released, the file identifiers of various files of the target application are the same and can be recorded as Tag1, such as v1.0, as described above, the packaging release system packages the code files and the configuration files of the target application, the names of the obtained code packages and the obtained configuration packages can be Tag1, and at the moment, the content of the initial gray level information can be empty, so that the system server can pull the code files and the configuration files corresponding to the Tag to load and operate according to the content, and each production environment server can support the functions of the target application, thereby meeting the functional use requirements of the user client for accessing the production environment server and the target application.
After that, if the original code file and/or configuration file of the target application need to be updated, the new product can be considered to be released, and the method can still be performed according to the above-described method, therefore, taking the code file and the configuration file both need to be modified as an example for description, the Git can set a new file identifier for the updated code file and the updated configuration file after modification by the developer, and record the new file identifier as Tag2, for example, v2.0, a compressed package obtained by packing and naming the updated code file and the updated configuration file (namely, the name of Tag 2) by the push packing and releasing system is sent to the file server, and at this time, the content of gray information can still be empty, which indicates that the production environment server can pull the file in the newly-formed system enabling package for loading operation.
If only the configuration file needs to be updated, the update configuration identifier Tag3 of the update configuration file is analyzed as described above, the update configuration package named Tag3 is sent to the file server for storage, meanwhile, because the configuration file of the original code file required to be loaded by the production environment server to run the target application changes at this time, the developer is required to configure the gray information representing the update relationship.
It should be noted that, in the case where only the update code is required, the implementation process is similar to the implementation process of updating the code file and the configuration file together, and the present application will not be described in detail. In practical application, in the process of running the code file of the target application by the production environment server, the gray information can be read at regular time according to preset logic, and the latest configuration file is pulled from the file server to be loaded and executed according to the relation file contained in the gray information, so that the implementation process is not described in detail.
Therefore, the file server in the application is not only used for storing the content sent by the packaging and publishing system and the operation management platform, but also can respond to the file pulling request of the production environment server so as to meet the pulling requirement of the production environment server on the latest file of the target application to be loaded, and the realization process can refer to the gray level publishing method described in the embodiment from the file server side.
In combination with the above description, the application can deploy a plurality of production environment servers contained in the system server in different machine rooms, and each machine room can deploy at least one production environment server. In practical application, the server organization structure of the system server may be divided into three layers, namely, physical machine rooms and/or cloud machine rooms of different enterprises, different types of clusters, different independent servers and the like, wherein each production environment server may provide the function of the target application by loading the code file and the configuration file of the target application, and the implementation process may refer to the gray level publishing method described in the following embodiments from the production environment server side.
Referring to fig. 2, a flowchart of an alternative example of the gray scale distribution method according to the present application may be implemented by the file server of the above system, and the execution content of other constituent devices of the system may be combined with the description of the corresponding parts of the context in the implementation process of the gray scale distribution method. As shown in fig. 2, the method may include:
step S21, at least one updated file packet aiming at a target application is obtained;
In combination with the above description of the technical solution of the present application, after the client of the local device may obtain all code files and all configuration files of the target application from the file server, the developer may modify the code files and/or configuration files of the target application output by the client according to the actual update requirement, so as to obtain updated code files and batch configuration files, and record the updated code files and batch configuration files as files to be distributed. For convenience of description, in the application, the configuration file modified by the developer in the batch configuration file is recorded as a first configuration file, and other configuration files in the batch configuration file are recorded as second configuration files. It can be seen that the file to be distributed may include a batch configuration file composed of the updated first configuration file and the second configuration file that is not updated (i.e., all configuration files supporting the running of the target application), or all the updated code files and the batch configuration files referenced by them.
The developer needs to update the code or the configuration file to the production environment server after finishing the modification of the code or the configuration file each time, so that a new version number can be configured for the version of the modification in order to be different from the code file and the configuration file before the modification, namely, the configuration update file identification Tag, and the implementation mode and the content thereof are not limited.
And then, the local client can send the obtained file to be distributed to a packaging and distributing system, the packaging and distributing system packages the file to be distributed to obtain at least one corresponding update file package, and configures an update file identifier for the corresponding file to be distributed. The method comprises the steps of obtaining a batch configuration file, packing the batch configuration file obtained after updating into a compressed file, marking the compressed file as a configuration package, packing all the code files after updating and the batch configuration files referenced by the code files (namely all the configuration files) into a compressed package, marking the compressed package as a code package (also called a system enabling package), naming the configuration package as an updating configuration identifier of a first configuration file, and naming the code package as an updating code identifier of an updating code file.
After obtaining one or two update file packages, the packaging and publishing system can report the update file packages to a file server for storage according to the method described above, and wait for the production environment server of the target application to pull the required file to run. The application does not limit the storage mode of the file server for updating the file package, and can be determined according to the situation.
In summary, the update file package obtained by the file server is generated by packaging the obtained file to be distributed after updating at least one first configuration file in the code file and/or batch configuration file of the target application, and has an update file identifier configured for the file to be distributed, such as an update configuration identifier and an update code identifier.
Step S22, receiving updated gray information sent by an operation management platform of a target application;
And continuing the analysis, in order to clearly determine the relation between the current modification of the code file and/or configuration file of the target application by the developer and the code file and configuration file of the target application previously operated by the production environment server, so that the latest configuration file is accurately pulled from the file server when the latest code of the target application is operated by the production environment server. The developer may log into the operation management platform of the target application to configure update gray information for indicating a production environment server of the target application needs to be updated, and a latest code file and a latest batch configuration file of the target application to be loaded by the production environment server. Alternatively, the configuration update gray information may include a correspondence between an update code identifier of the latest code of the production environment server and an update configuration identifier of the latest configuration file, which may be denoted as a gray state relationship.
And then, checking whether the content of the update gray information is correct or not by the file server or other devices in the system, for example, checking whether the content of the uploaded update gray information is correct or not according to the reported update file package content and the update file identifier of the update file package content, for example, checking whether a production environment server of a target application to be updated is correct or not, and checking whether the corresponding relation between the update code identifier of the latest code of the production environment server and the update configuration identifier of the latest configuration file is correct or not, and the like.
Step S23, storing at least one update file package and update gray information;
In the embodiment of the application, the file server is used as a file storage system, and can store each updated file packet reported by the packet issuing system, updated gray information pushed by the operation management platform and the like, for example, the received information can be distributed to a target storage space of a target application for storage, and the application is that the data storage mode of the file storage system is not limited.
It will be appreciated that the file server stores an initial code package (including an initial code file and all initial configuration files) and an initial configuration file package that are first released by the target application, and initial gray information that can characterize a file identification relationship between the two and each production server that executes the target application, and the implementation process of transmitting these contents to the file server for storage is similar to the implementation process described in the above steps, which is not described in detail in the present application.
Step S24, a file pulling request for a target file to be distributed, which is sent by a first production environment server, is received;
In combination with the above description of updating the gray information content, for each production environment server of the target application, the production environment server in which the gray release takes effect can be determined according to the gray information name configured on the operation management platform by the developer of the target application, and the production environment server is recorded as the first production environment server, which can be one or more servers in one or more dimensions among a machine room, a cluster and a server IP, and can be determined according to the actual application requirements.
When executing the target application, any production environment server of the target application can periodically poll the update gray information of the target application stored on the file server, determine whether the target application belongs to the first production environment server according to the name or the content of the update gray information, if not, still execute the code file and the configuration file before updating the target application to realize the original function of the target application, and if the target application belongs to the first production environment server, execute the latest code, and also generate a file pulling request for the update configuration identifier corresponding to the update code identifier of the code of the first production server according to the corresponding relation between the update code identifier of the latest code file contained in the update gray information and the update configuration identifier of the latest configuration file, so as to request to pull the configuration package of the latest configuration file with the update configuration identifier from the file server and load the configuration package.
It can be seen that, when the first production environment server executes the target application, a file pulling request with the above content may be generated based on the content of the updated gray information, and the file pulling request is sent to the file server to request to pull the latest configuration file corresponding to the code when the first production environment server executes the target application, where the configuration file pulling process may be implemented according to the pre-configured processing logic for implementing the pulling function, that is, when the first production environment server runs the code of the target application, the configuration file pulling operation may be performed on the file server according to the processing logic, so as to ensure that the loaded configuration file is the latest configuration file of the target application.
In step S25, in response to the file pulling request, a target update package containing the requested target file to be distributed is issued to the first production environment server for execution.
After receiving a file pulling request sent by a first production environment server, the file server can analyze the file pulling request to obtain an update configuration identifier of a latest configuration file which the first production environment server wants to pull and/or an update code identifier of a latest code file, and other target update file identifiers, and after each configuration file comprises a configuration file provided with a configuration identifier of the file server and each code file comprises a code identifier corresponding to the configuration file, the file server can query a configuration package with the update configuration identifier from stored configuration packages and issue the queried configuration package to the first production environment server for execution. Similarly, the code package with the updated code identifier can be queried from the stored code package and then issued to the first production environment server for execution.
It should be noted that, in the process that the first production environment server pulls the target update package from the file server according to the above-described method, if the update gray information does not include the correspondence between the code identifier and the configuration identifier (i.e., the relationship file), or the code identifier of the correspondence is inconsistent with the update code identifier of the code of the first production server itself, it may actually be unnecessary to pull a separate configuration package from the file server, and may pull the configuration file in the code package where the code of the first production environment server itself is located, if the code package is already obtained, the code package may be directly executed, so that the implementation process is not limited, and may be determined according to circumstances.
In summary, in the embodiment of the application, after the code file and/or the configuration file of the target application need to be modified, the developer performs packaging processing on the update file in a packaging and publishing mode, obtains corresponding update file packages and sends the update file packages to the file server for storage, and simultaneously configures corresponding update gray information, so that the first production environment server can send a file pulling request for the target file to be published to the file server accordingly, the file server directly sends the corresponding target update file packages (which contain the requested target file to be published) to the first production environment server for execution, the purpose of updating the file effect is achieved without restarting the production environment server, the development flow is simplified, the development efficiency is improved, the development cost is reduced, the gray effect of updating the file according to each first production environment server of the target application is supported, the reliability of gray modification and the system stability are improved, the function also avoids the problem of enlarging the return influence when the gray effect is caused, namely, the original file pulling and the service area is still not influenced when the update is in error.
Referring to fig. 3, a signaling flow diagram of a further alternative example of the gray scale distribution method according to the present application may be a detailed description of the gray scale distribution method described in the above embodiment, but is not limited to this detailed implementation method described in the present embodiment, and as shown in fig. 3, the method may be as follows:
Step S31, the file identification control system responds to an update request of the target application, and updates at least one first configuration file in a code file and/or a batch configuration file of the target application to obtain a file to be distributed of the target application;
In the practical application of this embodiment, a developer may start a client on an electronic device, log in a file identifier control system, obtain all code files and configuration files of a target application, that is, obtain and output the content of a code packet of the target application, and modify the code files and/or configuration files thereof according to the update requirement of the target application.
Wherein, the target application usually has batch configuration files, when the target application modifies the batch configuration files, one or more configuration files can be modified, the modified configuration files can be recorded as first configuration files, and unmodified configuration files can be recorded as second configuration files for convenience of description. If the file to be distributed is a configuration file, the configuration file comprises all updated first configuration files and all second configuration files, namely all configuration files required by supporting the target application, and if the file to be distributed is a code file, the file to be distributed can comprise all codes and all configuration files after modification.
Step S32, the file identification control system configures corresponding updated file identifications for the obtained different files to be distributed;
step S33, the file identification control system sends the updated file identification to the packaging and publishing system;
After the modification of the code and/or the configuration file of the target application is completed in the above-described manner, the target application with a new version can be considered to be obtained, and in order to distinguish the code file and the configuration file before modification, the corresponding update file identification Tag can be configured for the file to be distributed, which is obtained after modification, such as configuring a new version number and the like.
Step S34, the packaging and publishing system determines that the update file identifier contains an update configuration identifier, pulls batch configuration files corresponding to the update configuration identifier from the file identifier control system, and performs packaging processing to obtain an update configuration package with the update configuration identifier;
Step S35, the packaging and publishing system determines that the update file identifier contains an update code identifier, pulls all code files corresponding to the update code identifier and batch configuration files referenced by the code files from the file identifier control system to carry out packaging treatment, and obtains an update code package with the update code identifier;
The packaging and publishing system is used as an automatic construction and deployment system, after the update file identification Tag is obtained, the code file and the configuration file corresponding to the Tag can be pulled down, an update configuration package and an update code package are generated through packaging naming, the update configuration package can comprise all first configuration files and all second configuration files, and the update code package can comprise all code files and all configuration files after updating.
In practical application of the present application, according to the method described above, in the process of online code of the target application, a packing tool such as maven or ant may be used to obtain a compressed packet in a zip or jar format, for example, the update configuration packet and the update code packet described above, but the method is not limited to the packing implementation method described in this embodiment.
It may be understood that if only at least part of the configuration files of the target application need to be modified, an update configuration identifier for identifying the update configuration files of the target application may be determined according to the method described above, and all configuration files corresponding to the update configuration identifier, that is, all configuration files supporting the operation of the updated target application, may be packaged to obtain an update configuration package, and the update configuration package may be uploaded to the file server for storage by forming a name of the update configuration package by the update configuration identifier.
If only the code file of the target application needs to be modified, the processing mode is similar, the corresponding update code identifier can be configured for the modified code file, the updated code file and the configuration file are packaged into an update code package, the update code package is formed by the update code identifier, the update code package is uploaded to the file server, and the update code package and the configuration package can be formed according to the mode described above, so that the application is not limited to the above.
If both the code file and the configuration file of the target application need to be modified, an updated code package and an updated configuration package can be obtained according to the method described in this embodiment, and the original code package and the original configuration package before modification stored in the file server are distinguished by including the name corresponding to the identifier of the updated file. Step S36, the packaging and publishing system sends the obtained update code package and update configuration package to a file server;
Step S37, the operation management platform responds to the gray level configuration request aiming at the target application, and determines a first production environment server used for indicating the target application to be updated and update gray level information of the corresponding relation between the update code identification and the update configuration identification of the latest code file of the first production environment server;
Step S38, the operation management platform sends the obtained updated gray information of the target application to the file server;
In the case of different modification scenarios of the code file and/or configuration file of the target application, the content of the configured updated gray information is often different, that is, the corresponding relationship (i.e., gray state relationship) between the code identifier for indicating that the production environment server itself supports the latest code of the target application and the configuration identifier of the latest configuration file is different, and the content of the updated gray information may be determined in combination with the method described above.
Regarding the developer to configure corresponding gray state relations for different production environment servers, an implementation process of updating gray information is constructed, operation and maintenance personnel verify the updated gray information, and after determining that the content, name and other information of the updated gray information are correct, the information is sent to a file server, and the implementation process is not described in detail herein.
Step S39, the file server stores the received update code package, update configuration package and update gray information;
step S310, a first production environment server loads a code file in an update code package of a target application, and generates a file pulling request according to update gray information;
step S311, the first production environment server sends a file pulling request to the file server;
Step S312, the file server issues an update configuration package with an update configuration identifier corresponding to the update code identifier to the first production environment server according to the file pulling request;
In step S313, the first production environment server loads the update configuration file in the update configuration package, and executes the service function of the target application.
When the first production environment server starts the target application, the latest code package stored by the file server can be loaded, the code files contained in the latest code package are operated, and in the operation process of the code files, the matched configuration files can be regularly operated by pulling the latest code files (which may be the original code files or the updated code files) from the file server according to the gray state relation in the updated gray information, and the implementation process can be combined with the embodiments described below from the system server.
In summary, in the embodiment of the application, the modification requirement of the batch configuration file of the target application is met, after the modification of the configuration file is completed, all the configuration files of the target application are packaged into one data packet and uploaded to the file server for storage, so that when any first production environment server needing to update the target application runs the target application, the latest configuration file required by the execution of the self code can be directly pulled from the file server, thereby realizing the service function of the target application, having no need of restarting the first production environment server, being simple and efficient in operation, meeting the update requirements of different target applications of different production environment servers, realizing the flexibility and diversity of gray release effectiveness, and even if a certain update configuration file is wrong, the self code of the production environment server can still be pulled to be executed, the client can still access other production environment servers, meeting the use requirement of the target application, and ensuring the online service and user experience.
Referring to fig. 4, a flowchart of still another alternative example of the gray scale distribution method according to the present application may be described in the present embodiment from a system server, that is, the gray scale distribution method according to the present embodiment is executed by a production environment server constructed for a target application, but is not limited to the implementation described in the present embodiment. As shown in fig. 4, the method may include:
Step S41, a gray level release query request is sent to a file server, and updated gray level information fed back by the file server in response to the gray level release query request is obtained;
regarding the configuration implementation method for updating the gray information, reference may be made to descriptions of the corresponding parts of the above embodiments, which are not repeated in this embodiment.
The update gray information may be used to indicate a first production environment server that needs to update the target application, and the latest code file and the latest batch configuration file of the target application to be loaded by the first production environment server, and a correspondence relationship between the latest code file and the latest batch configuration file. For example, the file name of the update gray information (e.g., code_config. Properties, code_config-aliyun-prod1-1.1.1.1.Properties, etc.) listed above may characterize the effective range of the update file, the first production environment server may be determined by reading the file name of the update resume information, and the content of the update gray information, e.g., v1.0=v1.0.1, etc., may represent the gray state relationship described above, i.e., when the code executed by the first production environment server identifies the code file in the code package with v1.0.0, the configuration file load with the configuration identifier v1.0.1 needs to be pulled.
In practical application, for any production environment server at the system server end, the machine room, the cluster and the server IP of the server are usually identified, and a gray level issue query request can be sent to the file server at regular time to query the update gray level information on the file server, such as various properties files listed above. For various preconfigured gray information, as the analysis and analysis, the file names of the gray information representing different effect ranges of the updated file are preconfigured, and the query priority can be preconfigured for a plurality of file names, so that whether the updated gray information corresponding to the file name is stored in a file server or not can be sequentially queried according to the query priority, if the updated gray information exists, the updated gray information can be loaded, if the updated gray information does not exist, the gray information of the file name of the next priority can be continuously queried, the sequential recursion is performed, and if the updated gray information of the preset file name is not found, the file name of the updated gray information can be defaults to be "code_config.
It can be seen that the update gray information fed back by the file server may be according to the preset query priority order of the gray information of different file names, the update gray information of the corresponding file name is fed back, and the query implementation method for the update gray information includes, but is not limited to, the query method described above, and may be flexibly adjusted according to the actual situation.
Step S42, determining that the application updating condition is met according to the updating gray information, and generating a file pulling request aiming at a target file to be distributed by utilizing the content of the updating gray information;
The present application can determine the first production environment server in which the updated file takes effect by updating the file name of the gray information, so the application update condition of this embodiment may refer to a condition that the current production environment server belongs to the validity range of the updated file for the target application.
Therefore, for any production environment server of the system server, whether the production environment server meets the application updating condition or not can be determined by reading the file name of the updating gray information, for example, whether the production environment server is located in the effective range of the updating file corresponding to the updating gray information or not is determined according to one or more kinds of information such as the deployment position, the type and the enterprise of the production environment server, if so, the production environment server belongs to the first production environment server, and in the subsequent starting target application, the updating file loading execution can be pulled from the file server, otherwise, the production environment server does not belong to the first production environment server, and in the starting target application, the configuration file loading execution can be pulled from the file server.
Based on the above, as any first production environment server, the content of the corresponding update gray information is read, and the target update file identifier of the target file to be issued of the executed target application, that is, the code file of the latest code package of the loaded target application, can be determined, and the configuration identifier corresponding to the code identifier of the code file is determined. For example, assuming that the code identifier of the original code package on the code repository is v1.0, the configuration identifier of the original configuration package is v1.0, pushing the original code package to the file server, at this time, the name of the configured update gray information may be a file of code_config.
Later, if the code file and the configuration file of the target application need to be modified, the implementation process may refer to the description of the corresponding parts of the above embodiment, which is not described herein. According to the method, for the code file and the configuration file after modification and upgrading, the update code identifier and the update configuration identifier are configured correspondingly, namely, the latest version number Tag is v2.0, the update code packet and the update configuration packet with the data packet name v2.0 are pushed to the file server, at this time, the code file and the configuration file in the code packet are both latest, and the file content of the gray information uploaded by the operation management platform can be empty. As shown in fig. 5, each production environment server determines the upgrade scenario according to the updated gray information, and knows that the file identifiers of the code file and the configuration file of the loading target application are v2.0.
If the configuration file of the target application needs to be updated on the basis of v2.0, after the modification of the configuration file is completed, the update configuration identifier of the obtained update configuration package is v3.0, and the update configuration identifier is pushed to a file server for storage. Since the code file of v2.0 is needed to load the configuration file of v3.0 in the upgrade, when the corresponding updated gray information content is configured, the corresponding relationship can be configured as a gray state relationship, that is, v2.0=v3.0, where the file identifier on the left of the equal sign represents the code identifier of the code file, and the file identifier on the right of the equal sign represents the configuration identifier of the configuration file. In this scenario, the code identifier of the code file of the target application loaded by the first production environment server is v2.0, and the configuration file corresponding to v3.0 of the code file of v2.0 can be determined according to the queried updated gray information content, that is, the determined target update file identifier of the target file to be distributed at this time refers to the target configuration identifier of the target configuration file, such as the configuration identifier v3.0 in this example.
Similarly, if the code file and the configuration file of the target application are further updated, as shown in fig. 5, the file identifiers of the update code packet and the update configuration packet are v4.0, but the gray state file in the updated gray information is v2.0=v3.0, and the code identifier of the latest code file of the first production environment server is determined to be v4.0, so that the target update code identifier and the target update configuration identifier of the target file to be distributed of the target application can be determined to be v 4.0.
It should be noted that, in other application scenarios, the method for determining the target update file identifier is similar in the process of updating and updating the code files and/or configuration files of different types of production environment servers, and the present application is not described in detail herein by way of example.
Step S43, a file pulling request aiming at a target application is sent to a file server, and a target update file packet is pulled from the file server;
Step S44, loading and executing the target file to be released in the target update file package.
When the first production environment server starts the target application, the control logic may generate a file pulling request for the file to be released in real time or periodically, and send the file pulling request to the file server, so as to reliably pull the latest file package of the target application from the file server, and the implementation process may refer to the description of the corresponding part of the above embodiment, which is not repeated herein.
Thus, the target update package in step S43 may include the file to be published that is requested to be pulled, and in conjunction with the description of the corresponding portion above, the target update package may be a target update configuration package and/or a target update code package, which may be determined according to the content of the target file to be published that is characterized by the update gray information.
Referring to fig. 6, for a flowchart of yet another alternative example of the gray level distribution method provided by the present application, this embodiment may still describe an alternative refinement implementation procedure of the gray level distribution method from the system server, as shown in fig. 6, where the method may include:
step S61, a gray level release query request is sent to a file server, and updated gray level information fed back by the file server in response to the gray level release query request is obtained;
Step S62, determining the service address of the production environment server indicated by the obtained name of the updated gray information according to the indication corresponding relation between the gray information of different names and at least one production environment server supporting the target application;
In combination with the related description of the gray information in the above embodiment, the name of the gray information can represent the effective range of the production environment server of the target file to be distributed, so that the name of the updated gray information can be compared with the preset corresponding relationship to determine the service address of the production environment server indicated by the name of the updated gray information. The content of the preset correspondence is determined by combining the content of the gray information of each name, which is not described in detail herein.
In practical application, because the different production environment servers support different running applications, in order to improve the processing efficiency and reduce the gray information name comparison amount, the production environment servers supporting the target application can be selected from a large number of production environment servers configured by the system, and then the first production environment server corresponding to the name of the updated gray information is selected from the large number of production environment servers to determine the service address of each first production environment server, but the method is not limited to the method for determining the first production environment server described in the embodiment.
Step S63, detecting whether the self service address belongs to any service address, if not, returning to step S61, and continuously inquiring new updated gray information from the text server;
Step S64, detecting whether the content of the updated gray information is the same as the content of the original gray information, if so, proceeding to step S65, otherwise, proceeding to step S66;
for any production environment server, after determining the service address of the first production environment server indicated by the current updated gray information name according to the method described above, the service address of the server can be compared with the service addresses of the first production environment servers to determine whether the server belongs to the first production environment server, that is, whether the server meets the application updating condition, if not, the server continues to query new updated gray information from the text server, and processes the updated gray information according to the method described above, and if so, the server determines that the updating of the code file and/or the configuration file needs to be performed on the target application of the production environment server.
The updating manner of the target application for each first production environment server may be different, for example, the versions of the original code file and the original configuration file of the target application in different first production environment servers may be different, and the files to be updated may be different, so each first production environment server may determine to update the target file to be issued of its own target application, so as to generate a file pulling request for the target file to be issued.
In order to determine the target to-be-issued file, in combination with the above description about the gray information content, each first production environment server may determine whether the content included in the updated gray information and the original gray information is the same, if the content is blank or includes a gray state relationship, if the content includes a gray state relationship is the same, etc., so as to determine whether the target application of the first production environment server needs to be updated, if the target application needs to be updated, it may further determine whether the target to-be-issued file for updating is a code file or a configuration file of the target application, etc. Therefore, the content of the currently obtained updated gray information is the same as that of the original gray information, if the currently obtained updated gray information is blank or contains the same recovery state relation, the code file and the configuration of the target application of the first production environment server can be considered to be updated and upgraded, otherwise, the content of the file to be distributed, which needs to be updated, can be further determined according to the gray state relation contained in the updated gray information.
Step S65, determining the update code identifier as a target update file identifier of a target file to be released;
In the above description, since the code package of the target application includes the code file and the configuration file, the target file to be published may include the update code file and the update configuration file referenced by the update code file when the content of the update gray information of the first production environment server is the same as that of the original gray information, and the latest code package may be directly invoked to be executed when the target application needs to be updated, so the present application may determine the update code identifier of the target application as the target update file identifier of the target file to be published.
Step S66, determining that the updated gray information comprises a gray state relation, and determining an update configuration identifier in the gray state relation as a target update file identifier of a target file to be distributed;
The gray state relationship refers to a corresponding relationship between an indicated production environment server (i.e., a first production environment server) having an original code identifier of a target application and an update configuration identifier of an update configuration package, and the gray state relationship can learn that a configuration file of the target application of the first production environment server needs to be updated, and the target file to be released is a configuration file included in the update configuration package of the target application, so that the update configuration identifier is determined as a target update file identifier.
Step S67, generating a file pulling request containing a target updated file identifier;
In order to ensure that a file server accurately transmits target to-be-transmitted files in target update file packages required by the file server to a plurality of first production environment servers, a target update file identifier corresponding to the target update file packages is set in a file pulling request transmitted by the first production environment server to the file server. It can be understood that the file pull request may further include information corresponding to a service address of the first production environment server, an application identifier of the target application, and the like.
Step S68, a file pulling request is sent to a file server, and a target update file packet corresponding to a target update file identifier issued by the file server is received;
step S69, loading and executing the target file to be released in the target update file package.
Regarding how the file server issues the target to-be-issued file required by each first production environment server to the implementation process corresponding to the first production environment server, reference may be made to the description of the corresponding parts of the above embodiments, which are not repeated herein.
Based on the description of the embodiments, in the above configuration process of updating gray information, as shown in fig. 7, a gray state relationship of a first production environment server may be obtained for an update configuration identifier corresponding to a code identifier configuration of any first production environment server, update gray information including the gray state relationship and update indication content indicating that the first production environment server updates a target application is determined, and after being checked by an operation and maintenance person, the first production environment server is triggered to pull a target file to be released according to the update gray state relationship.
In the execution process of the target file to be released, as shown in fig. 7, whether the target application function corresponding to the target file to be released is normal or not can be determined, so that whether the content of the target file to be released is correct or not can be determined, if the target application function is abnormal, a rollback operation can be performed, the state before the gray information is configured, if the target application function is normal, corresponding prompt information is output to prompt a developer to continuously configure corresponding gray state relations for other production environment servers, corresponding gray information is determined and then reported to the file server, and after verification is correct, other production environment servers can pull the update configuration file corresponding to the self code file from the file server based on the corresponding gray information and then load and execute the update configuration file.
In still other embodiments, in the case that the target application function implemented based on the target to-be-issued file is verified in the scenario that the target to-be-issued file belongs to the code file, and it is determined that the target application function is normal, as shown in fig. 8, the file server may further perform security verification on the stored corresponding target to-be-issued file, and after the security verification is passed, gray-scale issue may be performed on the target to-be-issued file (such as the update code file included in the update code package and the configuration file referenced by the update code file), so that other first production environment servers may pull the target to-be-issued file to execute, thereby ensuring reliable update of the target application of each first production environment server. And then, the file server can monitor whether log data generated by the target files to be distributed executed by each first production environment server are normal, so that whether the application of the target application function corresponding to the target files to be distributed in different first production environment servers is normal is determined, if so, the code files to be distributed are monitored to be normal, the code files can be distributed in a full quantity, namely, the update code package of the target application is distributed in a full quantity, so that other users can download the target application using the latest version.
In the process of target application function verification, target file security verification to be released, normal verification of application data monitored after release recovery and the like, any verification result is failed/abnormal, as shown in fig. 8, rollback operation, namely rollback of codes/configuration files, can be performed, so that the production environment server (namely, the first production environment server) executing the target file to be released is recovered to a state before responding to the update of the gray information, and the corresponding production environment server can recover the code file of the target application to the original code file, thus, the first production environment server can continuously execute the target application function before the current gray update, the gray update of the target application by other first production environment servers is not influenced, and the user can use the new function of the target application normally through other first production environment servers, so that the user experience is improved.
Therefore, in the case that the target to-be-issued file belongs to a configuration file, that is, at least one configuration file of the target application needs to be updated and upgraded, the target application function implemented based on the target to-be-issued file may be verified, for example, whether the target application function can be normally executed is verified, and if the verification is passed, corresponding gray indication information may be output, for example, the gray indication information is sent to the operation management platform, so as to indicate that the updated gray information is configured for all production environment servers supporting the target application, so that other production environment servers load the target to-be-issued file according to the method described above based on the updated gray information, and implement gray update of the target application. Of course, if the verification is not passed, it may be considered that the loaded target file to be distributed is abnormal, resulting in failure of execution of the target application function, and rollback operation may be executed, so as to avoid that the abnormality affects online service and user experience of the target application in a large area.
Referring to fig. 9, a schematic structural diagram of an alternative example of a gray-scale distribution device proposed by the present application, which is described from a file server side, as shown in fig. 9, may include:
an update package obtaining module 91, configured to obtain at least one update package for a target application;
The update file package is generated by packaging the obtained files to be distributed after updating at least one first configuration file in the code files and/or the batch configuration files of the target application, and has an update file identifier configured for the files to be distributed, wherein the files to be distributed comprise batch configuration files consisting of the updated first configuration files and the second configuration files which are not updated, or all the updated code files and batch configuration files referenced by the updated code files.
An updated gray information receiving module 92, configured to receive updated gray information sent by the operation management platform of the target application;
The updating gray information is used for indicating a first production environment server of the target application to be updated, and a latest code file and a latest batch configuration file of the target application to be loaded by the first production environment server.
An information storage module 93, configured to store the at least one update package and the update grayscale information;
a file pull request receiving module 94, configured to receive a file pull request for a target file to be published sent by the first production environment server;
the file pull request may be sent based on the content of the updated grayscale information when the first production environment server executes the target application.
And the file pulling request response module 95 is configured to respond to the file pulling request, and issue a target update package containing the requested target file to be issued to the first production environment server for execution.
In order to trigger the update package obtaining module 91 to obtain at least one update package for a target application, the file identification control system in the above-mentioned gray distribution system and the gray distribution device included in the package distribution system side may include:
The file updating module is used for responding to an updating request aiming at a target application, updating at least one first configuration file in a code file and/or a batch configuration file of the target application, and obtaining a file to be distributed of the target application and an updating file identifier corresponding to the file to be distributed;
the device comprises an update configuration package obtaining module, a configuration package updating module and a configuration package updating module, wherein the update configuration package obtaining module is used for carrying out packaging processing on batch configuration files with the update configuration identifiers in the files to be distributed to obtain update configuration packages with the update configuration identifiers under the condition that the update file identifiers comprise the update configuration identifiers;
the updating code package obtaining module is used for packaging all code files with the updating code identifiers and the batch configuration files referenced by the code files in the files to be distributed under the condition that the updating file identifiers comprise the updating code identifiers to obtain updating code packages with the updating code identifiers;
And the file package uploading module is used for uploading the obtained update configuration package and/or the update code package to a file server.
In practical application, if the at least one update package is the update configuration package, the update gray information obtained by the file server may include an original code identifier of the target application supported by the indicated production environment server (i.e. the production environment server within the effective range), and a gray state relationship between the update configuration identifier of the update configuration package, to instruct the production environment server to load the update configuration package, and if the at least one update package is the update code package, the update gray information is consistent with the content of the original gray information, such as a blank or gray state relationship of the same content, so that the production environment server may be instructed to load the update code package according to the gray state relationship, and the implementation process may refer to the description of the corresponding parts of the above embodiments, which are not described in detail herein.
It should be noted that, regarding the various modules, units, and the like in the foregoing embodiments of the apparatus, the various modules and units may be stored as program modules in a memory, and the program modules stored in the memory may be executed by a processor to implement corresponding functions, or may be implemented by a combination of the program modules and hardware, and regarding the functions implemented by each program module and a combination thereof, and the achieved technical effects, the description on the corresponding device side of the foregoing method embodiments may be referred to, which is not repeated herein.
Referring to fig. 10, a schematic structural diagram of still another alternative example of the gray scale distribution device proposed by the present application, which can be described from the server side of the production environment, as shown in fig. 10, may include:
the gray information obtaining module 101 is configured to send a gray release query request to a file server, and obtain updated gray information fed back by the file server in response to the gray release query request;
In the embodiment of the present application, the updated gray information is used to indicate a first production environment server that needs to update the target application, and a latest code file and a latest batch configuration file of the target application to be loaded by the first production environment server.
The target update file identification determining module 102 is configured to determine that the update gray information meets product update conditions according to the update gray information, and generate a file pulling request for a target file to be distributed according to the content of the update gray information;
The target file to be distributed is a batch configuration file composed of the updated first configuration file and the second configuration file which are not updated and included in the update file package, or all the updated code files and the batch configuration files referenced by the updated code files, and the content of the target file to be distributed can be determined according to scene requirements.
A target update package pulling module 103, configured to send a file pulling request for a target application to the file server, and pull a target update package from the file server;
In the embodiment of the present application, the target update file package refers to an update file package corresponding to a target update file identifier carried by the file pull request.
And the target file to be distributed loading module 104 is used for loading and executing the target file to be distributed in the target update file package.
Optionally, the target update file identification determining module 102 may include:
A service address determining unit, configured to determine, according to an indicated correspondence between gray information of different names and at least one production environment server supporting the target application, a service address of a production environment server indicated by the obtained name of the updated gray information;
The first determining unit is used for detecting that the self service address belongs to any determined service address and determining that the application updating condition is met;
and the second determining unit is used for detecting that the self service address does not belong to any determined service address, determining that the self service address does not accord with the application updating condition, and continuously inquiring new updating gray information from the file server.
Optionally, the target update file identification determining module 102 may include:
A third determining unit, configured to determine, when the updated gray information includes an original code identifier of the target application of the indicated production environment server and a gray state relation between the original code identifier and an updated configuration identifier of the updated configuration package, and the updated gray information is different from content included in the original gray information, that the updated configuration identifier in the gray state relation is a target updated file identifier of a target file to be distributed;
The fourth determining unit is used for determining the update code identifier as a target update file identifier of a target file to be released under the condition that the update gray information is the same as the original gray information in content;
and the file pulling request generating unit is used for generating a file pulling request containing the target updated file identifier.
In still other embodiments, the gray scale distribution device on the server side of the production environment may further include:
The function verification module is used for verifying the target application function realized based on the target file to be distributed under the condition that the running target file to be distributed belongs to the configuration file;
The gray indication information output module is used for outputting corresponding gray indication information to indicate that the updated gray information is configured for all production environment servers supporting the target application under the condition that the function verification module passes verification, and loading the target file to be distributed;
The rollback module is used for executing rollback operation under the condition that the verification of the function verification module is not passed, so that the production environment server executing the target file to be distributed is restored to the state before responding to the updated gray information;
the security verification module is used for verifying the function and the security of the target application realized based on the target file to be distributed under the condition that the running target file to be distributed belongs to the code file;
The gray level release module is used for releasing the gray level of the code file under the condition that the verification of the security verification module is passed;
the full-quantity issuing module is used for issuing the code file in full quantity when the code file application which is monitored to be issued is normal;
and the recovery processing module is used for recovering the code file of the target application into the original code file under the condition that the verification of the security verification module is not passed or the full release module monitors the released code file application abnormality.
It should be noted that, regarding the various modules, units, and the like in the embodiments of the foregoing apparatuses, the various modules, units, and the like may be stored as program modules in the memory of the production environment server, the foregoing program modules stored in the memory may be executed by the processor to implement corresponding functions, or may be implemented by the combination of the program modules and hardware, and regarding the functions implemented by each program module and the combination thereof, and the achieved technical effects, the processing procedure described on the side of the production environment server of the foregoing embodiments may be referred to, which is not described in detail in this embodiment.
The embodiment of the application also provides a computer readable storage medium, on which a computer program is stored, the computer program is loaded and executed by processors of different devices in the system, and each step of the gray level release method executed by the device at the side is implemented, and the specific implementation process can refer to the description of the corresponding device side in the above embodiment, which is not repeated.
Finally, it should be noted that, in the present description, each embodiment is described in a progressive or parallel manner, and each embodiment is mainly described as different from other embodiments, and identical and similar parts between the embodiments are only required to be referred to each other. For the device, the system and the server disclosed in the embodiments, the description is relatively simple because the device, the system and the server correspond to the methods disclosed in the embodiments, and the relevant parts refer to the description of the method parts.
Those of skill would further appreciate that the elements and algorithm steps of the embodiments described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the various illustrative components and steps have been described above generally in terms of function in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the particular solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.