Disclosure of Invention
The embodiment of the application aims to provide a configuration information updating method, a configuration information updating system, a client and a server so as to improve the stability of an application system when updating configuration information and the efficiency of processing a main service.
In order to solve the foregoing technical problem, embodiments of the present application provide a method, a system, a client, and a server for updating configuration information, where the method is implemented as follows:
a method for updating configuration information comprises the following steps:
the method comprises the steps that a client side obtains configuration information of a first application system, and first attribute information with preset identification in a plurality of attribute information contained in the configuration information is determined;
the first storage server determines a first key value corresponding to the first attribute information;
the first storage server monitors whether a first numerical value corresponding to the first key value changes; if the monitoring result is positive, the first storage server acquires a new first numerical value and pushes the new first numerical value to the client;
and the client receives a new first numerical value sent by the first storage server, and updates the configuration information of the first application system according to the new first numerical value.
A method for updating configuration information comprises the following steps:
the method comprises the steps that a client side obtains configuration information of a first application system, and first attribute information with preset identification in a plurality of attribute information contained in the configuration information is determined;
the client receives a new first numerical value which is sent by a first storage server and corresponds to the first attribute information;
and the client updates the configuration information of the first application system according to the new first numerical value.
A method for updating configuration information comprises the following steps:
the method comprises the steps that a first storage server obtains first attribute information of a first application system in a client side, and determines a first key value corresponding to the first attribute information; the first attribute information is attribute information with a preset identifier in a plurality of attribute information contained in configuration information of a first application system of a client;
the first storage server monitors whether a first numerical value corresponding to the first key value changes; if the monitoring result is positive, the first storage server acquires a new first numerical value and pushes the new first numerical value to the client, so that the client updates the configuration information of the first application system according to the new first numerical value.
A configuration information updating system comprises a client and a first storage server;
the client side is loaded with a first application system;
the client is used for acquiring configuration information of the first application system and determining first attribute information with a preset identifier in a plurality of attribute information contained in the configuration information;
the first storage server is used for acquiring the first attribute information and determining a first key value corresponding to the first attribute information; monitoring whether a first value corresponding to the first key value changes; if the monitoring result is positive, the first storage server is further used for acquiring a new first numerical value and pushing the new first numerical value to the client;
the client is further configured to receive a new first numerical value corresponding to the first attribute information and sent by the first storage server, and update the configuration information of the first application system according to the new first numerical value.
A client, comprising: the device comprises a first attribute information determining unit, a new value receiving unit and an updating unit;
the first attribute information determining unit is configured to acquire configuration information of a first application system in the client, and determine first attribute information with a preset identifier in a plurality of attribute information included in the configuration information;
the new numerical value receiving unit is used for receiving a new first numerical value which is sent by the first storage server and corresponds to the first attribute information;
and the updating unit is used for updating the configuration information of the first application system according to the new first numerical value.
A server, comprising: the device comprises a key value determining unit, a monitoring unit, a new value acquiring unit and a pushing unit;
the key value determining unit is used for acquiring first attribute information of a first application system in a client and determining a first key value corresponding to the first attribute information; the first attribute information is attribute information with a preset identifier in a plurality of attribute information contained in the configuration information of the first application system of the client;
the monitoring unit is used for monitoring whether a first numerical value corresponding to the first key value changes;
when the monitoring result of the monitoring unit is yes, the new value acquiring unit is used for acquiring a new first value corresponding to the first key value;
and the pushing unit is used for pushing the new first numerical value to the client.
According to the technical scheme provided by the embodiment of the application, the configuration information updating method, the configuration information updating system, the client and the server provided by the embodiment of the application can ensure the running stability of the application system because the application system of the client does not need to inquire whether the first numerical value in the database is updated for many times. Meanwhile, the new first value received by the client is pushed by the first storage server and is directly stored in the memory of the client, so that the application system can acquire the new first value only by directly reading the new first value from the memory of the client, thereby saving the network IO (input/output) overhead of the application system and improving the efficiency of the application system for processing the main service.
Detailed Description
The embodiment of the application provides a configuration information updating method, a configuration information updating system, a client and a server.
In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a flowchart of an embodiment of a configuration information updating method according to the present application. Referring to fig. 1, the configuration information updating method may include the following steps.
S101: the client acquires configuration information of a first application system, and determines first attribute information with a preset identifier in a plurality of attribute information contained in the configuration information.
The first application system may be any application system loaded on the client. The first application system may be an application system employing a spring framework.
The client may obtain configuration information of the first application system. The configuration information may include a plurality of attribute information.
One attribute information may correspond to one key-value pair (key-value). The key-value pairs may be stored in a database. In the key value-numerical value pair, the key value may represent an attribute name corresponding to the attribute information, and the numerical value may represent an attribute value corresponding to the attribute information. For example, if the attribute information is age information, the key value (key) corresponding to the attribute information may be "age", and the value (value) may be "15".
First attribute information with a preset identifier in a plurality of attribute information contained in the configuration information can be determined. The first attribute information may represent attribute information that needs to be dynamically updated in the configuration information of the first application system.
For an application system adopting a spring framework, the preset identifier may include: specific annotations are preset. Specifically, the preset specific annotation may be a specific annotation set for a key value corresponding to attribute information that needs to be dynamically updated. For example, for one attribute information "student name", the corresponding key value (key) may be "stuName", and then the specific annotation "DynamicConf" may be set for the key value "stuName".
The first attribute information having a preset identification may be determined by detecting configuration information of the first application system. For example, for an application system adopting a casting framework, the application system may obtain software component information (e.g., bean information) after the application system is initialized by executing a postprocessafter instruction method, and may identify whether the software component information includes attribute information with a specific annotation according to the software component information.
The first attribute information may be one or more.
S102: and the first storage server determines a first key value corresponding to the first attribute information.
The first storage server may be a server separate from the client. The first storage server may employ an etcd storage system. The etcd storage system is a highly available key value storage system, and can be used for storing key value-value pairs of attribute information needing to be dynamically updated.
The first storage server may acquire first attribute information corresponding to the first application system. Meanwhile, a first key value corresponding to the first attribute information may be determined. For example, a first key value corresponding to the first attribute information may be obtained from a database.
For example, for the first attribute information "student name" in step S101, the corresponding first key value "stuName" in the database may be acquired.
Further, the first storage server may further obtain a first numerical value corresponding to the first key value. Namely, the value corresponding to the key of the first attribute is obtained. The first storage server may retrieve the first value from a database.
Further, the client may obtain a first value corresponding to the first key value from the first storage server, and configure the first application system using the first value. Specifically, the client may obtain the first value in the first storage server in a reflection manner. For example, for an application system employing a spring frame, a reflection tool in the spring frame may be utilized to obtain the first value.
S103: the first storage server monitors whether a first numerical value corresponding to the first key value changes; and if the monitoring result is positive, the first storage server acquires a new first numerical value and pushes the new first numerical value to the client.
The first storage server may monitor whether a first value corresponding to a first key value changes. When the first storage server monitors that the first numerical value corresponding to the first key value changes, the first storage server may acquire a new first numerical value.
In an embodiment, if the first storage server is an etcd storage system, a monitoring interface of the etcd storage system may be used to monitor whether a first value corresponding to the first key value in the database changes, and if so, the monitoring result may be yes. For example, the watch interface of the etcd storage system may be utilized to monitor whether the first value corresponding to the first key value in the database changes.
In another embodiment, the first storage server may further receive a message that the first value is changed, where the message that the first value is changed is sent by a third-party device, and when the message that the first value is changed is received by the first storage server, the monitoring result may be yes. The message of the first value change may include: the new first value.
In one embodiment, the third party device may be a display-enabled device. The third-party device may send the message that the first value is changed to the first storage server in the following manner: the third-party device may obtain and display the first numerical value in the first storage server, and the third-party device may receive a new first numerical value input by a user and send the new first numerical value to the first storage server. For example, the third-party device may be a browser, the browser may query and display the first numerical value in the first storage server, the user may change the first numerical value to a new first numerical value, and the browser may send the new first numerical value to the first storage after receiving the new first numerical value input by the user. Through the mode, the first numerical value can be conveniently changed by utilizing the third-party equipment, and the updating efficiency of the configuration information is improved.
The first storage server may push the new first value to the client.
S104: and the client receives a new first numerical value sent by the first storage server, and updates the configuration information of the first application system according to the new first numerical value.
The client may receive a new first value sent by the first storage server.
The configuration information of the first application system may be updated based on the new first value. In particular, the new first value may be written into configuration information of the first application system. For example, for an application system adopting the spring framework, the new first value may be written into the configuration information of the first application system by using a reflection tool in the spring framework.
Fig. 2 is a flowchart of another embodiment of the configuration information updating method of the present application. Referring to fig. 2, the configuration information updating method of the application system having the client as the main body may include the following steps.
S201: the client acquires configuration information of a first application system, and determines first attribute information with a preset identifier in a plurality of attribute information contained in the configuration information.
One of the attribute information in the configuration information may correspond to a key value-value pair. The key-value pairs may be stored in a database.
The first attribute information may be attribute information that needs to be dynamically updated among a plurality of attribute information included in the configuration information.
When the first application system is an application system adopting a spring framework, the preset identifier comprises: specific annotations are preset. The preset specific annotation may specifically be a specific annotation set for a key value corresponding to the first attribute information.
In one embodiment, the method may further comprise: the client side obtains a first numerical value corresponding to a first key value from a first storage server, and configures the first application system by using the first numerical value.
S202: and the client receives a new first numerical value which is sent by the first storage server and corresponds to the first attribute information.
The first storage server may be an etcd storage system. The first value of the heart sent by the first storage server may be obtained from the database by the first storage server.
In one embodiment, the first storage server may monitor whether a first value corresponding to the first key value in the database changes; if so, the first storage server can acquire a new first numerical value and send the new first numerical value to the client.
After receiving the new first value, the client may store the new first value in the memory.
S203: and the client updates the configuration information of the first application system according to the new first numerical value.
Specifically, the client may obtain the new first value from the memory, and write the new first value into the configuration information of the first application system.
Fig. 3 is a flowchart of another embodiment of the configuration information updating method of the present application. Referring to fig. 3, the configuration information updating method with the first storage server as a main body may include the following steps.
S301: the method comprises the steps that a first storage server obtains first attribute information of a first application system in a client side, and a first key value corresponding to the first attribute information is determined.
The first storage server may be an etcd storage system and may be configured to store key-value pairs associated with the first attribute information.
The first attribute information may be attribute information that needs to be dynamically updated in a plurality of attribute information included in configuration information of the first application system of the client.
The first attribute information may be attribute information having a preset identification. Specifically, it may be attribute information with a specific annotation.
The first storage server may obtain a first key value for the first attribute information from a database.
S302: the first storage server monitors whether a first numerical value corresponding to the first key value changes; if the monitoring result is positive, the first storage server acquires a new first numerical value and pushes the new first numerical value to the client, so that the client updates the configuration information of the first application system according to the new first numerical value.
In an embodiment, if the first storage server is an etcd storage system, a monitoring interface of the etcd storage system may be used to monitor whether a first value corresponding to the first key value in the database changes, and if so, the monitoring result may be yes. Then, the first storage server may obtain a new first value and push the new first value to the client. For example, a watch interface of the etcd memory system may be utilized to monitor whether a first value corresponding to the first key value changes. If the monitoring result is yes, the first storage server may obtain a new first numerical value, and push the new first numerical value to the client.
In another embodiment, the first storage server may further receive a message that the first value is changed, where the message that the first value is changed is sent by a third-party device, and when the message that the first value is changed is received by the first storage server, the monitoring result may be yes. Then, the first storage server may obtain a new first value and push the new first value to the client. The message of the first value change may include: the new first value.
In one embodiment, the method further comprises: and the first storage server stores the acquired new first numerical value.
In the configuration information updating method provided in the above embodiment, since the application system of the client does not need to query for many times whether the first value in the database is updated, the running stability of the application system can be ensured. Meanwhile, the new first value received by the client is pushed by the first storage server and is directly stored in the memory of the client, so that the application system can acquire the new first value only by directly reading the new first value from the memory of the client, thereby saving the network IO (input/output) overhead of the application system and improving the efficiency of the application system for processing the main service.
Fig. 4 is a schematic diagram illustrating the components of an embodiment of the configuration information updating system according to the present application. Referring to fig. 4, the configuration information updating system may include: a client 100 and a first storage server 200.
The client 100 may be a PC, a notebook computer, a tablet computer, a mobile phone, an intelligent self-service terminal, an intelligent wearable device, a computer cluster composed of a plurality of computer devices, or the like.
The first storage server 200 may be a server with a storage function, and may be one computer device, or a computer cluster composed of a plurality of computer devices.
The client 100 may be loaded with a first application system.
The client 100 may be configured to obtain configuration information of the first application system, and determine first attribute information having a preset identifier in a plurality of attribute information included in the configuration information. The first attribute information may be attribute information that needs to be dynamically updated in a plurality of attribute information included in the configuration information of the first application system in the client 100.
The first storage server 200 may be configured to obtain the first attribute information, and determine a first key value corresponding to the first attribute information. The first storage server 200 may be further configured to monitor whether a first value corresponding to the first key value changes; if the monitoring result is yes, the first storage server 200 is further configured to obtain a new first value, and push the new first value to the client 100.
In one embodiment, the first storage server 200 may monitor whether the first value in the database changes through the monitoring interface, and if the first value changes, the monitoring result may be yes.
In another embodiment, the first storage server 200 may further receive a message sent by a third-party device that the first value changes, and when the first storage server receives the message that the first value changes, the monitoring result may be yes.
The client 100 may be further configured to receive a new first value sent by the first storage server 200 and corresponding to the first attribute information, and update the configuration information of the first application system according to the new first value.
Fig. 5 is a schematic block diagram of a client in an embodiment of the configuration information updating system of the present application. Referring to fig. 5, the client 100 may include: a first attribute information determination unit 101, a new value receiving unit 102, and an updating unit 103.
The first attribute information determining unit 101 may be configured to obtain configuration information of a first application system in the client, and determine first attribute information having a preset identifier in a plurality of attribute information included in the configuration information.
The new value receiving unit 102 may be configured to receive a new first value corresponding to the first attribute information from the first storage server.
The updating unit 103 may be configured to update the configuration information of the first application system according to the new first value.
Fig. 6 is a schematic block diagram of a first storage server in an embodiment of the configuration information updating system of the present application. Referring to fig. 6, the first storage server 200 may include: a key value determining unit 201, a monitoring unit 202, a new value acquiring unit 203, and a pushing unit 204.
The key value determining unit 201 may be configured to obtain first attribute information of a first application system in a client, and determine a first key value corresponding to the first attribute information. The first attribute information is attribute information which needs to be dynamically updated in a plurality of attribute information contained in the configuration information of the first application system of the client.
The monitoring unit 202 may be configured to monitor whether a first value corresponding to the first key value changes.
When the monitoring result of the monitoring unit 202 is yes, the new value obtaining unit 203 may be configured to obtain a new first value corresponding to the first key value.
The pushing unit 204 may be configured to push the new first numerical value to the client.
The specific functions executed by the configuration information updating system, the client and the server provided by the above embodiments can be explained in comparison with the method embodiments of the present application, so that the method embodiments of the present application can be realized and the technical effects of the method embodiments can be achieved.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate a dedicated integrated circuit chip 2. Furthermore, nowadays, instead of manually making an integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Language Description Language), traffic, pl (core unified Programming Language), HDCal, JHDL (Java Hardware Description Language), langue, Lola, HDL, laspam, hardsradware (Hardware Description Language), vhjhd (Hardware Description Language), and vhigh-Language, which are currently used in most popular applications. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory.
Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
From the above description of the embodiments, it is clear to those skilled in the art that the present application can be implemented by software plus necessary general hardware platform. With this understanding in mind, the present solution, or portions thereof that contribute to the prior art, may be embodied in the form of a software product, which in a typical configuration includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory. The computer software product may include instructions for causing a computing device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in the various embodiments or portions of embodiments of the present application. The computer software product may be stored in a memory, which may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium. Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include transitory computer readable media (transient media), such as modulated data signals and carrier waves.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The application is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
While the present application has been described with examples, those of ordinary skill in the art will appreciate that there are numerous variations and permutations of the present application without departing from the spirit of the application, and it is intended that the appended claims encompass such variations and permutations without departing from the spirit of the application.