Method, apparatus, server, and storage medium for updating configuration data
By obtaining and combining basic configuration components, building rule components and generating configuration files, the problem of updating application server configuration data is solved, and low-code configuration management and efficient business response are achieved.
Patent Information
- Application Number
- CN202210701843.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-20
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2042-06-20
Smart Images

Figure CN115202719B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing, and particularly to a method, apparatus, server, and computer-readable storage medium (hereinafter referred to as storage medium) for updating configuration data. Background Art
[0002] Due to business changes, application servers often need to change server configurations multiple times during operation. For example, in a bank's business expansion system, there is a large amount of business data, including but not limited to the card-issuing cities, channels, and limits of bank cards. During business adjustments, the business data required by the business logic of the bank's business expansion system is constantly adjusted and changed, and the configuration data in the bank's business expansion system needs to be updated in a timely manner. Therefore, how to modify and update the configuration data in the application server, such as configuration management, is an urgent problem to be solved. Summary of the Invention
[0003] Based on this, in view of the above technical problems, it is necessary to provide a method, apparatus, server, and storage medium for updating configuration data.
[0004] In a first aspect, this application provides a method for updating configuration data, which is applied to a central server. The method includes:
[0005] Obtain a basic configuration component;
[0006] In response to a trigger operation on the basic configuration component, determine a target logical configuration component and a target parameter configuration component from the basic configuration component;
[0007] Build a rule component based on the target logical configuration component and the target parameter configuration component;
[0008] Convert the rule component into configuration item processing function code to obtain a target configuration file; wherein, the target configuration file is used to instruct the application server to update configuration parameters according to the target configuration file.
[0009] In some embodiments of this application, building a rule component based on the target logical configuration component and the target parameter configuration component includes:
[0010] In response to a first drag operation on the target logical configuration component, determine the first position information of the target logical configuration component according to the end position of the first drag operation;
[0011] In response to a second drag operation on the target parameter configuration component, determine the second position information of the target parameter configuration component according to the end position of the second drag operation;
[0012] Combine the target logical configuration component and the target parameter configuration component according to the first position information and the second position information to obtain a rule component.
[0013] In some embodiments of the present application, converting a rule component into a configuration item processing function code to obtain a target configuration file includes:
[0014] Obtaining function statements corresponding to the target logic configuration component in the rule component, and configuration item names corresponding to the target parameter configuration component in the rule component;
[0015] Generating a configuration item processing function code according to the function statements and the configuration item names;
[0016] Packaging the configuration item processing function code into a target configuration file.
[0017] In some embodiments of the present application, generating a configuration item processing function code according to the function statements and the configuration item names includes:
[0018] Determining execution rule items in the target logic configuration component and function statements of the execution rule items;
[0019] Determining a target parameter configuration component corresponding to the execution rule item from the rule component to obtain a configuration item name corresponding to the execution rule item;
[0020] Generating a rule item function code according to the function statements of the execution rule items and the configuration item names of the target parameter configuration components corresponding to the execution rule items;
[0021] Constructing a configuration item processing function code based on the rule item function code.
[0022] In some embodiments of the present application, after converting the rule component into a configuration item processing function code to obtain a target configuration file, it includes:
[0023] Obtaining identification information of the application server, and looking up the server address and the target saving path corresponding to the application server based on the identification information;
[0024] Based on the server address, sending the target configuration file to the target saving path corresponding to the application server.
[0025] In a second aspect, the present application provides a method for updating configuration data, which is applied to an application server. The method includes:
[0026] Loading an updated target configuration file in the central server;
[0027] Determining configuration items to be updated and configuration item processing function code in the target configuration file;
[0028] Updating the configuration data of the configuration items to be updated based on the configuration item processing function code.
[0029] In a third aspect, the present application provides a configuration data update system, including a central server and multiple application servers communicatively connected to the central server;
[0030] The central server obtains a basic configuration component;
[0031] The central server responds to a trigger operation on the basic configuration component, and determines a target logic configuration component and a target parameter configuration component from the basic configuration component;
[0032] The central server constructs a rule component based on the target logic configuration component and the target parameter configuration component;
[0033] The central server converts the rule component into configuration item processing function code to obtain a target configuration file;
[0034] The application server loads the updated target configuration file in the central server;
[0035] The application server determines the configuration items to be updated and the configuration item processing function code based on the target configuration file;
[0036] The application server updates the configuration data of the configuration items to be updated based on the configuration item processing function code.
[0037] In a fourth aspect, the present application provides a configuration data update device, which is applied to the central server. The device includes:
[0038] A configuration component acquisition module, configured to obtain a basic configuration component;
[0039] A configuration component screening module, configured to respond to a trigger operation on the basic configuration component, and determine a target logic configuration component and a target parameter configuration component from the basic configuration component;
[0040] A rule component construction module, configured to construct a rule component based on the target logic configuration component and the target parameter configuration component;
[0041] A configuration file generation module, configured to convert the rule component into configuration item processing function code to obtain a target configuration file; wherein, the target configuration file is used to instruct the application server to update configuration parameters according to the target configuration file.
[0042] In a fifth aspect, the present application provides a configuration data update device, which is applied to the application server. The device includes:
[0043] A configuration file loading module, configured to load the updated target configuration file in the central server;
[0044] A configuration file parsing module, configured to determine the configuration items to be updated and the configuration item processing function code based on the target configuration file;
[0045] A configuration data update module, configured to update the configuration data of the configuration items to be updated based on the configuration item processing function code.
[0046] In a sixth aspect, the present application further provides a server, which includes:
[0047] One or more processors;
[0048] A memory; and
[0049] One or more applications, where one or more applications are stored in the memory and configured to be executed by the processor to implement the method provided in the first aspect or the second aspect.
[0050] In a seventh aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored. The computer program is loaded by the processor to execute the steps in the method provided in the first aspect or the second aspect.
[0051] In an eighth aspect, an embodiment of the present application provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in the above-mentioned first aspect or the second aspect.
[0052] For the above-mentioned configuration data update method, device, server, and storage medium, by obtaining a basic configuration component, in response to a trigger operation acting on the basic configuration component, determining a target logical configuration component and a target parameter configuration component from the basic configuration component, constructing a rule function body based on the target logical configuration component and the target parameter configuration component, converting the rule component into a configuration item processing function code, and obtaining a target configuration file; wherein, the target configuration file is used to instruct the application server to update the configuration parameters according to the target configuration file. By graphically combining the target logical configuration component and the target parameter configuration component in the graphical basic configuration component, the rule component for building personalized configuration requirements is visually and vividly built, and then by converting the rule component into a configuration item processing function code, a target configuration file that can be used to change the business configuration of the application server is obtained, realizing low-code configuration management and reducing the difficulty of configuration management. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those skilled in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0054] Figure 1 It is a schematic diagram of the scenario of the method for updating configuration data in an embodiment of the present application;
[0055] Figure 2 It is a schematic flowchart of the method for updating configuration data in an embodiment of the present application;
[0056] Figure 3 It is a schematic diagram of the basic configuration component in an embodiment of the present application;
[0057] Figure 4 It is a schematic flowchart of the steps for constructing the rule component in an embodiment of the present application;
[0058] Figure 5 It is a schematic flowchart of the steps for obtaining the target configuration file in an embodiment of the present application;
[0059] Figure 6 It is a schematic flowchart of another method for updating configuration data in an embodiment of the present application;
[0060] Figure 7 It is a schematic diagram of the system for updating configuration data in an embodiment of the present application;
[0061] Figure 8 It is a schematic diagram of the structure of the device for updating configuration data in an embodiment of the present application;
[0062] Figure 9 It is a schematic diagram of the structure of another device for updating configuration data in an embodiment of the present application;
[0063] Figure 10 It is a schematic diagram of the structure of the computer device in an embodiment of the present application. Detailed implementation manners
[0064] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present application.
[0065] In the description of the present application, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of the described features. In the description of the present application, "a plurality of" means two or more unless otherwise specifically defined.
[0066] In the description of the present application, the term "for example" is used to mean "serving as an example, illustration, or explanation". Any embodiment described as "for example" in the present application is not necessarily construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to implement and use the present invention. In the following description, details are set forth for purposes of explanation. It should be understood that those of ordinary skill in the art can recognize that the present invention can be implemented without the use of these specific details. In other instances, well-known structures and processes are not elaborated in detail to avoid obscuring the description of the present invention with unnecessary details. Therefore, the present invention is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed in the present application.
[0067] The method for updating configuration data provided by an embodiment of the present application can be applied to a configuration data update system as shown in Figure 1 the following. The configuration data update system includes a central server 100 and a plurality of application servers 200. The central server 100 and the application servers 200 can be independent servers, or a server network or server cluster composed of servers, including but not limited to computers, network hosts, single network servers, multiple sets of network servers, or cloud servers composed of multiple servers. Among them, the cloud server is composed of a large number of computers or network servers based on cloud computing (Cloud Computing).
[0068] Among them, due to business changes, application servers often need to change server configurations multiple times during operation. For example, in a bank business expansion system, there is a large amount of business data, including but not limited to bank card issuing cities, issuing channels, issuing limits, etc.; during the business adjustment process, the business data required by the business logic of the bank business expansion system is constantly adjusted and changed, and the configuration data in the bank business expansion system needs to be updated in a timely manner. Therefore, how to perform configuration management such as modifying and updating the configuration data in the application server is an urgent problem to be solved.
[0069] Those skilled in the art can understand that Figure 1 the application environment shown in Figure 1 is only one application scenario of the present application solution, and does not constitute a limitation on the application scenario of the present application solution. Other application environments may also include more or fewer computer devices than those shown in Figure 1 For example, only 1 server 200 is shown in Figure 1 It can be understood that the configuration data update system may also include one or more other servers, which are not specifically limited here. Additionally, as shown in
[0070] It should also be noted that Figure 1 The schematic diagram of the scenario of the configuration data update system shown is only an example. The configuration data update system and scenario described in the embodiments of the present invention are for more clearly explaining the technical solutions of the embodiments of the present invention, and do not constitute a limitation on the technical solutions provided by the embodiments of the present invention. Those of ordinary skill in the art can know that with the evolution of the configuration data update system and the emergence of new business scenarios, the technical solutions provided by the embodiments of the present invention are equally applicable to similar technical problems.
[0071] Referring to Figure 2 this application embodiment provides a method for updating configuration data, mainly taking the application of this method to the central server 100 in the above Figure 1 as an example to illustrate. This method includes steps S210 to S230, specifically as follows:
[0072] S210, obtain basic configuration components.
[0073] Among them, the basic configuration component refers to the component obtained by graphically representing the configuration-related content involved in the code development process of dynamic configuration.
[0074] For example, the logical statements (such as if statements, while statements, etc.) in the code development of dynamic configuration can be graphically represented to obtain basic configuration components related to the logical statements; for another example, the processing objects (such as variables, constants, objects, etc.) of function statements can be graphically represented to obtain basic configuration groups corresponding to configuration parameters.
[0075] By converting the relevant content involved in the code development process into graphical basic configuration components, subsequent changes to the application business configuration are made based on the graphical basic configuration components, realizing low-code configuration management and reducing the difficulty of configuration management.
[0076] Specifically, the basic configuration components include logical configuration components and parameter configuration components. Among them, the parameter configuration components include but are not limited to constant components, variable components, object components, list components, etc. It can be understood that as above, the logical configuration component refers to the component obtained by graphically representing the logical statements involved in the dynamic configuration process; the parameter configuration component refers to the component obtained by graphically representing the configuration parameters. As Figure 3 shown, Figure 3The middle - level configuration components 310 (including basic configuration component 310A and basic configuration component 310B) are logical configuration components, and the basic configuration components 320 (including basic configuration component 320A, basic configuration component 320B, basic configuration component 320C, and basic configuration component 320D) are parameter configuration components. More specifically, basic configuration component 320A and basic configuration component 320C are variable components, and basic configuration component 320B and basic configuration component 320D are constant components.
[0077] S220, in response to a trigger operation acting on the basic configuration components, determine a target logical configuration component and a target parameter configuration component from the basic configuration components.
[0078] Among them, the trigger operation refers to an operation acting on the basic configuration components, such as a touch operation, a cursor operation, a button operation, a voice control operation, etc. The trigger operation can be used to screen the target logical configuration component and the target parameter configuration component among the logical configuration components and parameter configuration components in the basic configuration components.
[0079] Specifically, a visual interface can be provided to display the basic configuration components in the visual interface; when developers perform dynamic configuration management, they can select the trigger operation of the basic configuration components based on the visual interface. After the central server receives the trigger operation acting on the basic configuration components, it can determine the target logical configuration component and the target parameter configuration component for subsequent processing according to the logical configuration component and the parameter configuration component pointed to by the trigger operation in the basic configuration components.
[0080] S230, construct a rule component based on the target logical configuration component and the target parameter configuration component.
[0081] Among them, the rule component refers to a component constructed from multiple basic configuration components. As Figure 3 shown, basic configuration component 310A, basic configuration component 310B, basic configuration component 320A, basic configuration component 320B, basic configuration component 320C, and basic configuration component 320D constitute a rule component.
[0082] After obtaining the target logical configuration component and the target parameter configuration component, the target logical configuration component and the target parameter configuration component can be combined to construct and generate a rule component. Specifically, a visual interface can be provided to display the target logical configuration component and the target parameter configuration component in the visual interface, and receive the trigger operation acting on the target logical configuration component and the target parameter configuration component through the visual interface, and then perform graphic splicing on the target logical configuration component and the target parameter configuration component based on the trigger operation to combine and obtain a rule component.
[0083] Further, the triggering operation acting on the target logic configuration component and the target parameter configuration component may be a drag operation. In one embodiment, as Figure 4 shown, step S220 of constructing a rule component based on the target logic configuration component and the target parameter configuration component includes:
[0084] S410, in response to a first drag operation acting on the target logic configuration component, determine first position information of the target logic configuration component according to the end position of the first drag operation;
[0085] S420, in response to a second drag operation acting on the target parameter configuration component, determine second position information of the target parameter configuration component according to the end position of the second drag operation;
[0086] S430, combine the target logic configuration component and the target parameter configuration component according to the first position information and the second position information to obtain a rule component.
[0087] Among them, the drag operation refers to a triggering operation acting on the target logic configuration component or the target parameter configuration component, and may include but is not limited to touch operations, cursor operations, etc.; for example, a developer can select a certain target logic configuration component (or target parameter configuration component) through the mouse cursor to control the movement of the target logic configuration component (or target parameter configuration component) to a certain position.
[0088] Among them, the end position of the drag operation refers to the position information when the drag operation ends. For example, when the drag operation is based on a touch operation, the end position of the drag operation may refer to the position information of the touch point when the drag operation ends; again, for example, when the drag operation is based on a cursor operation, the end position of the drag operation may refer to the position information of the cursor when the drag operation ends.
[0089] Specifically, after the target logic configuration component and the target parameter configuration component are displayed through a visual interface and a drag operation on both is received, based on the end position of the drag operation, determine the first position of the target logic configuration component and the second position of the target parameter configuration component, and then, based on the first position information and the second position information, perform graphical splicing on the target logic configuration component and the target parameter configuration component. By converting the relevant content involved in the code development process into graphical basic configuration components, and then performing graphical splicing according to the graphical basic configuration components, intuitively and vividly build a rule component for personalized configuration requirements, realize graphical logic programming, and reduce the difficulty of configuration management.
[0090] S240, convert the rule component into a configuration item processing function code to obtain a target configuration file; wherein, the target configuration file is used to instruct the application server to update configuration parameters according to the target configuration file.
[0091] Among them, the configuration item processing function code refers to the function code corresponding to the graphical rule component, such as Figure 3 shown. Figure 3 The function code shown is the configuration item processing function code corresponding to the rule component. Among them, the target configuration file refers to the file that stores the configuration item processing function code, specifically, it can be a Jar package obtained by packaging the program file of the configuration item processing function code.
[0092] Specifically, after completing the graphical splicing of all target logic configuration components and target parameter configuration components, multiple rule components can be obtained; for any one rule component, based on the configuration-related content corresponding to the basic configuration components (i.e., target logic configuration components and target parameter configuration components) in the rule component, the rule component can be converted into configuration item processing function code, and the configuration item processing function code can be compiled and packaged to generate the target configuration file.
[0093] Among them, as above, the target logic configuration component is a component that graphically represents logical statements, and the parameter configuration component is a component that graphically represents configuration parameters. Specifically, in one embodiment, as Figure 5 shown, converting the rule component into configuration item processing function code to obtain the target configuration file includes:
[0094] S510, obtaining the function statement corresponding to the target logic configuration component in the rule component, and the configuration item name corresponding to the target parameter configuration component in the rule component;
[0095] S520, generating configuration item processing function code according to the function statement and the configuration item name;
[0096] S530, packaging the configuration item processing function code into a target configuration file.
[0097] Specifically, obtain the function statement corresponding to the target logic configuration component that constitutes the rule component, and the configuration item name corresponding to the parameter configuration component that constitutes the rule component, and fill the configuration item name into the position of the function variable in the function statement to construct and generate the configuration item processing function code, and finally package the configuration item processing function code to generate the target configuration file.
[0098] Further, according to the function statement and the configuration item name, generate the configuration item processing function code, which may specifically include: determining the execution rule item and the function statement of the execution rule item in the target logic configuration component; determining the target parameter configuration component corresponding to the execution rule item from the rule component to obtain the configuration item name corresponding to the execution rule item; generating the rule item function code according to the function statement of the execution rule item and the configuration item name of the target parameter configuration component corresponding to the execution rule item; and constructing the configuration item processing function code based on the rule item function code.
[0099] Among them, the execution rule item corresponds to the function statement included in the logical statement corresponding to the logic configuration component, and different execution rule items correspond to different function statements. For example, in the if conditional statement, it includes a conditional statement for determining whether a given condition holds and an execution statement executed after the condition holds. Correspondingly, in the logic configuration component corresponding to the if conditional statement, the execution rule item includes a condition item corresponding to the conditional statement and a hit trigger item corresponding to the execution statement.
[0100] After obtaining the execution rule item and the function statement of the execution rule item in the target logic configuration component, the target parameter configuration component corresponding to the execution rule item can be determined from the combined structure of the rule component, and then the configuration item name corresponding to the target parameter configuration component can be determined as the configuration item name corresponding to the execution rule item.
[0101] More specifically, to determine the target parameter configuration component corresponding to the execution rule item from the rule component, it can be specifically to first obtain the first position information of the target logic configuration component and the second position information of the target parameter configuration component in the rule component; determine the rule item position information corresponding to different execution rule items in the target logic configuration component according to the first position information; and determine the target parameter configuration component corresponding to the execution rule item according to the rule item position information and the second position information of the target parameter configuration component.
[0102] Among them, the target logic configuration component may be provided with first operation nodes corresponding to different execution rule items, and the rule item position information may refer to the position information of the first operation nodes; the target parameter configuration component may be provided with second operation nodes, and the second position information of the target parameter configuration component may refer to the position information of the second operation nodes; if the distance value between the rule item position information and the second position information of the target parameter configuration component is less than a preset threshold, it can be confirmed that the first operation node corresponding to the execution rule item is coupled with the second operation node of the target parameter configuration component, and thus the target parameter configuration component corresponding to the execution rule item can be determined.
[0103] After obtaining the configuration item name corresponding to the execution rule item, the configuration item name can be used as the variable name and filled into the function statement corresponding to the execution rule item to generate the configuration item processing function code.
[0104] After obtaining the target configuration file, it can be sent to multiple application servers communicatively connected to the central server, so that the application servers that receive the target configuration file update the configuration information according to the target configuration file, realizing the sharing of configurations among multiple application servers. Further, in one embodiment, after converting the rule component into the configuration item processing function code to obtain the target configuration file, it includes: obtaining the identification information of the application server, looking up the server address and the target save path corresponding to the application server based on the identification information; based on the server address, sending the target configuration file to the target save path corresponding to the application server.
[0105] Among them, the identification information of the application server is used to uniquely identify the application server; the server address refers to the IP address of the application server, and the target save path refers to the save location of the configuration file in the application server.
[0106] Specifically, it can be realized to associate and save the identification information, server address and target save path of the application server one by one. After obtaining the target configuration file, the identification information of the application server to be updated with the configuration can be obtained from the developer input through the visual interface, and the server address and target save path of the application server can be found from the database based on the identification information, and then the target configuration file can be sent to the application server corresponding to the server address and saved to the folder indicated by the target save path. By sending the target configuration file to multiple application servers, the configuration information of the application server can be dynamically adjusted, the efficiency of the application server configuration management can be improved, and the system performance of the application server can be improved.
[0107] In the above method for updating configuration data, by obtaining the basic configuration component; responding to the trigger operation acting on the basic configuration component, determining the target logical configuration component and the target parameter configuration component from the basic configuration component; constructing the rule function body based on the target logical configuration component and the target parameter configuration component; converting the rule component into the configuration item processing function code to obtain the target configuration file; among them, the target configuration file is used to instruct the application server to update the configuration parameters according to the target configuration file. By graphically combining the target logical configuration component and the target parameter configuration component in the graphical basic configuration component, the rule component for personalized configuration requirements can be intuitively and vividly built, and then by converting the rule component into the configuration item processing function code, the target configuration file that can be used to change the business configuration of the application server is obtained, realizing low-code configuration management and reducing the difficulty of configuration management.
[0108] Refer to Figure 6 , this application embodiment provides a method for updating configuration data, mainly applying this method to the above Figure 1Taking the application server 200 in [0] as an example, the method includes steps S610 to S630, which are specifically as follows:
[0109] Step S610, load the updated target configuration file in the central server.
[0110] Among them, loading the updated target configuration file in the central server can be that the central server directly sends the target configuration file to the application server; it can also be that after the central server updates the target configuration file, it sends a configuration update instruction to each application server, and the application server downloads the target configuration file from the central server according to this configuration update instruction.
[0111] Step S620, determine the configuration items to be updated and the configuration item processing function code based on the target configuration file.
[0112] Step S630, update the configuration data of the configuration items to be updated based on the configuration item processing function code.
[0113] Among them, a configuration item refers to a specific configuration parameter and its configuration data (that is, the specific value of the configuration parameter). After obtaining the target configuration file, the target configuration file can be analyzed to determine the configuration items to be updated and the configuration item processing function code in the target configuration file, and then execute the configuration item processing function code to update the configuration items to be updated and the configuration data of the configuration items to be updated.
[0114] Specifically, the application server can pre-match the configuration item names of the local configuration items with the configuration item names of the parameter configuration components provided by the central server one by one; after obtaining the target configuration file, it can determine the local target configuration items according to the configuration item names of the configuration items to be updated in the configuration file; and then when executing the configuration item processing function code, accurately update the configuration data of the local target configuration items.
[0115] The above method for updating configuration data realizes real-time loading and execution of the updated target configuration file by loading the updated target configuration file in the central server, determining the configuration items to be updated and the configuration item processing function code based on the target configuration file, and updating the configuration data of the configuration items to be updated based on the configuration item processing function code, without restarting the application server to update the configuration data, thus improving the update efficiency of the configuration data.
[0116] Refer to Figure 7 , this embodiment of the present application provides a system for updating configuration data, including a central server and multiple application servers communicatively connected to the central server, where:
[0117] S710, the central server obtains the basic configuration component;
[0118] S720, the central server responds to a trigger operation on the basic configuration component, and determines a target logic configuration component and a target parameter configuration component from the basic configuration component;
[0119] S730, the central server constructs a rule component based on the target logic configuration component and the target parameter configuration component;
[0120] S740, the central server converts the rule component into configuration item processing function code to obtain a target configuration file;
[0121] S750, the application server loads the updated target configuration file in the central server;
[0122] S760, the application server determines the configuration items to be updated and the configuration item processing function code from the target configuration file;
[0123] S770, the application server updates the configuration data of the configuration items to be updated based on the configuration item processing function code.
[0124] Among them, for the specific limitations of each step in the configuration data update system, reference can be made to the limitations on the configuration data update method in the above text, which will not be elaborated here.
[0125] Specifically, taking the central server as the NEO (New Engine Option) engine as an example, the NEO engine provides a NEO configuration page and provides basic configuration components in the NEO configuration page. Developers can perform trigger operations such as selecting basic configuration components and combining basic configuration components on the basic configuration components through the NEO configuration page. After receiving the trigger operation, the NEO engine determines a target logic configuration component and a target parameter configuration component from the basic configuration components, constructs a rule function body based on the target logic configuration component and the target parameter configuration component, and then converts the rule component into configuration item processing function code to obtain a target configuration file; the NEO engine pushes the target configuration file to the application server. After receiving the target configuration file, the application server matches the configuration item names of the original configuration items with the configuration item names provided by the NEO engine (i.e., the configuration item names corresponding to the parameter configuration components) one by one, then reads the target configuration file, updates the configuration data of the configuration items to be updated by executing the configuration item processing function code in the target configuration file, and applies the updated configuration items to the business logic.
[0126] The above-mentioned update system for configuration data visually and vividly constructs a rule component for personalized configuration requirements by graphically combining the target logic configuration component and the target parameter configuration component in the graphical basic configuration component. Then, by converting the rule component into the code of the configuration item processing function, a target configuration file that can be used to change the business configuration of the application server is obtained, realizing low-code configuration management and reducing the difficulty of configuration management.
[0127] To better implement the configuration data update method provided in the embodiments of the present application, based on the configuration data update method provided in the embodiments of the present application, an update device for configuration data is further provided in the embodiments of the present application, which is applied to a central server. As Figure 8 shown, the configuration data update device 800 includes:
[0128] A configuration component acquisition module 810, configured to acquire a basic configuration component;
[0129] A configuration component screening module 820, configured to respond to a trigger operation on the basic configuration component, and determine a target logic configuration component and a target parameter configuration component from the basic configuration components;
[0130] A rule component construction module 830, configured to construct a rule component based on the target logic configuration component and the target parameter configuration component;
[0131] A configuration file generation module 840, configured to convert the rule component into the code of the configuration item processing function to obtain a target configuration file, and the target configuration file is used to instruct the application server to update the configuration parameters according to the target configuration file.
[0132] In some embodiments of the present application, the rule component construction module 830 is specifically configured to respond to a first drag operation on the target logic configuration component, and determine the first position information of the target logic configuration component according to the end position of the first drag operation; respond to a second drag operation on the target parameter configuration component, and determine the second position information of the target parameter configuration component according to the end position of the second drag operation; combine the target logic configuration component and the target parameter configuration component according to the first position information and the second position information to obtain a rule component.
[0133] In some embodiments of the present application, the configuration file generation module 840 is specifically configured to obtain the function statement corresponding to the target logic configuration component in the rule component, and the configuration item name corresponding to the target parameter configuration component in the rule component; generate the code of the configuration item processing function according to the function statement and the configuration item name; and package the code of the configuration item processing function into a target configuration file.
[0134] In some embodiments of the present application, the configuration file generation module 840 is specifically configured to determine the execution rule items and the function statements of the execution rule items in the target logical configuration component; determine the target parameter configuration component corresponding to the execution rule item from the rule component to obtain the configuration item name corresponding to the execution rule item; generate rule item function code according to the function statements of the execution rule item and the configuration item name of the target parameter configuration component corresponding to the execution rule item; and construct configuration item processing function code based on the rule item function code.
[0135] In some embodiments of the present application, the configuration data update device 800 further includes a configuration file sending module, which is used to obtain the identification information of the application server, find the server address and the target save path corresponding to the application server based on the identification information; and send the target configuration file to the target save path corresponding to the application server based on the server address.
[0136] An embodiment of the present application also provides a configuration data update device, which is applied to an application server. As Figure 9 shown, the configuration data update device 900 includes:
[0137] A configuration file loading module 910, which is used to load the updated target configuration file in the central server;
[0138] A configuration file parsing module 920, which is used to determine the configuration items to be updated and the configuration item processing function code based on the target configuration file;
[0139] A configuration data update module 930, which is used to update the configuration data of the configuration items to be updated based on the configuration item processing function code.
[0140] For the specific limitations of the configuration data update device, reference can be made to the limitations of the configuration data update method in the above text, which will not be elaborated here. Each module in the above configuration data update device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0141] In some embodiments of the present application, the configuration data update device 800 or the configuration data update device 900 can be implemented in the form of a computer program, and the computer program can run on a computer device as Figure 10 shown. The memory of the computer device can store each program module that composes the configuration data update device 800. For example, Figure 8The configuration component acquisition module 810, the configuration component screening module 820, the rule component construction module 830 and the configuration file generation module 840 are shown. The memory of the computer device can also store various program modules that constitute the configuration data update device 900, such as, Figure 9 The configuration file loading module 910, the configuration file parsing module 920 and the configuration data updating module 930 are shown. The computer program composed of various program modules enables the processor to execute the steps of the configuration data updating method of each embodiment of the present application described in this specification.
[0142] The computer program composed of various program modules enables the processor to execute the steps of the configuration data updating method of each embodiment of the present application described in this specification.
[0143] For example, Figure 10 The computer device shown can be Figure 8 The configuration component acquisition module 810 in the configuration data updating device 800 shown in the figure performs step S210. The computer device can perform step S220 through the configuration component screening module 820. The computer device can perform step S230 through the rule component construction module 830. The computer device can perform step S240 through the configuration file generation module 840. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external computer device through a network connection. When the computer program is executed by the processor, a method for updating configuration data is implemented.
[0144] Those skilled in the art will understand that Figure 10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0145] In some embodiments of the present application, a server is provided, comprising one or more processors; a memory; and one or more applications, wherein the one or more applications are stored in the memory and configured so that the processor executes the steps of the above-mentioned method for updating configuration data. The steps of the method for updating configuration data here may be the steps of the method for updating configuration data in the above-mentioned embodiments.
[0146] In some embodiments of the present application, a computer-readable storage medium is provided, storing a computer program, which is loaded by a processor, so that the processor executes the steps of the above-mentioned method for updating configuration data. The steps of the method for updating configuration data here may be the steps in the method for updating configuration data in each of the above embodiments.
[0147] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it may include the processes of the embodiments of the above methods. Any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application may include at least one of non-volatile and volatile memories. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0148] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered to be within the scope described in this specification.
[0149] The above has introduced in detail a method, device, server, and storage medium for updating configuration data provided by the embodiments of the present application. Specific examples are used in this article to elaborate on the principles and implementation manners of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A method for updating configuration data, characterized in that, applied to a central server, comprising: Obtaining basic configuration components; Responding to a trigger operation acting on the basic configuration components, determining a target logic configuration component and a target parameter configuration component from the basic configuration components; Constructing a rule component based on the target logic configuration component and the target parameter configuration component; Obtaining the function statement corresponding to the target logic configuration component in the rule component, and the configuration item name corresponding to the target parameter configuration component in the rule component; Determining the execution rule item in the target logic configuration component and the function statement of the execution rule item; Determining the target parameter configuration component corresponding to the execution rule item from the rule component, and obtaining the configuration item name corresponding to the execution rule item; Generating rule item function code according to the function statement of the execution rule item and the configuration item name of the target parameter configuration component corresponding to the execution rule item; Constructing configuration item processing function code based on the rule item function code; Packaging the configuration item processing function code into a target configuration file; wherein, the target configuration file is used to instruct the application server to update configuration parameters according to the target configuration file.
2. The method according to claim 1, characterized in that, The constructing a rule component based on the target logic configuration component and the target parameter configuration component includes: Responding to a first drag operation acting on the target logic configuration component, determining the first position information of the target logic configuration component according to the end position of the first drag operation; Responding to a second drag operation acting on the target parameter configuration component, determining the second position information of the target parameter configuration component according to the end position of the second drag operation; Combining the target logic configuration component and the target parameter configuration component according to the first position information and the second position information to obtain a rule component.
3. The method according to claim 1 or 2, characterized in that, The method further includes: Obtaining the identification information of the application server, and looking up the server address and the target save path corresponding to the application server based on the identification information; Sending the target configuration file to the target save path corresponding to the application server based on the server address.
4. A method for updating configuration data, characterized in that, applied to an application server, comprising: Loading the updated target configuration file in the central server according to claim 1 or 2; Determining the configuration items to be updated and the configuration item processing function code from the target configuration file; Updating the configuration data of the configuration items to be updated based on the configuration item processing function code.
5. A configuration data update system, characterized in that, comprising a central server and a plurality of application servers communicatively connected to the central server; The central server obtains basic configuration components; The central server responds to a trigger operation acting on the basic configuration components, and determines a target logic configuration component and a target parameter configuration component from the basic configuration components; The central server constructs a rule component based on the target logic configuration component and the target parameter configuration component; The central server obtains the function statement corresponding to the target logic configuration component in the rule component, and the configuration item name corresponding to the target parameter configuration component in the rule component; Determine the execution rule item and the function statement of the execution rule item in the target logic configuration component; determine the target parameter configuration component corresponding to the execution rule item from the rule component to obtain the configuration item name corresponding to the execution rule item; generate a rule item function code according to the function statement of the execution rule item and the configuration item name of the target parameter configuration component corresponding to the execution rule item; Construct a configuration item processing function code based on the rule item function code; Package the configuration item processing function code into a target configuration file; The application server loads the updated target configuration file in the central server; The application server determines the configuration item to be updated and the configuration item processing function code based on the target configuration file; The application server updates the configuration data of the configuration item to be updated based on the configuration item processing function code.
6. An apparatus for updating configuration data, Characterized in that, Applied to a central server, the apparatus includes: A configuration component acquisition module, configured to acquire a basic configuration component; A configuration component screening module, configured to respond to a trigger operation on the basic configuration component, and determine a target logic configuration component and a target parameter configuration component from the basic configuration components; A rule component construction module, configured to construct a rule component based on the target logic configuration component and the target parameter configuration component; A configuration file generation module, configured to obtain the function statement corresponding to the target logic configuration component in the rule component, and the configuration item name corresponding to the target parameter configuration component in the rule component; determine the execution rule item and the function statement of the execution rule item in the target logic configuration component; determine the target parameter configuration component corresponding to the execution rule item from the rule component to obtain the configuration item name corresponding to the execution rule item; generate a rule item function code according to the function statement of the execution rule item and the configuration item name of the target parameter configuration component corresponding to the execution rule item; construct a configuration item processing function code based on the rule item function code; package the configuration item processing function code into a target configuration file; wherein, the target configuration file is used to instruct the application server to update configuration parameters according to the target configuration file.
7. A server, Characterized in that, The server includes: One or more processors; A memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the configuration data update method according to any one of claims 1 to 4.
8. A computer-readable storage medium, Characterized in that, A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the configuration data update method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Data processing method, device, server and computer readable storage medium
CN108287708A
Method and system for dynamically modifying execution plan, and computer readable storage medium
CN112417014A