A method and device for hot publishing of uliweb framework configuration

Through the long polling mechanism, querying data changes to the configuration center and pushing the latest configuration, the problem of complex and performance impact of configuration modification operations in the existing technology is solved, and the hot publishing configuration of the uliweb framework is realized, which reduces operation difficulty and performance consumption, and avoids the use of the operation. Restart the application requirement.

CN112463251BActive Publication Date: 2024-12-27CHINA CONSTRUCTION BANK
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011413009.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-03
Publication Date
2024-12-27
Estimated Expiration
2040-12-03

AI Technical Summary

Technical Problem

In the prior art, the configuration modification operation is complex when deployed on multiple machines, which is easy to cause production accidents. Real-time reading of configuration has a great impact on performance, and each machine needs to be restarted to affect user use.

Method used

Use a long polling mechanism to send requests to the configuration center, query data changes, and receive and read configuration information when there is a change, close the connection, and realize that the configuration center pushes the latest configuration to the client as soon as possible, providing hot publishing configuration for the uliweb framework method.

Benefits of technology

Reduces the difficulty of system operation, does not require configuring each machine, does not require restarting the application when releasing, improves performance, and saves historical versions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112463251B_ABST
    Figure CN112463251B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for hot publishing of uliweb framework configuration, comprising the following steps: based on a long polling mechanism, sending a request to a configuration center, and then querying whether there is a data change in the configuration center, if not, maintaining a connection with the configuration center, and if so, receiving and reading the configuration information sent by the configuration center, and closing the connection with the configuration center; obtaining the configuration information to apply to the uliweb application. The method is provided to enable the configuration center to push the latest configuration to the client in the first time, while providing a method for hot publishing configuration for the uliweb framework.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer science and technology, and in particular to a method and device for hot publishing of uliweb framework configuration. Background Art

[0002] When a computer application reaches a performance bottleneck, the application is usually deployed to multiple machines running the same application. And during the application operation, the application configuration usually needs to be modified, but the application itself does not need to be modified.

[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0004] 1. The operation is complicated, time-consuming and labor-intensive, and prone to production accidents;

[0005] 2. Real-time reading configuration has a significant impact on the performance of existing applications;

[0006] 3. Each deployment machine needs to be restarted, affecting user usage. Summary of the invention

[0007] In view of this, an embodiment of the present invention provides a method and device for hot publishing of uliweb framework configuration, which can enable the configuration center to push the latest configuration to the client in the first time and provide a method for hot publishing configuration for the uliweb framework.

[0008] To achieve the above purpose, according to one aspect of an embodiment of the present invention, a method for hot publishing of uliweb framework configuration is provided, comprising sending a request to a configuration center based on a long polling mechanism, and then querying whether there is a data change in the configuration center, if not, maintaining a connection with the configuration center, and if so, receiving and reading the configuration information sent by the configuration center, and closing the connection with the configuration center;

[0009] Get configuration information to apply to the Uliweb application.

[0010] Optionally, according to the method of one aspect of the present invention, the configuration center is set in a server.

[0011] Optionally, according to a method according to one aspect of the present invention, configuration information required when the application is running is configured in the configuration center.

[0012] Optionally, according to a method according to one aspect of the present invention, the configuration update includes a newly released configuration and a configuration modification.

[0013] Optionally, according to a method of one aspect of the present invention, part of the uliweb usage configuration is adjusted to adapt to the configuration center client.

[0014] Optionally, according to a method of one aspect of the present invention, after receiving the configuration update sent by the configuration center, the client initiates a request again to enter the next cycle.

[0015] Optionally, according to a method according to one aspect of the present invention, the configuration update obtained from the client takes effect in real time.

[0016] Optionally, according to a method of one aspect of the present invention, the configuration center uniformly manages various configurations, various parameters, and various switches required for application operation, and provides a standard interface.

