Application profile updating method, device and server
By using a pre-defined mapping relationship between the configuration table and the application identifier, the application's configuration file is automatically updated, solving the problems of low efficiency and error-proneness of manual modification, and achieving efficient and accurate configuration file updates.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INDUSTRIAL AND COMMERCIAL BANK OF CHINA
- Filing Date
- 2023-03-14
- Publication Date
- 2026-06-26
AI Technical Summary
In existing technologies, configuration file updates rely on manual modification, which is inefficient and prone to errors, especially in the context of modular transformation of applications, where the workload is large.
By using a preset configuration table, the variables and their values that need to be updated in the target application's configuration file are automatically determined. By utilizing the mapping relationship between the target application's identifier and the unit identifier, the configuration file can be automatically updated.
It improves the efficiency of configuration file updates and reduces the probability of errors, especially in the scenario of application modularization, it can efficiently update the configuration files of multiple applications.
Smart Images

Figure CN116467007B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to computer technology, and more particularly to a method, apparatus, and server for updating configuration files for an application. Background Technology
[0002] Currently, application configuration files are used in both the internal logic processing of applications and during application invocation. With rapid business growth, some application configuration files need to be updated. Examples include: application modularization, incorrect initial configuration of application configuration files, and the need to add distributed application coordination service ZooKeeper and Scalable Open Financial Architecture (SOFA) addresses to application processes.
[0003] In existing technologies, application configuration files are hardcoded. If the values of certain variables in the application configuration file need to be updated, manual modification is required. Manual modification first requires rebuilding the application's build package, then redistributing the version, importing the build package into a Platform as a Service (PaaS) platform, and finally upgrading the runtime template to complete the configuration file update.
[0004] However, the above-mentioned manual modification method is inefficient and prone to errors. Summary of the Invention
[0005] This disclosure provides a method, apparatus, and server for updating application configuration files, to solve the problems of low efficiency and error-proneness in the manual modification of application configuration files in the prior art.
[0006] According to a first aspect of this disclosure, a method for updating an application's configuration file is provided, comprising:
[0007] Obtain the configuration file update instruction, wherein the configuration file update instruction includes the identifier of the target application;
[0008] If it is determined that the identifier of the target application matches a preset application registry, wherein the preset application registry includes the identifier of the application and the mapping relationship between the identifiers of the units to which the application belongs; different applications within the same unit share the same cluster resource pool, and the cluster resource pools corresponding to different units are isolated from each other;
[0009] Based on the target application's identifier and a preset configuration table, at least one target variable that needs to be updated in the target application's configuration file, and the value of each target variable, are determined. The preset configuration table includes the mapping relationship between the application's identifier, the unit identifier to which the application belongs, the variable name, and the variable value. The unit identifier corresponds to the identifier of at least one application.
[0010] The configuration file of the target application is updated based on the at least one target variable and the value of each target variable.
[0011] In one possible implementation, updating the configuration file of the target application based on the at least one target variable and the value of each target variable includes:
[0012] If it is determined that the target variable matches a variable in the configuration file of the target application, then the value of the variable in the configuration file of the target application that matches the target variable is updated according to the value of the target variable;
[0013] If it is determined that the target variable does not match the variable in the target application's configuration file, then the target variable and its value are added to the target application's configuration file.
[0014] In one possible implementation, determining that the target variable matches a variable in the configuration file of the target application includes:
[0015] The variable name of the target variable is compared one by one with the variable name in the configuration file of the target application;
[0016] If the variable name of the target variable is the same as the variable name in the configuration file of the target application, then the target variable is determined to match the variable in the configuration file of the target application.
[0017] In one possible implementation, determining that the target variable does not match a variable in the target application's configuration file includes:
[0018] The variable name of the target variable is compared one by one with the variable name in the configuration file of the target application;
[0019] If the variable name of the target variable is different from the variable name in the configuration file of the target application, then it is determined that the target variable does not match the variable in the configuration file of the target application.
[0020] In one possible implementation, determining at least one target variable that needs to be updated in the configuration file of the target application, and the value of each target variable, based on the identifier of the target application and a preset configuration table, includes:
[0021] Based on the identifier of the target application, the preset configuration table is queried to determine the target unit identifier corresponding to the identifier of the target application;
[0022] Based on the target unit identifier, determine the variable name and value of at least one variable corresponding to the target unit identifier. Based on the variable name and value of at least one variable corresponding to the target unit identifier, determine at least one target variable that needs to be updated in the configuration file of the target application, and the value of each target variable.
[0023] One possible implementation also includes:
[0024] Determine the preset configuration table based on the network segment to which the application belongs.
[0025] According to a second aspect of this disclosure, an application configuration file update apparatus is provided, comprising:
[0026] The acquisition unit is used to acquire a configuration file update instruction, wherein the configuration file update instruction includes the identifier of the target application;
[0027] A determining unit is used to determine if the identifier of the target application matches a preset application registry, wherein the preset application registry includes the identifier of the application and the mapping relationship between the identifier of the unit to which the application belongs; different applications within the same unit share the same cluster resource pool, and the cluster resource pools corresponding to different units are isolated from each other;
[0028] Based on the target application's identifier and a preset configuration table, at least one target variable that needs to be updated in the target application's configuration file, and the value of each target variable, are determined. The preset configuration table includes the mapping relationship between the application's identifier, the unit identifier to which the application belongs, the variable name, and the variable value. The unit identifier corresponds to the identifier of at least one application.
[0029] An update unit is configured to update the configuration file of the target application based on the at least one target variable and the value of each target variable.
[0030] According to a third aspect of this disclosure, a server is provided, including a memory and a processor; wherein,
[0031] The memory is used to store computer programs;
[0032] The processor is configured to read the computer program stored in the memory and execute the application configuration file update method as described in the first aspect based on the computer program in the memory.
[0033] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided, wherein computer-executable instructions are stored therein, and when a processor executes the computer-executable instructions, a configuration file update method for the application as described in the first aspect is implemented.
[0034] According to a fifth aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements a configuration file update method for an application as described in the first aspect.
[0035] The application configuration file update method, apparatus, and server disclosed herein include: obtaining a configuration file update instruction, the configuration file update instruction including the identifier of the target application; if it is determined that the identifier of the target application matches a preset application registry, wherein the preset application registry includes a mapping relationship between the application identifier and the unit identifier to which the application belongs; different applications within the same unit share the same cluster resource pool, and the cluster resource pools corresponding to different units are isolated from each other; then, based on the identifier of the target application and a preset configuration table, determining at least one target variable that needs to be updated in the configuration file of the target application, and the value of each target variable; wherein the preset configuration table includes a mapping relationship between the application identifier, the unit identifier to which the application belongs, the variable name, and the variable value; the unit identifier corresponds to the identifier of at least one application; and updating the configuration file of the target application based on at least one target variable and the value of each target variable. The application configuration file update method, apparatus, and server provided in this solution can automatically update the corresponding configuration files of various applications belonging to different units using a preset configuration table, which is highly efficient and less prone to errors. Attached Figure Description
[0036] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 A flowchart illustrating an application configuration file update method as an exemplary embodiment of this disclosure;
[0038] Figure 2 A flowchart illustrating a configuration file update method for an application, as shown in another exemplary embodiment of this disclosure;
[0039] Figure 3 A structural diagram of a configuration file updating device for an application, as illustrated in an exemplary embodiment of this disclosure;
[0040] Figure 4 A structural diagram of an application configuration file updating device illustrated in another exemplary embodiment of this disclosure;
[0041] Figure 5 This is a structural diagram of a server shown as an exemplary embodiment of the present disclosure. Detailed Implementation
[0042] Currently, application configuration files are used in both the internal logic processing of applications and during application invocation. With rapid business growth, some application configuration files require updates. Examples include: application modularization, incorrect initial configuration of application configuration files, and the need to add distributed application coordination service ZooKeeper and Scalable Open Financial Architecture (SOFA) addresses to application processes. Application modularization refers to dividing physical resources (e.g., physical machines, data centers) and logical resources (logical resources are logical-level resources abstracted from physical resources, application-oriented) according to unit domains. SOFA is a distributed middleware. In existing technologies, application configuration files are hardcoded. If the values of certain variables in the application configuration file need to be updated, manual modification is required. Manual modification first requires rebuilding the application build package, then redistributing the version, importing the build package into a Platform as a Service (PaaS) platform, and upgrading the runtime template to update the configuration file. The application build package refers to the compressed configuration file package of the application's running process. Applications can run on deployment resources within a Kubernetes (k8s) cluster, a container cluster management system within a PaaS platform. A deployment in a k8s cluster is an object that defines and manages multiple replicas of an application.
[0043] However, the above manual modification method is inefficient and prone to errors. Especially for application modularization scenarios, where each application belongs to a different unit, corresponding configuration file updates are required for each application in different units. This results in a large number of applications requiring configuration file updates and a significant workload.
[0044] To address the aforementioned technical issues, the solution provided in this disclosure utilizes a preset configuration table to automatically update the configuration files of various applications belonging to different units, which is highly efficient and less prone to errors.
[0045] The technical solutions of this disclosure and how they solve the aforementioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of this disclosure will now be described with reference to the accompanying drawings.
[0046] Figure 1 This is a flowchart illustrating an application configuration file update method as an exemplary embodiment of the present disclosure.
[0047] like Figure 1 As shown, the application configuration file update method provided in this embodiment includes:
[0048] Step 101: Obtain the configuration file update instruction, which includes the identifier of the target application.
[0049] The method provided in this disclosure can be executed by a server with computing power.
[0050] The target application's identifier can be used to uniquely identify the target application.
[0051] The configuration file update command can be generated based on user-defined commands. The server is capable of retrieving this configuration file update command.
[0052] Alternatively, the configuration file update command can be sent by the client, and the server can receive configuration file update commands sent by the client.
[0053] This disclosure does not restrict the method of obtaining configuration file update commands.
[0054] Specifically, the configuration file update command can include the identifier of the target application whose configuration file needs to be updated.
[0055] Step 102: If it is determined that the target application's identifier matches a preset application registry, wherein the preset application registry includes a mapping relationship between the application's identifier and the unit identifier to which the application belongs; different applications within the same unit share the same cluster resource pool, and the cluster resource pools corresponding to different units are isolated from each other; then, based on the target application's identifier and the preset configuration table, determine at least one target variable that needs to be updated in the target application's configuration file, and the value of each target variable; wherein the preset configuration table includes a mapping relationship between the application's identifier, the unit identifier to which the application belongs, the variable name, and the variable value; the unit identifier corresponds to at least one application's identifier.
[0056] The preset application registry is a pre-configured application registry based on actual conditions. This preset application registry may include the application's identifier and the mapping relationship between the identifier of the unit to which the application belongs.
[0057] Specifically, a unit can include multiple applications, and different applications within the same unit can share the same cluster resource pool, while the cluster resource pools corresponding to different units can be isolated from each other.
[0058] Specifically, if the identifier of the target application matches the preset application registry, then the target application can be identified as an application that has undergone unitization modification.
[0059] Specifically, the method provided in this embodiment can update the configuration file of the divided units, or it can update the configuration file at the same time as dividing the units.
[0060] The preset configuration table is a pre-configured table based on actual conditions. This preset configuration table includes the application's identifier, the unit identifier to which the application belongs, the variable names, and the mapping relationships between the variable values.
[0061] Furthermore, the pre-set configuration tables can be stored in the database for easy viewing and use.
[0062] The unit identifier of the application can be used to uniquely identify the unit to which the application belongs.
[0063] Specifically, applications belonging to the same unit need to update the same configuration file content, and the variables and their values in the configuration files also need to be updated. However, applications belonging to different units need to modify different configuration file content.
[0064] Furthermore, a preset configuration table can be determined based on the above-mentioned characteristics of the application.
[0065] Specifically, a unit can include at least one application. Therefore, in the preset configuration table, the unit identifier of a unit can correspond to the identifier of at least one application.
[0066] Specifically, the variable name of at least one variable corresponding to the unit identifier in the preset configuration table, as well as the value of each variable, can be used to represent the variable name and the updated value of the variable in the configuration file that needs to be updated for each application in that unit.
[0067] Specifically, the configuration file of the application in each unit needs to update at least one variable. Therefore, in the preset configuration table, a unit identifier can correspond to the variable name of at least one variable. In the preset configuration table, each variable name has a unique variable value corresponding to it.
[0068] Specifically, the target application's identifier can be used to query a preset configuration table, and based on the variable name and value of at least one variable found, the target application's configuration file can be determined to have at least one target variable that needs to be updated, as well as the value of each target variable.
[0069] Specifically, based on the variable name of at least one variable retrieved, the target application's configuration file can be determined to have at least one target variable that needs to be updated.
[0070] On the other hand, based on the values of the variables corresponding to the variable names of each variable retrieved, the value of each target variable that needs to be updated in the configuration file of the target application can be determined.
[0071] In the context of application modularization, where applications belong to different units, corresponding configuration file updates are required for each unit. In the method provided in this embodiment, applications belonging to the same unit need to update the same configuration file content; specifically, the variables and their values in the configuration files need to be updated for applications within the same unit. However, applications belonging to different units need to modify different configuration file content. Therefore, the method provided in this embodiment is applicable to application modularization scenarios.
[0072] Step 103: Update the target application's configuration file based on at least one target variable and the value of each target variable.
[0073] Specifically, the variable name of each target variable corresponding to the target application can be matched sequentially with the variable name in the target application's configuration file to obtain the matching results. Then, based on each matching result, as well as the target variable and its value, the corresponding variable and its value in the target application's configuration file can be updated.
[0074] Furthermore, by updating the target application's configuration file based on all target variables and their values, the update of the target application's configuration file can be achieved.
[0075] The application configuration file update method disclosed herein includes: obtaining a configuration file update instruction, the configuration file update instruction including the identifier of the target application; if it is determined that the identifier of the target application matches a preset application registry, wherein the preset application registry includes a mapping relationship between the application identifier and the unit identifier to which the application belongs; different applications within the same unit share the same cluster resource pool, and the cluster resource pools corresponding to different units are isolated from each other; then, based on the identifier of the target application and a preset configuration table, determining at least one target variable that needs to be updated in the configuration file of the target application, and the value of each target variable; wherein the preset configuration table includes a mapping relationship between the application identifier, the unit identifier to which the application belongs, the variable name, and the variable value; the unit identifier corresponds to the identifier of at least one application; and updating the configuration file of the target application based on at least one target variable and the value of each target variable. The method adopted in this disclosure can automatically update the configuration files of various applications belonging to different units using a preset configuration table. It is particularly effective in unitized application transformation scenarios, where various applications belong to different units and require corresponding configuration file updates for applications in different units, offering high efficiency and reducing the risk of errors.
[0076] Figure 2 This is a flowchart illustrating a configuration file update method for an application, as shown in another exemplary embodiment of this disclosure.
[0077] like Figure 2 As shown, the application configuration file update method provided in this embodiment includes:
[0078] Step 201: Obtain the configuration file update instruction, which includes the identifier of the target application.
[0079] The target application's identifier can be used to uniquely identify the target application.
[0080] The configuration file update command can be generated based on user-defined commands. The server is capable of retrieving this configuration file update command.
[0081] Alternatively, the configuration file update command can be sent by the client, and the server can receive configuration file update commands sent by the client.
[0082] This disclosure does not restrict the method of obtaining configuration file update commands.
[0083] Specifically, the configuration file update command can include the identifier of the application whose configuration file needs to be updated.
[0084] Step 202: If the target application's identifier matches a preset application registry, where the preset application registry includes the mapping relationship between the application's identifier and the unit identifier to which the application belongs; different applications within the same unit share the same cluster resource pool, while the cluster resource pools corresponding to different units are isolated from each other; then, based on the target application's identifier, a preset configuration table is queried to determine the target unit identifier corresponding to the target application's identifier; where the preset configuration table includes the mapping relationship between the application's identifier, the unit identifier to which the application belongs, the variable name, and the variable value; the unit identifier corresponds to at least one application's identifier.
[0085] The preset application registry is a pre-configured application registry based on actual conditions. This preset application registry can include the application's identifier and the mapping relationship between the identifier of the unit to which the application belongs. Specifically, a unit can include multiple applications, and different applications within the same unit can share the same cluster resource pool, while the cluster resource pools corresponding to different units can be isolated from each other. Specifically, if the identifier of a target application matches the preset application registry, then the target application can be determined to be an application undergoing unitization modification.
[0086] The preset configuration table is a pre-configured table based on actual conditions. This preset configuration table includes the application's identifier, the unit identifier to which the application belongs, the variable names, and the mapping relationships between the variable values.
[0087] The unit identifier of the application can be used to uniquely identify the unit to which the application belongs.
[0088] Specifically, applications belonging to the same unit need to update the same configuration file content, and the variables and their values in the configuration files also need to be updated. However, applications belonging to different units need to modify different configuration file content.
[0089] Specifically, a unit can include at least one application. Therefore, in the preset configuration table, the unit identifier of a unit can correspond to the identifier of at least one application.
[0090] Specifically, the variable name of at least one variable corresponding to the unit identifier in the preset configuration table, as well as the value of each variable, can be used to represent the variable name and the updated value of the variable in the configuration file that needs to be updated for each application in that unit.
[0091] Specifically, the configuration file of the application in each unit needs to update at least one variable. Therefore, in the preset configuration table, a unit identifier can correspond to the variable name of at least one variable. In the preset configuration table, each variable name has a unique variable value corresponding to it.
[0092] In one possible implementation, a preset configuration table is determined based on the network segment to which the application belongs.
[0093] Specifically, the network segment to which an application belongs can refer to the network segment to which the underlying resources running the application (such as servers) belong.
[0094] Specifically, applications can be assigned to different units based on the network segment to which the underlying resources (such as servers) to which they run.
[0095] Alternatively, the underlying resources (such as servers) running each application can be divided into different units based on the different network areas within the core switch to which they belong.
[0096] Alternatively, since the underlying resources (such as servers) in the same network area generally share the same network segment, and the underlying resources (such as servers) in the same network area are generally located in the same region, the underlying resources (such as servers) in the same region can be grouped into the same unit based on the region.
[0097] Specifically, applications running on underlying resources (such as servers) belonging to the same unit also belong to that unit, thus enabling the unit-based transformation of applications. This, in turn, allows for the determination of a pre-defined configuration table.
[0098] In the context of modular application transformation, applications belonging to the same unit need to update the same configuration file content; specifically, applications within the same unit need to update the same variables and their values in their configuration files. However, applications belonging to different units need to modify different configuration file content.
[0099] Furthermore, based on the modular transformation of the above applications and the update characteristics of the configuration files of each application in the modular transformation scenario, a preset configuration table can be determined.
[0100] Specifically, based on the target application's identifier, a preset configuration table can be queried to obtain the target unit identifier corresponding to the target application's identifier. This target unit identifier can be used to identify the unit to which the target application belongs.
[0101] Step 203: Based on the target unit identifier, determine the variable name and value of at least one variable corresponding to the target unit identifier. Based on the variable name and value of at least one variable corresponding to the target unit identifier, determine at least one target variable that needs to be updated in the target application's configuration file, and the value of each target variable.
[0102] Specifically, after step 203, you can execute either step 204 or step 205.
[0103] Specifically, the obtained target unit identifier can be used to query the preset configuration table again to obtain the variable name of at least one variable corresponding to the target unit identifier in the preset configuration table, as well as the value corresponding to the variable name of each variable (the value corresponding to the variable name is the value of the variable).
[0104] Then, based on the variable name of at least one variable corresponding to the target unit identifier in the preset configuration table, and the value corresponding to the variable name of each variable (the value corresponding to the variable name is the value of the variable), the configuration file of the target application that needs to be updated, as well as the value of each target variable, can be determined.
[0105] Specifically, the variable corresponding to the variable name of the variable corresponding to the target unit identifier in the preset configuration table can be determined as the target variable.
[0106] On the other hand, the value of the variable corresponding to the variable name of the target identifier in the preset configuration table can be determined as the value of the target variable.
[0107] Step 204: If it is determined that the target variable matches the variable in the target application's configuration file, then update the value of the variable in the target application's configuration file that matches the target variable based on the value of the target variable.
[0108] Specifically, since there is at least one target variable corresponding to the target application, each target variable can be matched sequentially with the variables in the target application's configuration file. If a target variable matches successfully, the value of the variable in the target application's configuration file that matches that target variable can be replaced with the value of that target variable.
[0109] In one possible implementation, the variable name of the target variable is compared one by one with the variable names in the target application's configuration file; if the variable name of the target variable is the same as the variable name in the target application's configuration file, then the target variable is determined to match the variable in the target application's configuration file.
[0110] Specifically, since there is at least one target variable corresponding to the target application, the variable name of each target variable can be compared one by one with the variable name of each variable in the target application's configuration file. If the variable name of a target variable is the same as the variable name of a variable in the target application's configuration file, the comparison process between the target variable and the variable name in the target application's configuration file can be stopped, and it can be determined that the target variable matches the variable in the target application's configuration file.
[0111] Step 205: If it is determined that the target variable does not match the variable in the target application's configuration file, then add the target variable and its value to the target application's configuration file.
[0112] Specifically, since there is at least one target variable corresponding to the target application, each target variable can be matched against the variables in the target application's configuration file in turn. If a target variable fails to match, that target variable and its value can be added to the target application's configuration file.
[0113] In one possible approach, the variable name of the target variable is compared one-to-one with the variable names in the target application's configuration file; if the variable name of the target variable is different from the variable name in the target application's configuration file, then it is determined that the target variable does not match the variable in the target application's configuration file.
[0114] Specifically, since there is at least one target variable corresponding to the target application, the variable name of each target variable can be compared one by one with the variable name of each variable in the target application's configuration file. If the variable name of a certain target variable is different from the variable name of any variable in the target application's configuration file, it can be determined that the target variable does not match the variable in the target application's configuration file.
[0115] Furthermore, by updating the target application's configuration file based on all target variables and their values, the target application's configuration file can be updated.
[0116] Figure 3 This is a structural diagram of a configuration file updating device for an application, as illustrated in an exemplary embodiment of this disclosure.
[0117] like Figure 3 As shown, the application configuration file update device 300 provided in this disclosure includes:
[0118] The acquisition unit 310 is used to acquire the configuration file update instruction, which includes the identifier of the target application;
[0119] The determining unit 320 is used to determine if the identifier of the target application matches a preset application registry, wherein the preset application registry includes the identifier of the application and the mapping relationship between the identifier of the unit to which the application belongs; different applications within the same unit share the same cluster resource pool, and the cluster resource pools corresponding to different units are isolated from each other;
[0120] Based on the target application's identifier and a preset configuration table, determine at least one target variable that needs to be updated in the target application's configuration file, as well as the value of each target variable; wherein, the preset configuration table includes the application's identifier, the unit identifier to which the application belongs, the variable name, and the mapping relationship between the variable values; the unit identifier corresponds to at least one application's identifier;
[0121] Update unit 330 is used to update the configuration file of the target application based on at least one target variable and the value of each target variable.
[0122] Figure 4 This is a structural diagram of an application configuration file updating device, illustrating another exemplary embodiment of the present disclosure.
[0123] like Figure 4 As shown, based on the above embodiments, the application configuration file update device 400 provided in this disclosure further includes an update unit 330 that includes:
[0124] The first update module 331 is used to update the value of the variable that matches the target variable in the configuration file of the target application according to the value of the target variable if it is determined that the target variable matches the variable in the configuration file of the target application.
[0125] The second update module 332 is used to add the target variable and its value to the target application's configuration file if it is determined that the target variable does not match the variable in the target application's configuration file.
[0126] The first update module 331 is specifically used to compare the variable name of the target variable with the variable name in the configuration file of the target application one by one;
[0127] If the name of the target variable is the same as the name of the variable in the target application's configuration file, then the target variable is determined to match the variable in the target application's configuration file.
[0128] The second update module 332 is specifically used to compare the variable name of the target variable with the variable name in the configuration file of the target application one by one;
[0129] If the name of the target variable is different from the name of the variable in the target application's configuration file, then the target variable is determined to be mismatched with the variable in the target application's configuration file.
[0130] Unit 320 is specifically used to query a preset configuration table based on the identifier of the target application to determine the target unit identifier corresponding to the identifier of the target application.
[0131] Based on the target unit identifier, determine the variable name and value of at least one variable corresponding to the target unit identifier. Based on the variable name and value of at least one variable corresponding to the target unit identifier, determine at least one target variable that needs to be updated in the target application's configuration file, and the value of each target variable.
[0132] In one possible implementation, a preset configuration table is determined based on the network segment to which the application belongs.
[0133] Figure 5 This is a structural diagram of a server shown as an exemplary embodiment of the present disclosure.
[0134] like Figure 5 As shown, the server provided in this embodiment includes:
[0135] Memory 501;
[0136] Processor 502; and
[0137] Computer programs;
[0138] The computer program is stored in memory 501 and configured to be executed by processor 502 to implement the configuration file update method for any of the applications described above.
[0139] This embodiment also provides a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement a configuration file update method for any of the applications described above.
[0140] This embodiment also provides a computer program product, including a computer program that, when executed by a processor, implements a configuration file update method for any of the above applications.
[0141] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0142] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for updating an application's configuration file, characterized in that, include: Obtain the configuration file update instruction, wherein the configuration file update instruction includes the identifier of the target application; If it is determined that the identifier of the target application matches a preset application registry, wherein the preset application registry includes the identifier of the application and the mapping relationship between the identifiers of the units to which the application belongs; different applications within the same unit share the same cluster resource pool, and the cluster resource pools corresponding to different units are isolated from each other; Based on the target application's identifier and a preset configuration table, at least one target variable that needs to be updated in the target application's configuration file, and the value of each target variable, are determined. The preset configuration table includes the mapping relationship between the application's identifier, the unit identifier to which the application belongs, the variable name, and the variable value. The unit identifier corresponds to the identifier of at least one application. The configuration file of the target application is updated based on the at least one target variable and the value of each target variable.
2. The method according to claim 1, characterized in that, The step of updating the configuration file of the target application based on the at least one target variable and the value of each target variable includes: If it is determined that the target variable matches a variable in the configuration file of the target application, then the value of the variable in the configuration file of the target application that matches the target variable is updated according to the value of the target variable; If it is determined that the target variable does not match the variable in the target application's configuration file, then the target variable and its value are added to the target application's configuration file.
3. The method according to claim 2, characterized in that, The step of determining whether the target variable matches a variable in the configuration file of the target application includes: The variable name of the target variable is compared one by one with the variable name in the configuration file of the target application; If the variable name of the target variable is the same as the variable name in the configuration file of the target application, then the target variable is determined to match the variable in the configuration file of the target application.
4. The method according to claim 2, characterized in that, The determination that the target variable does not match the variable in the configuration file of the target application includes: The variable name of the target variable is compared one by one with the variable name in the configuration file of the target application; If the variable name of the target variable is different from the variable name in the configuration file of the target application, then it is determined that the target variable does not match the variable in the configuration file of the target application.
5. The method according to claim 1, characterized in that, The step of determining at least one target variable that needs to be updated in the configuration file of the target application, and the value of each target variable, based on the identifier of the target application and a preset configuration table, includes: Based on the identifier of the target application, the preset configuration table is queried to determine the target unit identifier corresponding to the identifier of the target application; Based on the target unit identifier, determine the variable name and value of at least one variable corresponding to the target unit identifier. Based on the variable name and value of at least one variable corresponding to the target unit identifier, determine at least one target variable that needs to be updated in the configuration file of the target application, and the value of each target variable.
6. The method according to any one of claims 1-5, characterized in that, Also includes: Determine the preset configuration table based on the network segment to which the application belongs.
7. An application configuration file update device, characterized in that, include: The acquisition unit is used to acquire a configuration file update instruction, wherein the configuration file update instruction includes the identifier of the target application; A determining unit is used to determine if the identifier of the target application matches a preset application registry, wherein the preset application registry includes the identifier of the application and the mapping relationship between the identifier of the unit to which the application belongs; different applications within the same unit share the same cluster resource pool, and the cluster resource pools corresponding to different units are isolated from each other; Based on the target application's identifier and a preset configuration table, at least one target variable that needs to be updated in the target application's configuration file, and the value of each target variable, are determined. The preset configuration table includes the mapping relationship between the application's identifier, the unit identifier to which the application belongs, the variable name, and the variable value. The unit identifier corresponds to the identifier of at least one application. An update unit is configured to update the configuration file of the target application based on the at least one target variable and the value of each target variable.
8. A server, characterized in that, Includes memory and processor; among which, The memory is used to store computer programs; The processor is configured to read a computer program stored in the memory and execute the method described in any one of claims 1-6 according to the computer program in the memory.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the method described in any one of claims 1-6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1-6.