Service operation environment configuration method, electronic equipment and readable storage medium
By presetting the environment configuration template on the server side and automatically matching configuration items and values according to the operating environment, distribution location and purpose identification, the problem of inefficient multi-environment configuration is solved and efficient environment configuration management is achieved.
Patent Information
- Application Number
- CN202410816842.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-10-01
AI Technical Summary
During the development and version iteration process of business system services, technical personnel need to frequently set and modify the operating environment configuration items and configuration parameters of multiple services, resulting in low configuration efficiency and huge workload.
By presetting a common environment configuration template on the server side, it automatically matches and generates corresponding configuration items and values according to the identification of the operating environment, distribution location and development purpose, and generates environment configuration results suitable for different environments.
It improves the configuration efficiency of the same service to adapt to different operating environments, distribution locations and development purposes, reduces the workload of technicians in the configuration process, and simplifies the maintenance and management of environment configuration.
Smart Images

Figure CN118733140A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of project environment configuration, and in particular to a service operation environment configuration method, an electronic device and a readable storage medium. Background Art
[0002] In order to adapt to the development and version iteration requirements of business systems (such as insurance business service systems), the server needs to configure or update the environment in which the corresponding service runs (hereinafter referred to as the operating environment) to adapt to different distribution locations and / or development purposes. This configuration process usually requires setting or modifying the values of configuration items and configuration parameters of the corresponding operating environment (hereinafter referred to as configuration values).
[0003] However, the above configuration process currently implemented based on a unified configuration center service still requires technicians to add the required configuration items for the operating environment that needs to be configured, and to configure or modify the configuration values of the corresponding configuration items to adapt to different distribution locations, different development purposes, etc. When the above configuration process needs to meet the development and version iteration requirements of multiple services, the workload of technicians is often huge and the configuration efficiency is relatively low. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a service operating environment configuration method, an electronic device, and a readable storage medium. The method presets a common environment configuration template on the server side to provide various configuration items that can match various operating environment configuration requirements, and matches one or a group (multiple) of configuration values corresponding to each configuration item corresponding to different distribution locations and / or development purposes. In this way, the configuration efficiency of the same service to adapt to different operating environments, distribution locations, development purposes, and other factors can be improved, and the workload of technicians during the configuration process can be reduced.
[0005] Specifically, in the first aspect, an embodiment of the present application provides a service running environment configuration method, which is applied to an electronic device, and the method includes: obtaining an environment configuration request for a first service, the environment configuration request at least including a first environment identifier corresponding to a first environment where the first service is running, and the environment configuration request also includes at least one of a first distribution location identifier and a first purpose identifier published by the first service; in response to the environment configuration request, obtaining a first configuration template, the first configuration template including at least one configuration item required for the first service to run in the first environment; based on the first environment identifier and at least one of the first distribution location identifier and the first purpose identifier, respectively, determining a configuration value for the above at least one configuration item; generating an environment configuration result corresponding to the first service running in the first environment based at least on the first environment identifier and at least one of the first distribution location identifier and the first purpose identifier, and the configuration value of the above at least one configuration item.
[0006] For example, the operating environment type indicated by the first environment identifier included in the environment configuration request may be a development environment, the distribution location indicated by the first distribution location identifier included in the environment configuration request may be the Asia region, and the development purpose indicated by the first use identifier included in the environment configuration request may be reviewing the insured's qualifications. The configuration items included in the first configuration template may be, for example, an Internet Protocol (IP) address.
[0007] The above environment configuration results can be stored in a file or database corresponding to the call of the configuration center service, for example. For details, please refer to the relevant description below, which will not be repeated here.
[0008] In a possible implementation of the first aspect above, determining a configuration value for at least one configuration item based on the first environment identifier and at least one of the first distribution location identifier and the first purpose identifier includes: determining one or more first configuration values for one or more first-part configuration items in the at least one configuration item based on the first environment identifier; and determining a second configuration value for one or more second-part configuration items in the at least one configuration item based on the first environment identifier and the first distribution location identifier; and generating an environment configuration result corresponding to the operation of the first service in the first environment based at least on the first environment identifier and at least one of the first distribution location identifier and the first purpose identifier, as well as the configuration value of the at least one configuration item, includes: generating a first environment configuration result corresponding to the operation of the first service in the first environment based at least on the first environment identifier, the first-part configuration items and one or more first configuration values, the first distribution location identifier, the second-part configuration items and one or more second configuration values.
[0009] For example, the configuration value of the at least one configuration item determined based on the first environment identifier and the first distribution location identifier may be a domain name.
[0010] In a possible implementation of the first aspect, the configuration value of the at least one configuration item is determined based on the first environment identifier and at least one of the first distribution location identifier and the first purpose identifier, including: determining one or more first configuration values for one or more first-part configuration items in the at least one configuration item based on the first environment identifier; wherein, based on the first environment identifier and the first purpose identifier, determining a third configuration value for one or more third-part configuration items in the at least one configuration item; and, generating an environment configuration result corresponding to the operation of the first service in the first environment based at least on the first environment identifier and at least one of the first distribution location identifier and the first purpose identifier, as well as the configuration value of the at least one configuration item, including: generating a second environment configuration result corresponding to the operation of the first service in the first environment based at least on the first environment identifier, the first-part configuration items and one or more first configuration values, the first purpose identifier, the third-part configuration items and one or more third configuration values.
[0011] For example, the configuration value of the at least one configuration item determined based on the first environment identifier and the first purpose identifier may be a database name.
[0012] In a possible implementation of the first aspect, determining a configuration value for the at least one configuration item based on the first environment identifier and at least one of the first distribution location identifier and the first purpose identifier includes: determining one or more first configuration values for one or more first-part configuration items in the at least one configuration item based on the first environment identifier; and, determining a second configuration value for one or more second-part configuration items in the at least one configuration item based on the first environment identifier and the first distribution location identifier; and, determining a third configuration value for one or more third-part configuration items in the at least one configuration item based on the first environment identifier and the first purpose identifier; and, generating an environment configuration result corresponding to the operation of the first service in the first environment based at least on the first environment identifier and at least one of the first distribution location identifier and the first purpose identifier, and the configuration value for the at least one configuration item, including: generating a third environment configuration result corresponding to the operation of the first service in the first environment based at least on the first environment identifier, the first-part configuration items and one or more first configuration values, the first distribution location identifier, the second-part configuration items and one or more second configuration values, the first purpose identifier, the third-part configuration items and one or more third configuration values.
[0013] In this way, based on the above-mentioned service operating environment configuration method, the electronic device can generate environmental configuration results for the same service that are suitable for different operating environments, different distribution locations, and different development purposes, and the technical personnel can publish the above-mentioned environmental configuration results together when publishing the service, so as to solve the problem of low configuration efficiency and huge configuration workload when the technical personnel set or modify the configuration of multiple environments separately under the traditional multi-environment configuration method.
[0014] In a possible implementation of the first aspect above, the first configuration template includes an environment identification parameter corresponding to the first part of the configuration items and a first variable corresponding to the first configuration item in the second part of the configuration items, wherein the environment identification parameter corresponds to the first configuration value, and the above-mentioned generation of the first environment configuration result corresponding to the first service running in the first environment includes: replacing the environment identification parameter in the first configuration template with the first environment identification, and replacing the first variable with the second configuration value, to generate the first environment configuration result.
[0015] In a possible implementation of the first aspect above, the first configuration template includes an environment identification parameter corresponding to the first part of the configuration items and a second variable corresponding to the second configuration item in the third part of the configuration items, wherein the environment identification parameter corresponds to the first configuration value, and the above-mentioned generation of the second environment configuration result corresponding to the first service running in the first environment includes: replacing the environment identification parameter in the first configuration template with the first environment identification, and replacing the second variable with the third configuration value, to generate the second environment configuration result.
[0016] In a possible implementation of the first aspect above, the first configuration template includes an environment identification parameter corresponding to the first part of the configuration items, a first variable corresponding to the first configuration item in the second part of the configuration items, and a second variable corresponding to the second configuration item in the third part of the configuration items, wherein the environment identification parameter corresponds to the first configuration value, and the above-mentioned generation of the third environment configuration result corresponding to the first service running in the first environment includes: replacing the environment identification parameter in the first configuration template with the first environment identification, replacing the first variable with the second configuration value, and replacing the second variable with the third configuration value, to generate the third environment configuration result.
[0017] It can be understood that the above-mentioned replacement process of replacing the environment identification parameters in the first configuration template with the first environment identification, replacing the first variable with the second configuration value, and replacing the second variable with the third configuration value to generate the third environment configuration result can be implemented by the template engine on the electronic device. For details, please refer to the relevant description below and will not be repeated here.
[0018] In a possible implementation of the first aspect above, the electronic device includes a first configuration file corresponding to a first service running in a first environment, wherein the first configuration file is stored in a file call path of a configuration center service, and the first configuration file includes a first environment identifier, a name of a first configuration item and a second configuration value, and a name of a second configuration item and a third configuration value.
[0019] It can be understood that in some other embodiments, the first configuration file may only include the first environment identifier, the name of the first configuration item, and the second configuration value.
[0020] It can be understood that in some other embodiments, the first configuration file may only include the first environment identifier, the name of the second configuration item, and the third configuration value.
[0021] It can be understood that the first configuration file can be a file in a format such as JSON (JavaScript Object Notation), YAML (YAML Ain't Markup Language), TOML (Tom's Obvious Minimal Language), etc., which is not limited here.
[0022] In a possible implementation of the first aspect above, the electronic device includes a database, and the first configuration file includes a first data table in the database; wherein the primary key of the first data table includes any one of the following: a first environment identifier and a first configuration item name; a first environment identifier and a second configuration item name; a first environment identifier, a first configuration item name, and a second configuration item name.
[0023] The concatenation format of the primary key in the above data table can be referred to the relevant description below, which will not be repeated here.
[0024] In a possible implementation of the first aspect, the electronic device at least includes a configuration center service, and
[0025] The above-mentioned obtaining of the environment configuration request for the first service includes: the configuration center service obtains the environment configuration request for the first service, and based on the environment configuration request, obtains the first environment identifier, and at least one of the first distribution location identifier and the first purpose identifier; the above-mentioned obtaining of the first configuration template in response to the environment configuration request includes: the configuration center service obtains the first configuration template in response to the environment configuration request.
[0026] In this way, by uniformly storing the configuration values of each configuration item corresponding to each operating environment, distribution location, and development purpose, as well as a common environment configuration template, etc., the configuration center service deployed on the electronic device is conducive to the unified maintenance and management of environmental configuration related information by technical personnel, solving the problem of difficult maintenance and management of configuration in multiple environments.
[0027] In a possible implementation of the first aspect above, the electronic device also includes a template engine, and the above-mentioned determining the configuration value of at least one configuration item based on the first environment identifier and at least one of the first distribution location identifier and the first purpose identifier includes: the configuration center service determines the configuration value of at least one configuration item in the first configuration template based on the first environment identifier and at least one of the first distribution location identifier and the first purpose identifier and sends it to the template engine; the above-mentioned generating the environment configuration result corresponding to the operation of the first service in the first environment based at least on the first environment identifier and at least one of the first distribution location identifier and the first purpose identifier, and the configuration value of the at least one configuration item includes: the template engine generates the environment configuration result corresponding to the operation of the first service in the first environment based at least on the first environment identifier and at least one of the first distribution location identifier and the first purpose identifier, and the configuration value of the at least one configuration item, generates the environment configuration result corresponding to the operation of the first service in the first environment, and returns the environment configuration result to the configuration center service.
[0028] Exemplarily, the configuration center service determines the second configuration value of one or more second-part configuration items in at least one configuration item based on the first environment identifier and the first distribution location identifier and sends it to the template engine. The template engine replaces the first variable of the first configuration item in the second-part configuration item in the first configuration template with the second configuration value, generates the first environment configuration result corresponding to the first service running in the first environment, and returns the first environment configuration result to the configuration center service. Similarly, the template engine can generate the second environment configuration result and the third environment configuration result corresponding to the first service running in the first environment and return them to the configuration center service.
[0029] In this way, through the interaction between the configuration center and the template engine, the configuration efficiency is improved, and the problem of a huge amount of configuration caused by technical personnel setting or modifying the configuration of the same service corresponding to different operating environments, distribution locations, development purposes and other factors is solved.
[0030] In a second aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; one or more memories; one or more memories storing one or more programs, and when one or more programs are executed by one or more processors, the device executes the service operating environment configuration method provided in the above-mentioned first aspect and various possible implementations.
[0031] In a third aspect, an embodiment of the present application provides a readable storage medium having instructions stored thereon. When the instructions are executed on a computer, the computer executes the service operating environment configuration method provided in the first aspect and various possible implementations.
[0032] The beneficial effects of the second and third aspects mentioned above can be found in the relevant descriptions of the first aspect and various possible implementations of the first aspect, and will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 The figure shows an application scenario diagram of a service operation environment configuration method provided in an embodiment of the present application.
[0034] Figure 2 The figure shows a schematic diagram of an implementation flow of a service operating environment configuration method provided in an embodiment of the present application.
[0035] Figure 3 Shown is a schematic diagram of the system software structure of a server 200 provided in an embodiment of the present application.
[0036] Figure 4 The figure shows a schematic diagram of the interaction between a configuration center and a template engine provided in an embodiment of the present application.
[0037] Figure 5 Shown is a schematic diagram of the hardware structure of a server 200 provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0039] Figure 1 According to an embodiment of the present application, a schematic diagram of an application scenario of a service operating environment configuration method is shown.
[0040] like Figure 1 As shown, the scenario includes a terminal device 100 and a server 200, wherein the terminal device 100 may include one or more terminal devices such as a terminal device 100a, a terminal device 100b, and a terminal device 100c. A business system client (hereinafter referred to as the client) may be installed on each terminal device 100, such as an insurance business system client. Correspondingly, a corresponding business system server (hereinafter referred to as the server) may be deployed on the server 200 to provide the required services to each client, such as an insurance business system server, which may provide underwriting services, etc., to the above-mentioned insurance business system client.
[0041] exist Figure 1In the scenario shown, the server 200 can uniformly configure the corresponding operating environment for the newly developed service or service version, and distribute the environment configuration results to the terminal device 100 that requests the configuration of the corresponding service or service version. The above-mentioned newly developed service or service version, after being released to the corresponding client, can provide corresponding functions when executed by the client installed on the terminal device 100, which is not limited here. For example, after the underwriting service released by the server is released to the insurance business system client, it can provide the underwriting function to the user on the terminal device 100 running by the client. In some embodiments, the above-mentioned business system server deployed on the server 200 may also be referred to as the business system backend or simply the backend, etc., which is not limited here.
[0042] In some embodiments, Figure 1 The server 200 in the illustrated scenario may also be a server cluster, that is, the service end of the business system may also be deployed on the server cluster, which is not limited here.
[0043] It is understood that in order to meet the different usage requirements of business system users, newly developed services or service versions can correspond to different development purposes. In addition, in order to meet the regional usage requirements of users in different countries or regions, newly developed services or service versions can be set to one or more distribution locations. In addition, the newly developed services or service versions are applied in different usage scenarios, and the corresponding execution environments may also be different.
[0044] Based on this, the same service runs in different operating environments, or is set to different service distribution locations or set to different development purposes during development, etc., and the corresponding environment configuration results will also be different. For example, in a development environment or a test environment, the configuration items required for the operation of service A, such as an underwriting service, may be different, or the configuration items may be the same but the configuration values of each configuration item may be different. For another example, when service A is applied to a production environment to perform function A, the corresponding configuration items and / or configuration values may be different from those when service A is applied to the production environment to perform function B. For another example, service A published in region A and service A published in region B may also have different configuration items and / or configuration values for the operating environment required for the client to run in the corresponding publishing location. For example, in order to adapt to the differences in different distribution locations, it is necessary to set configuration items such as the IP address corresponding to service A and configuration values according to region A and region B respectively.
[0045] It can be understood that in the embodiments of the present application, the above-mentioned technical personnel may include developers, testers or users of business systems, etc., which are not limited here.
[0046] As mentioned above, the current solution based on a unified configuration center service to meet the different environmental configuration requirements caused by the above factors still requires technicians to add corresponding configuration items and set or modify corresponding configuration values for each operating environment in which each service or service version may run based on the above operating environment, distribution location, development purpose, etc. This will result in a huge workload for technicians to configure the operating environment for the newly developed service or service version, and the configuration efficiency is relatively low.
[0047] In order to solve the above problems, the present application provides a service operating environment configuration method that can adapt to different environments. This method presets a general environment configuration template on the server side to provide various configuration items that can match various operating environment configuration requirements. It can set one or a group (multiple) of configuration values that correspond to each configuration item corresponding to different environments, different development purposes, and different distribution locations. In this way, for new services or new service versions to be developed or completed, the server side can match the corresponding environment configuration results for the corresponding services according to the operating environment identifier, distribution location identifier, purpose identifier, etc. set by the technical staff, and provide the environment configuration results when publishing the corresponding services.
[0048] In this way, technical personnel no longer need to adaptively set up or modify the configurations of different operating environments according to the operating environment, distribution location or development purpose. Instead, they can directly obtain the environment configuration results provided by the server when releasing the corresponding service or service version, and configure the corresponding operating environment by themselves to run the new service or service version. This is conducive to reducing the workload of technical personnel in configuring the operating environment, and is also conducive to improving the efficiency of operating environment configuration, and can ensure that the released service or service version can run smoothly in the corresponding operating environment.
[0049] At the same time, when the deployed corresponding service or service version cannot run smoothly or some uncertain configurations appear in its corresponding operating environment, the technical staff can clear the relevant configurations of the operating environment of the deployed service or service version, and obtain the environment configuration results provided by the server when the corresponding service or service version is released, and reconfigure the corresponding operating environment to run the service or service version. This is conducive to maintaining the operating environment of the deployed service or service version.
[0050] It can be understood that the above environment configuration result may include a collection of data such as various configuration items and corresponding configuration values for a certain operating environment in which the target service is running. The collection can be organized and presented in the form of a data table, and the corresponding data table can form a callable file in a specific format. The callable file can be, for example, a JSON format file containing environment identification parameters, configuration items, and corresponding configuration values, etc., which is not limited here.
[0051] It is understandable that the technician can set a corresponding environment identifier for the service or service version according to the operating environment (e.g., development environment) set when developing the service or service version. Similarly, the technician can set a corresponding distribution location identifier for the service or service version according to the distribution location set when developing the service or service version, and set a corresponding purpose identifier for the service or service version according to the development purpose.
[0052] Among them, the environment identifier is used to distinguish the operating environment of the corresponding deployment of the service. The distribution location identifier is used to distinguish the country and / or region where the service is released. The purpose identifier is used to distinguish the development purpose of the corresponding setting of the service.
[0053] Understandably, referring to the above Figure 1 In the scenario shown, the server 200 deployed with the service end can obtain the technical personnel's environment configuration request for the new service to be developed or the new service version (hereinafter referred to as the target service) that has been developed. The environment configuration request may carry, for example, an environment identification parameter (an operating environment identification) corresponding to the operating environment specified by the service or service version, and may also carry other relevant configuration information indicating the distribution location and / or development purpose of the service or service version. Correspondingly, the server 200 can call the above-mentioned general environment configuration template, match the corresponding configuration items and configuration values for the environment configuration request based on the environment identification parameters and other relevant configuration information, and generate the environment configuration result corresponding to the target service, which can be subsequently published together with the target service.
[0054] In some embodiments, the server 200 can implement the service operation environment configuration method provided by the present application through the configuration center service, and the corresponding generated environment configuration result can also be stored in the file or database called by the configuration center service for quick call. The specific description of the configuration center service will be introduced in detail below and will not be repeated here.
[0055] It can be understood that the configuration items contained in the above-mentioned general environment configuration template may include general configuration items that can adapt to various operating environment configuration requirements, such as configuration items corresponding to IP addresses (such as domain names), corresponding to database port numbers that can be called by services, database user names and database passwords, etc., which are not limited here.
[0056] As an example, Table 1 shows configuration item information provided by a general environment configuration template according to an embodiment of the present application.
[0057] Table 1
[0058] Configuration item identification Configuration value variables corresponding to configuration item settings domain environment.DOMAIN db_host environment.DB_HOST db_port environment.DB_PORT db_user environment.DB_USER db_password environment.DB_PASSWORD
[0059] As shown in Table 1, "environment" is an environment identification parameter. Corresponding to different operating environments, the environment identification parameter may be the name or unique identification information of each operating environment.
[0060] "domain" is the configuration item identifier of the corresponding domain name. Correspondingly, "environment.DOMAIN" can represent a variable for setting the configuration value of the configuration item of the domain name "domain". In different operating environments, "environment.DOMAIN" can be replaced with different configuration values as the configuration value of the configuration item "domain".
[0061] Similarly, "db_host" is the configuration item identifier of the corresponding host, and correspondingly, "environment.DB_HOST" can represent a variable for setting the configuration value of the configuration item "db_host" of the above host. In different operating environments, "environment.DB_HOST" can be replaced with different configuration values as the configuration value of the configuration item "db_host".
[0062] Similarly, "db_port" is a configuration item identifier corresponding to the database port number, and correspondingly, "environment.DB_PORT" can represent a variable for setting a configuration value for the configuration item of the database port number "db_port". In different operating environments, "environment.DB_PORT" can be replaced with different configuration values as the configuration value of the configuration item "db_port".
[0063] Similarly, "db_user" is the configuration item identifier corresponding to the database user name, and correspondingly, "environment.DB_USER" can represent a variable for setting the configuration value of the above configuration item of the database user name "db_user". In different operating environments, "environment.DB_USER" can be replaced with different configuration values as the configuration value of the configuration item "db_user".
[0064] Similarly, "db_password" is the configuration item identifier corresponding to the database password, and correspondingly, "environment.DB_PASSWORD" can represent a variable for setting the configuration value of the configuration item "db_password" for the above database password. In different operating environments, "environment.DB_PASSWORD" can be replaced with different configuration values as the configuration value of the configuration item "db_password".
[0065] It can be understood that in actual applications, the configuration items provided by the environment configuration template may include but are not limited to the "domain", "db_host", "db_port", "db_user", and "db_password" shown in the above Table 1, which are not limited here.
[0066] Figure 2 According to an embodiment of the present application, a schematic diagram of an implementation process of a service operating environment configuration method is shown.
[0067] Understandably, Figure 2 The execution subject of each step of the illustrated process may be the server 200, or a configuration center service deployed on the server 200. For details, please refer to the relevant descriptions in the following steps, which will not be repeated here.
[0068] Specifically, Figure 2 As shown, the process may include the following steps:
[0069] 201: Get the environment configuration request for the target service.
[0070] Exemplarily, the target service may be a service or service version to be developed or already developed, such as an underwriting service. The environment configuration request may be generated in accordance with the distribution location specified for the target service, or may be generated in accordance with the development purpose set by the developer for the target service. In some embodiments, the environment configuration request may be generated on a terminal device (such as a developer device) used by a technician. The terminal device may be, for example, the above Figure 1 The terminal device 100 in the scenario shown. When developing a target service or publishing a developed target service, the technician can select the operating environment, distribution location, and development purpose set for the target service. Correspondingly, the terminal device 100 can generate the above-mentioned environment configuration request based on the settings of the technician. Therefore, the above-mentioned environment configuration request can carry the operating environment identifier, distribution location identifier, and purpose identifier corresponding to the above-mentioned target service.
[0071] In some embodiments, the server 200 may obtain an environment configuration request for the target service from the terminal device 100a, and the environment configuration request may only carry an environment identifier corresponding to the target service. For clarity, the environment identifier may be referred to as the first environment identifier below.
[0072] It can be understood that the first environment identifier mentioned above may be, for example, an environment identifier of a development environment set for the target service by a technician when developing or publishing the target service.
[0073] In some other embodiments, the server 200 may obtain an environment configuration request for the target service from the terminal device 100b, and the environment configuration request may carry the environment identifier and distribution location identifier corresponding to the target service. The environment identifier may be the first environment identifier or the second environment identifier corresponding to another operating environment. For clarity of reference, the distribution location identifier may be referred to as the first distribution location identifier below.
[0074] It can be understood that the second environment identifier can be, for example, an environment identifier of a test environment set for the target service by a technician when developing or releasing the target service. The first distribution location identifier can be, for example, an Asian distribution location identifier set for the target service by a technician when developing or releasing the target service.
[0075] In other embodiments, the server 200 may obtain an environment configuration request for the target service from the terminal device 100c, and the environment configuration request may carry the environment identifier, distribution location identifier, and purpose identifier corresponding to the target service. The environment identifier may be the first environment identifier, or a third environment identifier corresponding to another operating environment. The distribution location identifier may be the first distribution location identifier, or a second distribution location identifier corresponding to another distribution location. For clarity of reference, the purpose identifier may be referred to as the first purpose identifier below.
[0076] It can be understood that the third environment identifier can be, for example, an environment identifier of a production environment set for the target service by a technician when developing or publishing the target service. The second distribution location identifier can be, for example, an Americas distribution location identifier set for the target service by a technician when developing or publishing the target service. The first purpose can be, for example, a purpose identifier for reviewing the qualifications of an insured person set for the target service by a technician when developing or publishing the target service.
[0077] It can be understood that in other embodiments, the server 200 can obtain a configuration request for the target service from the terminal device 100, and the configuration request can only carry the environment identifier and purpose identifier corresponding to the above-mentioned target service, but not the distribution location identifier, which is not limited here.
[0078] It is understood that in other embodiments, the operating environment identifier carried by the above-mentioned environment configuration request includes but is not limited to the above-mentioned first environment identifier, the second environment identifier, and the third environment identifier. The distribution location identifier carried by the above-mentioned environment configuration request includes but is not limited to the above-mentioned first distribution location identifier and the second distribution location identifier. The purpose identifier carried by the above-mentioned environment configuration request includes but is not limited to the above-mentioned first purpose identifier, which is not limited here.
[0079] It can be understood that in other embodiments, the information carried in the above-mentioned environment configuration request also includes but is not limited to the operating environment identifier, distribution location identifier, and purpose identifier corresponding to the above-mentioned target service, which are not limited here.
[0080] 202: In response to the environment configuration request, call the environment configuration template.
[0081] Exemplarily, the server 200 calls a general environment configuration template in response to an environment configuration request for a target service. As mentioned above, the environment configuration template is preset and may include configuration items adapted to a variety of operating environments. In some embodiments, the environment configuration template may be stored in a file or database corresponding to a call of a configuration center service deployed on the server 200.
[0082] 203: Determine configuration values of configuration items related to the target environment in the environment configuration template based on the environment identification parameters carried in the environment configuration request.
[0083] Exemplarily, the server 200 obtains the environment identification parameter carried in the configuration request in response to the environment configuration request obtained for the target service. Based on the environment identification parameter, the configuration center service deployed on the server 200 obtains the configuration value of each configuration item related to the target operating environment (hereinafter referred to as the target environment) in the above-mentioned environment configuration template that is running the target service. The above-mentioned target environment may be the operating environment corresponding to the environment identification parameter carried in the configuration request. The configuration value of the configuration item related to the above-mentioned target environment may be the configuration value of one or more configuration items corresponding to the configuration of the target environment of the target service.
[0084] As mentioned above, the above environment identification parameter may be, for example, a first environment identification, which may be, for example, an environment identification of a development environment set by a technician for a target service. The configuration center service deployed on the server 200 may obtain, based on the first environment identification, configuration values of one or more configuration items of the target service corresponding to the first environment in the general environment configuration template.
[0085] For another example, the environment identification parameter may be a second environment identification, which may be, for example, an environment identification of a test environment set by a technician for the target service. The configuration center service deployed on the server 200 may obtain configuration values of one or more configuration items of the target service corresponding to the second environment in the general environment configuration template based on the second environment identification.
[0086] For another example, the above environment identification parameter may be a third environment identification, and the third environment identification may be, for example, an environment identification of a production environment set by a technician for the target service. The configuration center service deployed on the server 200 may obtain the configuration values of one or more configuration items of the target service corresponding to the third environment in the general environment configuration template based on the third environment identification.
[0087] 204: Based on other identification parameters such as the distribution location and / or development purpose carried in the environment configuration request, determine configuration values of configuration items related to the distribution location and / or development purpose in the environment configuration template.
[0088] Exemplarily, the server 200 obtains the distribution location and / or purpose identification parameters carried in the configuration request in response to the environment configuration request obtained for the target service. Based on the distribution location and / or development purpose parameters, the configuration center service deployed on the server 200 obtains the configuration values of the configuration items related to the distribution location and / or development purpose in the above environment configuration template.
[0089] As mentioned above, the distribution location identification parameter may be, for example, a first distribution location identification, which may be, for example, an Asian distribution location identification set by a technician for the target service. The configuration center service deployed on the server 200 may obtain, based on the first distribution location identification, configuration values of one or more configuration items of the target service corresponding to the first distribution location in the general environment configuration template.
[0090] For another example, the distribution location identification parameter may be a second distribution location identification, which may be, for example, a distribution location identification for the Americas region set by a technician for the target service. The configuration center service deployed on the server 200 may obtain configuration values of one or more configuration items of the target service corresponding to the second distribution location in the general environment configuration template based on the second distribution location identification.
[0091] As mentioned above, the above-mentioned purpose identification parameter may be, for example, a first purpose identification, which may be, for example, a purpose identification for reviewing the insured person's qualifications set by a technician for the target service. The configuration center service deployed on the server 200 may obtain the configuration values of one or more configuration items of the target service corresponding to the first purpose in the general configuration template based on the first purpose identification.
[0092] For another example, the above-mentioned purpose identification parameter may be a second purpose identification, and the second purpose identification may be, for example, a purpose identification for reviewing the insurance amount set by a technician for the target service. The configuration center service deployed on the server 200 may obtain the configuration values of one or more configuration items of the target service corresponding to the second purpose in the general configuration template based on the second purpose identification.
[0093] 205: Generate the environment configuration result required for the target service to run in the target environment.
[0094] Exemplarily, the configuration center service deployed on server 200 replaces the configuration values of the configuration items in the environment configuration template with the configuration values of the target environment based on the configuration values of the configuration items obtained in step 203 and the configuration values of the configuration items obtained in step 204, and generates the environment configuration results required for the target service to run in the target environment.
[0095] Each configuration value of the target environment can be stored in a configuration value file corresponding to the configuration center service deployed on the server 200. The configuration value file can include environment identification parameters, configuration item names and configuration values. Each configuration value is stored separately in the configuration value file according to the environment identification parameters corresponding to the operating environment.
[0096] As an example, Table 2 shows configuration value information stored in a configuration value file according to an embodiment of the present application.
[0097] Table 2
[0098] Environmental identification parameters Configuration item name Configuration Values develop DOMAIN dev.insuremo.com develop DB_HOST 192.168.0.21 develop DB_PORT 3306 develop DB_USER dev_user develop DB_PASSWORD dev_password test DOMAIN test.insuremo.com test DB_HOST 192.168.2.21 test DB_PORT 3306 test DB_USER test_user test DB_PASSWORD test_password production DOMAIN production.insuremo.com production DB_HOST 192.168.6.21 production DB_PORT 3306 production DB_USER production_user production DB_PASSWORD production_password
[0099] As shown in Table 2, "develop", "test" and "production" are environment identification parameters corresponding to different operating environments, and the environment identification parameters may be the name or unique identification information of each operating environment.
[0100] In the operating environment corresponding to "develop", "DOMAIN" can be, for example, the configuration item name of the corresponding domain name. Correspondingly, "dev.insuremo.com" can be the configuration value of the configuration item corresponding to the above-mentioned domain name "DOMAIN" in the "develop" operating environment. "DB_HOST" can be, for example, the configuration item name of the corresponding host. Correspondingly, "192.168.0.21" can be the configuration value of the configuration item corresponding to the above-mentioned host "DB_HOST" in the "develop" operating environment. "DB_PORT" is the configuration item name of the corresponding database port number. Correspondingly, "3306" can be the configuration value of the configuration item corresponding to the above-mentioned database port number "DB_PORT" in the "develop" operating environment. "DB_USER" can be, for example, the configuration item name of the corresponding database user name. Correspondingly, "dev_user" can represent the configuration value of the configuration item corresponding to the above-mentioned database user name "DB_USER" in the "develop" operating environment. "DB_PASSWORD" can be, for example, the configuration item name of the corresponding database user name. Correspondingly, "dev_password" can represent the configuration value of the configuration item corresponding to the above database user name "DB_PASSWORD" in the "develop" operating environment.
[0101] Similarly, in the operating environment corresponding to "test", "DOMAIN" can be, for example, the configuration item name of the corresponding domain name. Correspondingly, "test.insuremo.com" can be the configuration value of the configuration item corresponding to the above-mentioned domain name "DOMAIN" in the "test" operating environment. "DB_HOST" can be, for example, the configuration item name of the corresponding host. Correspondingly, "192.168.2.21" can be the configuration value of the configuration item corresponding to the above-mentioned host "DB_HOST" in the "test" operating environment. "DB_PORT" can be, for example, the configuration item name of the corresponding database port number. Correspondingly, "3306" is the configuration value of the configuration item corresponding to the above-mentioned database port number "DB_PORT" in the "test" operating environment. "DB_USER" is the configuration item name of the corresponding database user name. Correspondingly, "test_user" can represent the configuration value of the configuration item corresponding to the above-mentioned database user name "DB_USER" in the "test" operating environment. "DB_PASSWORD" can be, for example, the configuration item name of the corresponding database user name. Correspondingly, "test_password" represents the configuration value of the configuration item corresponding to the above database user name "DB_PASSWORD" in the "test" running environment.
[0102] Similarly, in the operating environment corresponding to "production", "DOMAIN" can be, for example, the configuration item name of the corresponding domain name. Correspondingly, "production.insuremo.com" is the configuration value of the configuration item corresponding to the above domain name "DOMAIN" in the "production" operating environment. "DB_HOST" can be, for example, the configuration item name of the corresponding host. Correspondingly, "192.168.6.21" is the configuration value of the configuration item corresponding to the above host "DB_HOST" in the "production" operating environment. "DB_PORT" can be, for example, the configuration item name of the corresponding database port number. Correspondingly, "3306" is the configuration value of the configuration item corresponding to the above database port number "DB_PORT" in the "production" operating environment. "DB_USER" is the configuration item name of the corresponding database user name. Correspondingly, "production_user" represents the configuration value of the configuration item corresponding to the above database user name "DB_USER" in the "production" operating environment. "DB_PASSWORD" can be, for example, the configuration item name of the corresponding database user name. Correspondingly, "production_password" represents the configuration value of the configuration item corresponding to the above database user name "DB_PASSWORD" in the "production" running environment.
[0103] Exemplarily, based on the configuration values of each configuration item obtained in step 203 and step 204, which may be, for example, the configuration values of the configuration items required for the target service to run in a production environment, server 200 replaces the configuration value variables set for the above-mentioned corresponding configuration items in the environment configuration template with the configuration values of each configuration item corresponding to the "production" environment identification parameter in the configuration value file.
[0104] Specifically, replace the configuration value variable "environment.DOMAIN" of the configuration item that sets the corresponding domain name "domain" in the environment configuration template with the corresponding configuration value "production.insuremo.com" of the configuration item name "DOMAIN" corresponding to the environment identification parameter "production" in the configuration value file. Replace the configuration value variable "environment.DB_HOST" of the configuration item that sets the corresponding domain name "db_host" in the environment configuration template with the corresponding configuration value "192.168.6.21" of the configuration item name "DB_HOST" corresponding to the environment identification parameter "production" in the configuration value file. Replace the configuration value variable "environment.DB_PORT" of the configuration item that sets the corresponding domain name "db_port" in the environment configuration template with the corresponding configuration value "3306" of the configuration item name "DB_PORT" corresponding to the environment identification parameter "production" in the configuration value file. Replace the configuration value variable "environment.DB_USER" of the configuration item corresponding to the domain name "db_user" in the environment configuration template with the corresponding configuration value "production_user" of the configuration item name "DB_USER" corresponding to the environment identification parameter "production" in the configuration value file. Replace the configuration value variable "environment.DB_PASSWORD" of the configuration item corresponding to the domain name "db_password" in the environment configuration template with the corresponding configuration value "production_password" of the configuration item name "DB_PASSWORD" corresponding to the environment identification parameter "production" in the configuration value file.
[0105] It can be understood that in some embodiments, the above-mentioned configuration value file can be stored on the server 200 in JSON format, YAML format, TOML format, etc., which is not limited here.
[0106] In other embodiments, each configuration value of the target environment may also be stored in a K / V type database corresponding to the call of the configuration center service in the form of a data table. The above data table may, for example, include each unique configuration item name corresponding to the target environment, and each configuration value corresponding to the unique configuration item name. The above unique configuration item name serves as the primary key (key) of the above data table, and the above configuration value serves as the value (value) corresponding to the primary key (key) of the data table.
[0107] It can be understood that the above primary key can be constructed by, for example, concatenating an environment identification parameter with a configuration item name.
[0108] Figure 3 According to an embodiment of the present application, a schematic diagram of the system software structure of a server 200 is shown.
[0109] like Figure 3 As shown, the system software structure of the server 200 may include, for example, a database 210 , a configuration center service 220 , and a template engine 230 .
[0110] Database 210 is used to provide data storage capabilities. In some embodiments of the present application, database 210 may be, for example, a K / V type database. For example, based on the service operation environment configuration method provided in the embodiment of the present application, the configuration value file of the target environment and the environment configuration result generated after the server 200 obtains the environment configuration request may be stored in the database in the form of a data table for acquisition by the configuration center service 220.
[0111] The template engine 230 is used to replace the configuration value of each configuration item of the target environment in the environment configuration template with the configuration value of the target environment in the configuration value file.
[0112] The template engine is a tool that combines data and templates to generate text output. The template engine replaces the data with the parameter part corresponding to the tag or placeholder in the template according to the engine's replacement rules, and quickly generates data in a specific text format such as Hypertext Markup Language (HTML), Extensible Markup Language (XML), JSON, etc.
[0113] It is understandable that the above template engines vary depending on the technology stack used in the service development process. For example, some technology stacks may be golang's text / template or sprig, and other technology stacks may be javascript's mustache.js, etc., which are not limited here.
[0114] It is understandable that using different template engines will not cause any difference in the format of the environment configuration result generated by calling the template engine. It is understandable that due to the different template engines called, when writing the environment configuration template, the template writing method is different.
[0115] The configuration center service 220 is a basic service component for storing project configuration information, which is used to generate environment configuration results and uniformly store and manage them. Through the configuration center service, developers can store the configuration information of the application (such as database connection strings, API keys, log levels, etc.) in a centralized location and dynamically obtain these configuration information when needed. In the present application, the configuration center service 220 may also include a data acquisition module 221 and a data transmission module 222, which are used to obtain the corresponding operating environment of the environment configuration template, the corresponding distribution location, the configuration values of the configuration items corresponding to the development purpose, and the configuration values of the target environment in the configuration value file, and send the above values to the template engine 230.
[0116] Among them, the data acquisition module 221 is used to obtain an environment configuration request, load an environment configuration template, and obtain the configuration values of the configuration items corresponding to the operating environment, the corresponding distribution location, and the corresponding development purpose of the environment configuration template, as well as the configuration value of the target environment in the configuration value file. For example, based on the obtained environment configuration request, the data acquisition module 221 obtains the environment identifier, the distribution location identifier, and the purpose identifier carried by the environment configuration request, and obtains the configuration values of the configuration items corresponding to the operating environment, the corresponding distribution location, and the corresponding development purpose in the environment configuration template based on the above identifiers. That is, the server 200 can perform the above steps 201, 202, 203, and 204 based on the data acquisition module 221.
[0117] The data transmission module 222 is used to implement data transmission between the configuration center service 220 and the template engine 230. For example, based on the acquisition of the configuration value of the configuration item in the environment configuration template and the acquisition of the corresponding operating environment configuration value in the configuration value file, the data transmission template 222 sends the above configuration value to the template engine 230, and stores the environment configuration result of the corresponding operating environment generated by the template engine 230 to the database 210 called by the configuration center service 220. That is, the server 200 can perform the above step 205 process based on the data transmission module 222.
[0118] Figure 4 According to an embodiment of the present application, a schematic diagram of the interaction between the configuration center service 220 and the template engine 230 is shown.
[0119] 401: The configuration center service 220 calls the environment configuration template in response to the environment configuration request.
[0120] 402: The configuration center service 220 determines the configuration value of each configuration item related to the target environment in the environment configuration template based on the environment identification parameter carried in the environment configuration request.
[0121] 403: The configuration center service 220 determines the configuration values of each configuration item related to the distribution location and / or development purpose in the environment configuration template based on other identification parameters such as the distribution location and / or development purpose carried in the environment configuration request.
[0122] For the specific execution process of the above steps 401, 402 and 403, refer to the above Figure 2 The relevant descriptions of step 202, step 203 and step 204 are not repeated here.
[0123] 404: The configuration center service 220 obtains the configuration values of each configuration item corresponding to the target environment in the configuration value file based on the environment identification parameters and the configuration values of the configuration items related to the target environment, the target distribution location, and the target development purpose in the environment configuration template.
[0124] 405: The configuration center service 220 sends the configuration values of each configuration item corresponding to the target environment to the template engine 230.
[0125] Exemplarily, the configuration center service 220 may send to the template engine the configuration values of the configuration items related to the target environment, target distribution location, and target development purpose in the environment template obtained in the above steps 402 and 403, as well as the configuration values of each configuration item of the target environment in the configuration value file obtained in the above step 404.
[0126] 406: The template engine 230 replaces the configuration values of the configuration items related to the target environment, target distribution location, and target development purpose in the environment configuration template with the configuration values of the target environment in the configuration value file, and generates an environment configuration result.
[0127] The template engine receives the configuration values related to the target environment, target distribution location, and target development purpose of the configuration project in the environment configuration template obtained in the above steps 402 and 403, as well as the configuration values of the target environment in the configuration value file obtained in the above step 404, loads the environment configuration template, and replaces the configuration values of the configuration items related to the target environment, target distribution location, and target development purpose in the environment configuration template with the configuration values of the configuration items of the target environment in the configuration value file.
[0128] 407: The template engine 230 returns the environment configuration result corresponding to the target service running in the target environment to the configuration center service 220.
[0129] Figure 5 According to an embodiment of the present application, a schematic diagram of the hardware structure of a server 200 is shown.
[0130] like Figure 5As shown, in some embodiments, the server 200 may include one or more processors 504, a system control logic 508 connected to at least one of the processors 504, a system memory 512 connected to the system control logic 508, a non-volatile memory (NVM) 516 connected to the system control logic 508, and a network interface 520 connected to the system control logic 508.
[0131] In some embodiments, the processor 504 may include one or more single-core or multi-core processors. In some embodiments, the processor 504 may include any combination of general-purpose processors and special-purpose processors (eg, graphics processors, application processors, baseband processors, etc.).
[0132] In some embodiments, system control logic 508 may include any suitable interface controller to provide any suitable interface to at least one of processors 504 and / or any suitable device or component in communication with system control logic 508 .
[0133] In some embodiments, the system control logic 508 may include one or more memory controllers to provide an interface to the system memory 512. The system memory 512 may be used to load and store data and / or instructions. In some embodiments, the memory 512 of the server 200 may include any suitable volatile memory, such as a suitable dynamic random access memory (DRAM).
[0134] The non-volatile memory 516 may include one or more tangible, non-transitory readable storage media for storing data and / or instructions. In some embodiments, the non-volatile memory 516 may include any suitable non-volatile memory such as flash memory and / or any suitable non-volatile storage device, such as a hard disk drive (HDD), a compact disc (CD) drive, and a digital versatile disc (DVD) drive.
[0135] The non-volatile memory 516 may include a portion of storage resources on the device on which the server 200 is installed, or it may be accessible by the device but not necessarily a portion of the device. For example, the non-volatile memory 516 may be accessed over a network via the network interface 520 .
[0136] In particular, system memory 512 and non-volatile memory 516 may include, respectively, a temporary copy and a permanent copy of instructions 524. Instructions 524 may include instructions that, when executed by at least one of processors 504, cause server 200 to implement the following: Figure 3 In some embodiments, instructions 524, hardware, firmware, and / or software components thereof may additionally / alternatively be located in system control logic 508, network interface 520, and / or processor 504.
[0137] The network interface 520 may include a transceiver for providing a radio interface for the server 200 to communicate with any other suitable devices (such as front-end modules, antennas, etc.) through one or more networks. In some embodiments, the network interface 520 may be integrated with other components of the server 200.
[0138] The network interface 520 may further include any suitable hardware and / or firmware to provide a multiple-input multiple-output radio interface. For example, the network interface 520 may be a network adapter, a wireless network adapter, a telephone modem and / or a wireless modem.
[0139] In one embodiment, at least one of the processors 504 may be packaged with logic for one or more controllers of the system control logic 508 to form a system-in-package (Session Initiation Protocol, SiP). In one embodiment, at least one of the processors 504 may be integrated with logic for one or more controllers of the system control logic 508 on the same die to form a system on chip (System On Chip, SoC).
[0140] The server 200 may further include an input / output (I / O) device 532. The I / O device 532 may include a user interface to enable a user to interact with the server 200; and a peripheral component interface design to enable peripheral components to interact with the server 200. In some embodiments, the server 200 further includes a sensor for determining at least one of an environmental condition and location information related to the server 200.
[0141] In some embodiments, the user interface may include, but is not limited to, a display (e.g., an LCD display, a touch screen display, etc.), a speaker, a microphone, one or more cameras (e.g., a still image camera and / or a video camera), a flashlight (e.g., an LED flash), and a keyboard.
[0142] In some embodiments, the peripheral component interface may include, but is not limited to, a non-volatile memory port, an audio jack, and a power interface.
[0143] References to "one embodiment" or "an embodiment" in the specification mean that the specific features, structures, or characteristics described in conjunction with the embodiment are included in at least one exemplary implementation or technology disclosed according to the embodiment of the present application. The appearance of the phrase "in one embodiment" in various places in the specification does not necessarily all refer to the same embodiment.
[0144] The disclosure of the embodiment of the present application also relates to an operating device for executing the text. The device can be constructed specifically for the required purpose or it can include a general-purpose computer selectively activated or reconfigured by a computer program stored in the computer. Such a computer program can be stored in a readable storage medium, such as, but not limited to any type of disk, including a floppy disk, an optical disk, a CD-ROM, a magneto-optical disk, a read-only memory (ROM), a random access memory (RAM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic or optical card, an application-specific integrated circuit (ASIC) or any type of medium suitable for storing electronic instructions, and each can be coupled to a computer system bus. In addition, the computer mentioned in the specification may include a single processor or may be an architecture involving multiple processors for increased computing power.
[0145] In addition, the language used in this specification has been primarily selected for readability and instructional purposes and may not be selected to describe or limit the disclosed subject matter. Therefore, the present application embodiment disclosure is intended to illustrate rather than limit the scope of the concepts discussed herein.
Claims
1. A service operation environment configuration method, applied to electronic equipment, It is characterized in that include: Obtaining an environment configuration request for a first service, wherein the environment configuration request at least includes a first environment identifier corresponding to a first environment in which the first service runs, and the environment configuration request also includes at least one of a first distribution location identifier and a first purpose identifier published by the first service; In response to the environment configuration request, obtaining a first configuration template, wherein the first configuration template includes at least one configuration item required for the first service to run in the first environment; and Determine a configuration value for the at least one configuration item based on the first environment identifier and at least one of the first distribution location identifier and the first purpose identifier; An environment configuration result corresponding to the operation of the first service in the first environment is generated based at least on the first environment identifier and at least one of the first distribution location identifier and the first purpose identifier, and a configuration value of the at least one configuration item.
2. The method according to claim 1, It is characterized in that Determining a configuration value of the at least one configuration item based on the first environment identifier and at least one of the first distribution location identifier and the first purpose identifier, includes: Based on the first environment identifier, determining one or more first configuration values for one or more first part configuration items in the at least one configuration item; and, Based on the first environment identifier and the first distribution location identifier, determining a second configuration value for one or more second part configuration items in the at least one configuration item; and The generating, based at least on the first environment identifier and at least one of the first distribution location identifier and the first purpose identifier, and the configuration value of the at least one configuration item, an environment configuration result corresponding to the operation of the first service in the first environment includes: A first environment configuration result corresponding to the operation of the first service in the first environment is generated based at least on the first environment identifier, the first part of the configuration items and the one or more first configuration values, the first distribution location identifier, the second part of the configuration items and the one or more second configuration values.
3. The method according to claim 1, It is characterized in that Determining a configuration value of the at least one configuration item based on the first environment identifier and at least one of the first distribution location identifier and the first purpose identifier, includes: Based on the first environment identifier, one or more first configuration values for one or more first part configuration items in the at least one configuration item are determined; wherein, Based on the first environment identifier and the first use identifier, determining a third configuration value for one or more third part configuration items in the at least one configuration item; and The generating, based at least on the first environment identifier and at least one of the first distribution location identifier and the first purpose identifier, and the configuration value of the at least one configuration item, an environment configuration result corresponding to the operation of the first service in the first environment includes: A second environment configuration result corresponding to the operation of the first service in the first environment is generated based at least on the first environment identifier, the first part of the configuration items and the one or more first configuration values, the first purpose identifier, the third part of the configuration items and the one or more third configuration values.
4. The method according to claim 1, It is characterized in that Determining a configuration value of the at least one configuration item based on the first environment identifier and at least one of the first distribution location identifier and the first purpose identifier, includes: Based on the first environment identifier, determining one or more first configuration values for one or more first part configuration items in the at least one configuration item; and, determining, based on the first environment identifier and the first distribution location identifier, a second configuration value for one or more second part configuration items in the at least one configuration item; and Based on the first environment identifier and the first use identifier, determining a third configuration value for one or more third part configuration items in the at least one configuration item; and The generating, based at least on the first environment identifier and at least one of the first distribution location identifier and the first purpose identifier, and the configuration value of the at least one configuration item, an environment configuration result corresponding to the operation of the first service in the first environment includes: Based at least on the first environment identifier, the first part of the configuration items and the one or more first configuration values, the first distribution location identifier, the second part of the configuration items and the one or more second configuration values, the first purpose identifier, the third part of the configuration items and the one or more third configuration values, generate a third environment configuration result corresponding to the first service running in the first environment.
5. The method according to claim 2, It is characterized in that The first configuration template includes an environment identification parameter corresponding to the first part of the configuration items, and a first variable corresponding to the first configuration item in the second part of the configuration items, wherein the environment identification parameter corresponds to the first configuration value, and The generating a first environment configuration result corresponding to the first service running in the first environment includes: The environment identification parameter in the first configuration template is replaced with the first environment identification, and the first variable is replaced with the second configuration value to generate the first environment configuration result.
6. The method according to claim 3, It is characterized in that The first configuration template includes an environment identification parameter corresponding to the first part of the configuration items and a second variable corresponding to the second configuration item in the third part of the configuration items, wherein the environment identification parameter corresponds to the first configuration value, and The generating a second environment configuration result corresponding to the first service running in the first environment includes: The environment identification parameter in the first configuration template is replaced with the first environment identification, and the second variable is replaced with the third configuration value to generate the second environment configuration result.
7. The method according to claim 4, It is characterized in that The first configuration template includes an environment identification parameter corresponding to the first part of the configuration items, a first variable corresponding to the first configuration item in the second part of the configuration items, and a second variable corresponding to the second configuration item in the third part of the configuration items, wherein the environment identification parameter corresponds to the first configuration value, and The generating a third environment configuration result corresponding to the first service running in the first environment includes: The environment identification parameter in the first configuration template is replaced with the first environment identification, the first variable is replaced with the second configuration value, and the second variable is replaced with the third configuration value to generate the third environment configuration result.
8. The method according to claim 7, It is characterized in that The electronic device includes a first configuration file corresponding to the first service running in the first environment, wherein the first configuration file is stored in a file calling path of the configuration center service, and, The first configuration file includes the first environment identifier, the name of the first configuration item and the second configuration value, the name of the second configuration item and the third configuration value.
9. The method according to claim 8, It is characterized in that The electronic device includes a database, and the first configuration file includes a first data table in the database; wherein, The primary key of the first data table includes any one of the following: The first environment identifier and the first configuration item name; The first environment identifier and the second configuration item name; The first environment identifier, the first configuration item name, and the second configuration item name.
10. The method according to any one of claims 1 to 9, It is characterized in that The electronic device at least includes a configuration center service, and The obtaining of the environment configuration request for the first service includes: The configuration center service obtains the environment configuration request for the first service, and based on the environment configuration request, obtains the first environment identifier, and at least one of the first distribution location identifier and the first purpose identifier; The step of obtaining a first configuration template in response to the environment configuration request includes: The configuration center service obtains the first configuration template in response to the environment configuration request.
11. The method according to claim 10, It is characterized in that The electronic device further includes a template engine, and, The determining the configuration value of the at least one configuration item based on the first environment identifier and at least one of the first distribution location identifier and the first purpose identifier includes: The configuration center service determines a configuration value of the at least one configuration item in the first configuration template based on the first environment identifier and at least one of the first distribution location identifier and the first purpose identifier, and sends the configuration value to the template engine; The generating, based at least on the first environment identifier and at least one of the first distribution location identifier and the first purpose identifier, and the configuration value of the at least one configuration item, an environment configuration result corresponding to the operation of the first service in the first environment includes: The template engine generates an environment configuration result corresponding to the operation of the first service in the first environment based at least on the first environment identifier and the first distribution location identifier, at least one of the first purpose identifiers, and the configuration value of the at least one configuration item, generates an environment configuration result corresponding to the operation of the first service in the first environment, and returns the environment configuration result to the configuration center service.
12. An electronic device, It is characterized in that It includes one or more processors; one or more memories; the one or more memories store one or more programs, and when the one or more programs are executed by the one or more processors, the device executes the service operating environment configuration method described in any one of claims 1 to 11.
13. A readable storage medium, It is characterized in that The storage medium stores instructions, and when the instructions are executed on a computer, the computer is caused to execute the service operation environment configuration method according to any one of claims 1 to 11.
Citation Information
Cited By
Solidified configuration value writing method and device, electronic equipment and storage medium
CN121070453A