[0017] Optionally, according to a method of one aspect of the present invention, a maximum time limit is set. If there is no new information within the maximum time limit, the configuration center should actively send a normal response to the client that there is no new information in this polling and disconnect.

[0018] According to another aspect of the present invention, there is provided a device for hot publishing of uliweb framework configuration, comprising:

[0019] A reading module is used to send a request to the configuration center based on a long polling mechanism, and then query whether there is any data change in the configuration center. If not, maintain a connection with the configuration center. If yes, receive and read the configuration information sent by the configuration center, and close the connection with the configuration center;

[0020] The application module is used to obtain configuration information to apply to the Uliweb application.

[0021] Optionally, according to the apparatus for hot publishing of uliweb framework configurations in another aspect of the present invention, the configuration update includes a newly published configuration and a configuration modification.

[0022] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the method according to one aspect of the present invention is implemented.

[0023] According to yet another aspect of the present invention, a computer program product comprises computer program instructions, wherein the computer program instructions enable a computer to execute the method according to one aspect of the present invention.

[0024] According to the method of the present invention, the configuration center pushes the latest configuration to the client in the first place through long polling, providing a method for hot publishing configuration for the uliweb framework. Compared with the configuration publishing method in the prior art, the method for hot publishing configuration of the uliweb framework of the present invention has low system operation difficulty, does not need to configure each machine for support, does not need to restart the application when publishing, has high performance, and can also save historical versions.

[0025] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0027] Figure 1 It is a flow chart of a hot publishing method for configuring a uliweb framework according to an embodiment of the present invention;

[0028] Figure 2 It is a partial flow chart of a method for hot publishing of uliweb framework configuration according to an embodiment of the present invention;

[0029] Figure 3 It is a schematic diagram of main modules of a hot publishing device configured by a uliweb framework according to an embodiment of the present invention;

