Disclosure of Invention
The present application mainly aims to provide a unified configuration method and apparatus for projects, and a storage medium, so as to solve the problem of low project localized update maintenance efficiency.
To achieve the above object, according to one aspect of the present application, there is provided a unified configuration method for projects.
The unified configuration method for projects according to the application comprises the following steps: modifying preset components in the configuration, wherein the preset components are used for dynamic updating and monitoring on the nodes; and monitoring the change condition of the configuration information so as to enable the corresponding project server to automatically update the configuration information, wherein the change condition refers to data synchronization or project configuration distribution on the server.
Further, modifying the preset components in the configuration includes: and dynamically updating the configuration node by adopting GitHook.
Further, modifying the preset components in the configuration includes: and configuring node monitoring by adopting the Zookeeper.
Further, monitoring the change condition of the configuration information, so that the corresponding project server automatically updates the configuration information comprises:
and monitoring configuration change through a Python monitoring script so as to enable the corresponding project server to automatically update the configuration information.
Further, the method is used for a distributed content distribution system.
To achieve the above object, according to another aspect of the present application, there is provided a unified configuration apparatus for projects.
The unified configuration device for projects according to the present application includes: the configuration modification module is used for modifying preset components in the configuration, wherein the preset components are used for dynamic updating and monitoring on the nodes; and the monitoring module is used for monitoring the change condition of the configuration information so as to enable the corresponding project server to automatically update the configuration information, wherein the change condition refers to data synchronization or project configuration release on the server.
Further, the configuration modification module is configured to dynamically update the configuration node using the GitHook.
Further, the configuration modification module is configured to configure node monitoring by using Zookeeper.
Further, the monitoring module is configured to monitor configuration changes through a Python monitoring script, so that the corresponding project server automatically updates configuration information.
In order to achieve the above object, according to another aspect of the present application, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the unified configuration method for projects.
According to the unified configuration method and device for the project, the preset components in the configuration are modified, the configuration information is automatically updated by the corresponding project server by monitoring the change condition of the configuration information, the purpose of improving the maintenance efficiency under the condition of multiple projects is achieved, the technical effect of automatically updating the configuration information by the project server is achieved, and the technical problem of low project localized updating maintenance efficiency is solved.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, 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 partial embodiments of the present application, but not all 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.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be used. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In this application, the terms "upper", "lower", "left", "right", "front", "rear", "top", "bottom", "inner", "outer", "middle", "vertical", "horizontal", "lateral", "longitudinal", and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings. These terms are used primarily to better describe the present application and its embodiments, and are not used to limit the indicated devices, elements or components to a particular orientation or to be constructed and operated in a particular orientation.
Moreover, some of the above terms may be used to indicate other meanings besides the orientation or positional relationship, for example, the term "on" may also be used to indicate some kind of attachment or connection relationship in some cases. The specific meaning of these terms in this application will be understood by those of ordinary skill in the art as appropriate.
Furthermore, the terms "mounted," "disposed," "provided," "connected," and "sleeved" are to be construed broadly. For example, it may be a fixed connection, a removable connection, or a unitary construction; can be a mechanical connection, or an electrical connection; may be directly connected, or indirectly connected through intervening media, or may be in internal communication between two devices, elements or components. The specific meaning of the above terms in the present application can be understood by those of ordinary skill in the art as appropriate.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
As shown in fig. 1, the method includes steps S102 to S106 as follows:
step S102, modifying the preset components in the configuration,
the preset component is used for dynamic updating and monitoring on the node. Updates can be made on the nodes by modifying the configuration components. Monitoring can be performed on the nodes by modifying the configuration components.
In particular, the configuration component is modified for unified configuration in multiple projects.
Step S104, monitoring the change condition of the configuration information to make the corresponding project server automatically update the configuration information,
the change situation refers to data synchronization or project configuration distribution on the server.
Specifically, the configuration information of one or more projects can be automatically updated by the corresponding project server by monitoring the change of the configuration information.
It is noted that the data synchronization is referred to as occurring after the automation of the project server. It should also be noted that the project configuration refers to the monitored project configuration.
From the above description, it can be seen that the following technical effects are achieved by the present application:
in the embodiment of the application, the preset components in the configuration are modified, and the configuration information is automatically updated by the corresponding project server by monitoring the change condition of the configuration information, so that the aim of improving the maintenance efficiency under the multi-project condition is fulfilled, the technical effect of automatically updating the configuration information by the project server is realized, and the technical problem of low project localized updating maintenance efficiency is solved.
According to the embodiment of the present application, as a preference in the embodiment, as shown in fig. 2, the preset component in the modified configuration includes: and dynamically updating the configuration node by adopting GitHook.
In particular, dynamic updating and monitoring of each alignment node may be achieved using GitHook and Zookeeper.
According to the embodiment of the present application, as a preference in the embodiment, as shown in fig. 2, the preset component in the modified configuration includes: and configuring node monitoring by adopting the Zookeeper.
In particular, dynamic updating and monitoring of each alignment node may be achieved using GitHook and Zookeeper. ZooKeeper is a distributed coordination service that manages large hosts. Coordinating and managing services in a distributed environment is a complex process. ZooKeeper solves this problem through its simple architecture and API. ZooKeeper allows developers to focus on the core application logic without worrying about the distributed nature of the application. And when the code is updated, updating and storing data on the code information znode node, pushing the zookeeper to all servers monitoring the node, updating the code by the servers, and finishing one-time updating operation by all the servers.
According to the embodiment of the present application, as a preferred embodiment in the present application, as shown in fig. 3, monitoring a change condition of the configuration information so that the corresponding project server automatically updates the configuration information includes:
and monitoring configuration change through a Python monitoring script so as to enable the corresponding project server to automatically update the configuration information.
Specifically, a Python language is adopted to monitor the configuration change, so that the original release system can automatically update the configuration information of the server corresponding to the specified project.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
There is also provided, in accordance with an embodiment of the present application, an apparatus for implementing the above method, as shown in fig. 4, the apparatus including: a configuration modification module 10, configured to modify preset components in a configuration, where the preset components are used for dynamic update and monitoring on a node; and the monitoring module 20 is configured to monitor a change condition of the configuration information, so that the corresponding project server automatically updates the configuration information, where the change condition refers to data synchronization or project configuration distribution on the server.
The preset components in the configuration modification module 10 of the embodiment of the present application are used for dynamic update and monitoring on the node. Updates can be made on the nodes by modifying the configuration components. Monitoring can be performed on the nodes by modifying the configuration components.
In particular, the configuration component is modified for unified configuration in multiple projects.
The change in the monitoring module 20 of the embodiment of the present application refers to data synchronization or project configuration distribution on the server.
Specifically, the configuration information of one or more projects can be automatically updated by the corresponding project server by monitoring the change of the configuration information.
It is noted that the data synchronization is referred to as occurring after the automation of the project server. It should also be noted that the project configuration refers to the monitored project configuration.
According to the embodiment of the present application, as a preference in the embodiment, as shown in fig. 5, the apparatus is used in a distributed content distribution system.
According to the embodiment of the present application, as a preferred preference in the embodiment, the configuration modification module is configured to dynamically update the configuration node by using GitHook. In particular, dynamic updating and monitoring of each alignment node may be achieved using GitHook and Zookeeper.
According to the embodiment of the present application, as a preferred embodiment in the embodiment, the configuration modification module is configured to employ Zookeeper configuration node monitoring. In particular, dynamic updating and monitoring of each alignment node may be achieved using GitHook and Zookeeper.
ZooKeeper is a distributed coordination service that manages large hosts. Coordinating and managing services in a distributed environment is a complex process. ZooKeeper solves this problem through its simple architecture and API. ZooKeeper allows developers to focus on the core application logic without worrying about the distributed nature of the application. And when the code is updated, updating and storing data on the code information znode node, pushing the zookeeper to all servers monitoring the node, updating the code by the servers, and finishing one-time updating operation by all the servers.
According to the embodiment of the present application, as a preferred preference in the embodiment, the monitoring module is configured to monitor configuration changes through a Python monitoring script, so that a corresponding project server automatically updates configuration information.
Specifically, a Python language is adopted to monitor the configuration change, so that the original release system can automatically update the configuration information of the server corresponding to the specified project.
An embodiment of the present application further provides a specific implementation manner of an electronic device, which is capable of implementing all steps in the unified configuration method for a project in the foregoing embodiment, and referring to fig. 6, the electronic device specifically includes the following contents:
a processor (processor)601, a memory (memory)602, a communication Interface (Communications Interface)603, and a bus 604;
the processor 601, the memory 602 and the communication interface 603 complete mutual communication through the bus 604; the communication interface 603 is used for realizing information transmission among a unified configuration device for projects, an online service system, client equipment and other participating mechanisms;
the processor 601 is configured to call the computer program in the memory 602, and the processor implements all the steps in the unified configuration method for items in the above embodiments when executing the computer program, for example, the processor implements the following steps when executing the computer program:
step S102, modifying the preset components in the configuration,
the preset component is used for dynamic updating and monitoring on the node. Updates can be made on the nodes by modifying the configuration components. Monitoring can be performed on the nodes by modifying the configuration components.
In particular, the configuration component is modified for unified configuration in multiple projects.
Step S104, monitoring the change condition of the configuration information to make the corresponding project server automatically update the configuration information,
the change situation refers to data synchronization or project configuration distribution on the server.
Specifically, the configuration information of one or more projects can be automatically updated by the corresponding project server by monitoring the change of the configuration information.
It is noted that the data synchronization is referred to as occurring after the automation of the project server. It should also be noted that the project configuration refers to the monitored project configuration.
As can be seen from the above description, in the electronic device provided in the embodiment of the present application, the preset components in the configuration are modified, and the change condition of the configuration information is monitored, so that the corresponding project server automatically updates the configuration information, and the purpose of improving the maintenance efficiency under multiple project conditions is achieved, thereby achieving the technical effect of automatically updating the configuration information by the project server, and further solving the technical problem of low project localized updating maintenance efficiency.
It will be apparent to those skilled in the art that the modules or steps of the present application described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and they may alternatively be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, or fabricated separately as individual integrated circuit modules, or fabricated as a single integrated circuit module from multiple modules or steps. Thus, the present application is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.