[0030] Figure 4 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0031] Figure 5 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0032] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0033] Uliweb is an open source Python web framework. Uliweb uses some relatively mature libraries, such as Werkzeug (Werkzeug is a practical function library of Python's WSGI specification) for core processing such as command line, URL mapping, and Debug; Webob (WebOb is a package for packaging the WSGI request environment (that is, making it easy to use) and creating WSGI responses) for generating and processing request and response objects; and SqlAlchemy (SQLAlchemy is an open source software for Python programming language) library, a powerful ORM (ORM provides a conceptual and easy-to-understand modeling data method for object-relational mapping). Uliweb also borrowed some design ideas and achievements of the Template (template refers to the function template and category template in the C++ programming language) template module of web2py (web2py is a full-featured Web application framework for Python language) and Django (Django is an open source Web application framework).

[0034] Uliweb adopts the Django-like MVT model. The whole project will consist of several relatively independent apps, each of which will have its own configuration file, templates directory, static directory, etc. URLs can be mapped automatically or manually. Python code can be directly embedded in the template, but you don't need to worry about the code indentation, just pay attention to adding a pass statement before the end of the block. The database is processed using ORM, and the underlying SQLAlchemy module can also be used directly. Supports i18n processing in code and templates. Uliweb also transplanted the Plugin mechanism from Ulipad, which can easily add user-specific processing to the framework. The provided command line tool can perform operations such as starting the development server and exporting source code. Now Uliweb can be deployed in multiple environments such as GAE, mod_wsgi, fastcgi, scgi, cgi, etc.

[0035] In addition, the Uliweb framework contains many innovations, such as Form processing that can be used to generate HTML code and verify uploaded data, including i18n processing for templates and pages, framework processing code, and a plug-in mechanism transplanted and modified from Ulipad.

[0036] The Uliweb framework will develop a unique ORM mechanism, Uliorm, which is encapsulated on the basis of SqlAlchemy and refers to the datastore code in GAE.

[0037] When an application is running, it needs configuration information for the application. Microservices divide the business in the application into smaller sub-services, and each service requires necessary configuration information to run.

[0038] Traditionally, static configuration is adopted for applications. Most projects write a separate configuration file, such as "config.conf", and then write various parameter configurations, application configurations, environment configurations, security configurations, and business configurations into this file. When the configuration is needed in the project code logic, it is read from this configuration file. Although this approach is simple, if the parameters need to be modified, it is very inflexible and even requires restarting the running project to take effect.

[0039] In addition, configuration files cannot distinguish between environments. Since configuration files are placed in projects, projects may have multiple environments, such as test environments, pre-release environments, and production environments. The configuration parameters used in each environment are theoretically different, so different parameters are configured in the configuration files according to different environments. These are all manually maintained, and when the project is released, it is extremely easy to cause errors due to mistakes made by developers.

[0040] At the same time, the configuration files are too scattered. If there are multiple logical modules deployed independently in a project, and the configuration content used by each module is different, the traditional approach is to put a configuration file in each module, and even the configuration file formats of different modules are different. The long-term result is that the configuration files are too scattered and chaotic, making them difficult to manage.

[0041] In addition, there is also the problem that configuration changes cannot be traced. Because static configuration files are used, it is not easy to form a record after the configuration is modified, and it is even more impossible to trace who modified it, when it was modified, and what was the content before the modification. Since it cannot be traced, when the configuration is wrong, there is no way to roll back the configuration.

[0042] In the traditional static configuration method, if you want to modify a certain configuration, you can only modify it and then re-publish the application. To achieve dynamicity, you can choose to use a database. The database is a warehouse that organizes, stores and manages data according to the data structure. It is a long-term, organized, shared, and uniformly managed data collection stored in the computer. The configuration changes are sensed by accessing the database through periodic polling. The delay in sensing configuration changes is long when the polling frequency is low, and the delay in sensing configuration changes is short when the polling frequency is high, but it is more lossy. A compromise needs to be made between real-time and performance.

[0043] In the Uliweb application framework, the configuration of existing applications has the following problems when modifying the configuration:

[0044] 1. When the uliweb application framework writes the configuration to settings.ini, modifying the application configuration requires logging into each machine to modify the setting.ini file and restarting each application machine. Modifying the configuration file on each machine is complicated, prone to errors, causing production accidents, and time-consuming;

[0045] 2. When the Uliweb application framework writes configurations to environment variables and the application reads environment variables, modifying the application configuration also requires modifying the environment variables on each machine, which is time-consuming and labor-intensive and can easily cause production accidents;

[0046] 3. When the UliWeb application framework writes the configuration to the remote service and reads the configuration file through a RESTful request, this method requires restarting the service, but each time the configuration is read, the remote server must be accessed, which has a significant impact on system performance.

[0047] 4. When the uliweb application framework publishes the configuration to the database, the application needs to read the configuration from the database when using it. This method has a significant improvement in performance compared to method 3, but there is some performance loss.

[0048] According to the present invention, a method for hot publishing of uliweb framework configuration is provided. Hot publishing means that configuration changes take effect in real time without restarting the machine. The configuration of the configuration center is read by the client of the configuration center, and the HttpLong Polling long polling mechanism is used when reading. The present invention also transforms the part of the configuration used by uliweb and adapts it to the client of the configuration center. This technical solution solves the problem that when uliweb modifies the configuration, it is necessary to operate multiple machines and restart the application at the same time. The main feature of this technical solution is unified management and hot loading of configuration files in uliweb applications without restarting the application.

[0049] More specifically, Figure 1 The method for hot publishing of uliweb framework configuration according to an embodiment of the present invention is as follows Figure 1As shown, first, configure the relevant configuration items in the configuration center; then, the client reads the configuration of the configuration center, using the long polling mechanism; secondly, the configuration center pushes the configuration update to the client; finally, the client applies the obtained configuration update to the uliweb application. When using the long polling mechanism, the client sends a restful request to the configuration center to query whether there is a data change in the configuration center. When there is no data change, the configuration center maintains the connection, and when there is a data change, the configuration center sends the configuration update to the client and closes the connection.

[0050] The configuration center specifically addresses the problems existing in traditional static configuration methods, and manages dynamic configurations by taking into account real-time and consistency. The configuration center is a centralized, dynamic configuration management facility. The idea of ​​the configuration center is to put all the configurations, parameters, and switches in the project in a centralized place for unified management, and provide a set of standard interfaces. When each service needs to obtain configuration, it pulls from the interface of the configuration center. When various parameters in the configuration center are updated, each service can be notified to synchronize the latest information in real time, so that it can be updated dynamically. The configuration center is used to achieve the following technical effects: centralized configuration management, unified standards; separation of configuration and application; real-time updates; high availability, etc. Common configuration centers include Baidu's disconf, Ctrip's apollo, and spring cloudconfig of the spring suite.

[0051] The long polling mechanism (Http Long Polling) is that the client continuously sends requests to the server to obtain the latest data information. The "non-stop" here actually means stopping, it just stops quickly and then starts connecting immediately.

[0052] Long polling is generally used in WebIM, ChatRoom and some website applications that require timely interaction. The client sends a request to the server. After receiving the request, the server maintains the connection until there is a new message, then returns a response message and closes the connection. After the client processes the response message, it sends a new request to the server.

[0053] The so-called long polling is to create and maintain a stable and reliable connection between the client and the server. In fact, it is a technology that has existed for a long time, but due to the slow development of technology, there is no good support for the implementation of this mechanism. Therefore, to achieve this effect, the client and server programs need to work together to complete it. The usual practice is to add an infinite loop to the server program and monitor the changes in data in the loop. When new data is found, it is immediately output to the client and the connection is disconnected. After receiving the data, the client initiates a request again to enter the next cycle.

[0054] Long polling usually includes the following key processes:

[0055] 1. Establishment of polling

[0056] The process of establishing polling is very simple. After the browser initiates a request, it enters a loop waiting state. At this time, since the server has not responded, it has been in a connected state.

[0057] 2. Data push

[0058] During the loop, the server program monitors data changes. If an update is found, the server program outputs the information to the client and then disconnects, completing the response process and implementing "server push".

[0059] 3. Termination of polling

[0060] Polling may terminate in the following three situations:

[0061] The first type: New data is pushed

[0062] When the server pushes information to the client during the loop, it should actively end the program to disconnect the connection so that the client can receive the data in time.

[0063] The second type: No new data is pushed

[0064] The loop cannot continue forever, and a maximum time limit should be set to avoid server timeout. If there is no new information, the server should actively send a normal response to the client that there is no new information in this polling and disconnect. This is also called a "heartbeat" message.

[0065] The third type: network failure or abnormality

[0066] Request timeout or error due to network failure or other factors may also cause unexpected interruption of polling, and the client will receive an error message.

[0067] 4. Reconstruction of polling

[0068] After the client receives the response and processes it accordingly, it should immediately re-initiate the request and start a new polling cycle.

[0069] The advantage of long polling is that it does not make frequent requests when there is no news, which consumes less resources. Its disadvantage is that the server consumes resources to maintain the connection, the order of returned data is not guaranteed, and it is difficult to manage and maintain.

[0070] Figure 2As shown, the client sends a restful request to the server, and the server queries whether there is any data change. When there is no data change, the server maintains the connection. When there is a data change, the server sends a new response message to the client and closes the connection.

[0071] restFul is a network API interface that conforms to the rest architecture style, and fully recognizes that Http is used to identify resources. The restFul URL is resource-oriented and can uniquely identify and locate resources. The operation performed on the resource identified by the URL is determined by the Http method. There are 4 rest request methods, including get, post, put, and delete. They correspond to obtaining resources, adding resources, updating resources, and deleting resources respectively.

[0072] Configuration updates can include newly released configurations as well as modifications to configurations.

[0073] Take limiting the accessible IP addresses of this application as an example. This scenario usually requires that only the IP addresses in the IP list be allowed to access this application to prevent attacks from modifying business data, and multiple servers are usually used when deploying applications. In this case, multiple servers are required.

[0074] When using the hot publishing method of the uliweb framework configuration according to an embodiment of the present invention, there is no need to use multiple servers. On the contrary, it is only necessary to set up a configuration center in one server and configure relevant configuration items in the configuration center. The client uses a long polling mechanism to read the configuration of the configuration center, sends a restful request to the configuration center, and queries whether there are data changes in the configuration center. When there is no data change, the configuration center maintains the connection. When there is a data change, the configuration center sends a configuration update to the client and closes the connection. The client applies the obtained configuration update to the uliweb application.

[0075] According to the hot publishing method of the uliweb framework configuration of the embodiment of the present invention, the configuration center pushes the latest configuration to the client in the first time through long polling, and provides a method for hot publishing configuration for the uliweb framework. Compared with the configuration publishing method in the prior art, the hot publishing method of the uliweb framework configuration of the present invention has low system operation difficulty, does not need to configure each machine for support, does not need to restart the application when publishing, has high performance, and can also save historical versions. See Table 1 below for details. Table 1 is an effect comparison table.

[0076] Table 1 Effect comparison table

[0077]

[0078] Figure 3The device 300 for hot publishing of uliweb framework configuration according to the present invention is shown, including: a reading module 301, which sends a request to a configuration center based on a long polling mechanism, and then inquires whether there is a data change in the configuration center. If not, it maintains a connection with the configuration center. If so, it receives and reads the configuration information sent by the configuration center and closes the connection with the configuration center; an application module 302 obtains the configuration information to apply it to the application of uliweb.

[0079] In some embodiments, the

[0080] Configuration updates include newly released configurations and configuration modifications.

[0081] In some embodiments, configuration information required when the application is running is configured in the configuration center.

[0082] In some embodiments, the configuration update includes a newly released configuration and a modification of the configuration.

[0083] In some embodiments, portions of the uliweb usage configuration are adapted to suit the configuration center client.

[0084] In some embodiments, after receiving the configuration update sent by the configuration center, the client initiates a request again to enter the next cycle.

[0085] In some embodiments, the configuration update obtained from the client takes effect in real time.

[0086] In some embodiments, the configuration center centrally manages various configurations, various parameters, and various switches required for application operation, and provides a standard interface.

[0087] In some embodiments, a maximum time limit is set. If there is no new information within the maximum time limit, the configuration center should actively send a normal response to the client that there is no new information in this polling and disconnect.

[0088] It should be noted that the method for configuring hot publishing of the uliweb framework described in the present invention and the device for configuring hot publishing of the uliweb framework described in the present invention have a corresponding relationship in terms of specific implementation contents, so the repeated contents will not be described again.

[0089] Figure 4 An exemplary system architecture 400 is shown to which the method for hot publishing of a uliweb framework configuration or the apparatus for hot publishing of a uliweb framework configuration according to an embodiment of the present invention may be applied.

[0090] like Figure 4As shown, system architecture 400 may include terminal devices 401, 402, 403, network 404 and server 405. Network 404 is used to provide a medium for communication links between terminal devices 401, 402, 403 and server 405. Network 404 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0091] Users can use terminal devices 401, 402, 403 to interact with server 405 through network 404 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 401, 402, 403, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0092] The terminal devices 401 , 402 , and 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0093] The server 405 may be a server that provides various services. The backend management server may analyze and process the received request and other data, and feed back the configuration update to the terminal device.

[0094] It should be understood that Figure 4 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0095] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 of a terminal device suitable for implementing an embodiment of the invention of the present application. Figure 5 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the invention of this application.

[0096] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0097] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.

[0098] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.

[0099] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0100] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0101] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes a reading module and an application module. The names of these units do not constitute a limitation on the units themselves in some cases, for example, the reading module may also be described as "a unit that sends a request to the configured central module and reads the configuration update".

[0102] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: based on the long polling mechanism, sending a request to the configuration center, and then querying whether there is a data change in the configuration center, if not, maintaining a connection with the configuration center, if yes, receiving and reading the configuration information sent by the configuration center, and closing the connection with the configuration center; obtaining the configuration information to apply to the application of uliweb.

[0103] According to the technical solution of the embodiment of the present invention, the configuration center pushes the latest configuration to the client in the first time through long polling, providing a method for hot publishing configuration for the uliweb framework. Compared with the configuration publishing method in the prior art, the method for hot publishing configuration of the uliweb framework of the present invention has low system operation difficulty, does not need to configure each machine for support, does not need to restart the application when publishing, has high performance, and can also save historical versions.

[0104] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for hot publishing of uliweb framework configuration, characterized in that: The following steps are involved: When the accessible IP address of the restricted application needs to obtain configuration, the client sends a RESTful request to the configuration center based on the long polling mechanism, and then the server queries whether there is any data change in the configuration center. If not, the server maintains a connection with the configuration center. If yes, the server receives and reads the configuration information pushed by the configuration center and closes the connection with the configuration center; the configuration center is set up in a server, and the configuration center manages various configurations, parameters, and switches required for the application to run in a unified manner, and provides a standard interface; the RESTful request method includes obtaining resources, adding resources, updating resources, and deleting resources; The configuration center manages dynamic configurations by taking into account both real-time and consistency. When various parameters in the configuration center are updated, the latest information is notified for real-time synchronization. The configuration center is used to achieve: centralized configuration management, unified standards, and separation of configuration and application. Real-time updates; High availability; Get configuration information to update the application applied to uliweb; The configuration update obtained from the client takes effect in real time; After receiving the configuration update sent by the configuration center, the client initiates a request again to enter the next cycle.

2. The method for hot publishing of uliweb framework configuration according to claim 1, characterized in that: include: The configuration center is used to configure the configuration information required when the application is running.

3. The method for hot publishing of uliweb framework configuration according to claim 1, characterized in that: include: The configuration update includes newly released configuration and configuration modification.

4. The method for hot publishing of uliweb framework configuration according to claim 1, characterized in that: include: Adjust the configuration part used by uliweb to adapt to the configuration center client.

5. The method for hot publishing of uliweb framework configuration according to claim 1, characterized in that: include: Set a maximum time limit. If there is no new information within the maximum time limit, the configuration center should actively send a normal response to the client that there is no new information in this polling and disconnect.

6. A device for hot publishing of uliweb framework configuration, comprising: The reading module is used to limit the accessible IP addresses of applications. When the configuration needs to be obtained, the control client sends a RESTful request to the configuration center based on the long polling mechanism, and then the server queries whether there is any data change in the configuration center. If not, the server maintains a connection with the configuration center. If so, the server receives and reads the configuration information pushed by the configuration center and closes the connection with the configuration center. The configuration center is set up in a server, and the configuration center manages various configurations, various parameters, and various switches required for the operation of the application in a unified manner, and provides a standard interface. The RESTful request method includes obtaining resources, adding resources, updating resources, and deleting resources. The configuration center manages dynamic configurations by taking into account both real-time and consistency. When various parameters in the configuration center are updated, the latest information is notified to synchronize in real time. The configuration center is used to achieve: centralized configuration management, unified standards, and separation of configuration and application. Real-time updates; High availability; Application module, used to obtain configuration information to be applied to the Uliweb application; The configuration update obtained from the client takes effect in real time; After receiving the configuration update sent by the configuration center, the client initiates a request again to enter the next cycle.

7. The device for hot publishing of uliweb framework configuration according to claim 6, characterized in that: include: The configuration update includes newly released configuration and configuration modification.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

9. A computer program product, characterized in that The method comprises computer program instructions, which enable a computer to execute the method as claimed in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Configuration information pushing method and device

    CN107241204A