CN115756532A - Configuration file updating method and device and electronic equipment - Google Patents

Configuration file updating method and device and electronic equipment Download PDF

Info

Publication number
CN115756532A
CN115756532A CN202211355997.3A CN202211355997A CN115756532A CN 115756532 A CN115756532 A CN 115756532A CN 202211355997 A CN202211355997 A CN 202211355997A CN 115756532 A CN115756532 A CN 115756532A
Authority
CN
China
Prior art keywords
configuration file
configuration
updating
identifier
target area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211355997.3A
Other languages
Chinese (zh)
Inventor
马朋彬
闫文开
王杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202211355997.3A priority Critical patent/CN115756532A/en
Publication of CN115756532A publication Critical patent/CN115756532A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure provides an updating method of a configuration file, which relates to the technical field of data updating, and the specific scheme is as follows: under the condition that a first control in a configuration page is triggered, acquiring configuration parameters corresponding to the configuration control in the configuration page; determining a target area identifier to be updated and a target parameter value according to the configuration parameters; updating a first configuration file associated with the target area identifier in the first storage area based on the target parameter value to obtain an updated first configuration file; and under the condition that the triggering of a second control in the configuration page is monitored, updating second configuration files respectively associated with the target area identification in the second storage area and the cache area by using the updated first configuration file. Therefore, the configuration file of the target area is modified in a layered mode in the updating device, and the updated configuration file is automatically issued to the scheduling terminal. Therefore, the efficiency of updating the configuration file of the target area is improved while the security of the configuration file is ensured.

Description

Configuration file updating method and device and electronic equipment
Technical Field
The present disclosure relates to the field of computers, and in particular, to the field of data updating technologies, and in particular, to a method and an apparatus for updating a configuration file, and an electronic device.
Background
In the application process of the unmanned taxi, the dispatching terminal can comprehensively dispatch the unmanned taxi according to the dispatching configuration file so as to quickly meet the vehicle using requirements in the area. However, with the continuous change of the vehicle demand and the unmanned vehicle, the scheduling configuration files in the scheduling terminals need to be frequently updated, so that the scheduling terminals can reasonably schedule the unmanned taxis in the area. Therefore, how to update the scheduling configuration file is a problem that needs to be solved at present.
Disclosure of Invention
The disclosure provides a configuration file updating method and device and electronic equipment.
According to an aspect of the present disclosure, there is provided a method for updating a configuration file, including:
acquiring configuration parameters corresponding to configuration controls in a configuration page under the condition that a first control in the configuration page is triggered;
determining a target area identifier to be updated and a target parameter value according to the configuration parameters;
updating a first configuration file associated with the target area identifier in the first storage area based on the target parameter value to obtain an updated first configuration file;
and under the condition that the triggering of a second control in the configuration page is monitored, updating second configuration files respectively associated with the target area identification in the second storage area and the cache area by using the updated first configuration file.
According to another aspect of the present disclosure, there is provided an apparatus for updating a configuration file, including:
the acquisition module is used for acquiring configuration parameters corresponding to the configuration controls in the configuration page under the condition that the first controls in the configuration page are triggered;
the determining module is used for determining a target area identifier to be updated and a target parameter value according to the configuration parameters;
the updating module is used for updating a first configuration file associated with the target area identifier in the first storage area based on the target parameter value so as to obtain the updated first configuration file;
the updating module is used for utilizing the updated first configuration file under the condition that the triggering of the second control in the configuration page is monitored, and updating second configuration files respectively associated with the target area identifications in the second storage area and the cache area.
According to another aspect of the present disclosure, there is provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the above embodiments.
According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method according to the above-described embodiments.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a schematic flowchart of a method for updating a configuration file according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of another configuration page provided by an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of another configuration file updating method according to an embodiment of the present disclosure;
fig. 4 is a schematic flowchart of another configuration file updating method according to an embodiment of the present disclosure;
fig. 5 is a schematic flowchart of another configuration file updating method according to an embodiment of the present disclosure;
fig. 6 is a schematic flowchart of another configuration file updating method according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of another configuration file updating apparatus according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of another configuration file updating apparatus according to an embodiment of the present disclosure;
FIG. 9 is a block diagram of an electronic device used to implement the update of configuration files of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Generally, when a configuration file in a scheduling terminal is updated, an update operation needs to be performed in each scheduling terminal, and the efficiency of updating the configuration file in the scheduling terminal is low. In the present disclosure, only the configuration file of each scheduling terminal needs to be updated in the updating apparatus, and then the updating apparatus automatically issues the updated configuration file to the corresponding scheduling terminal. Thereby improving the efficiency of updating the configuration file.
The following describes a method, an apparatus, an electronic device, and a storage medium for updating a configuration file according to embodiments of the present disclosure in detail with reference to the accompanying drawings.
It should be noted that the method for updating a configuration file implemented by the present disclosure is exemplified by being configured in an updating apparatus for a configuration file (hereinafter, simply referred to as an updating apparatus), and the updating apparatus may be applied to any electronic device, so that the electronic device may execute an updating function for a configuration file.
The electronic device may be any device having a computing capability, for example, a Personal Computer (PC), a mobile terminal, and the like, and the mobile terminal may be a hardware device having various operating systems, touch screens, and/or display screens, such as a mobile phone, a tablet Computer, a Personal digital assistant, and a wearable device.
Fig. 1 is a schematic flowchart of a method for updating a configuration file according to an embodiment of the present disclosure.
As shown in fig. 1, the method includes:
step 101, acquiring configuration parameters corresponding to a configuration control in a configuration page under the condition that a first control in the configuration page is triggered.
The first control is used for triggering the update of the first configuration file.
In the present disclosure, a user may select a target area of a configuration file to be updated in a configuration page, and a system may determine a corresponding configuration file according to the target area selected by the user, and display the configuration file in a configuration control in the configuration page. Then, the user can modify the parameter value of each scheduling parameter in the configuration file in the configuration control, or delete or add the scheduling parameter of the configuration file in the configuration control. And then, the user triggers the first control by clicking, and when the system monitors that the first control is triggered, configuration parameters corresponding to the configuration control are obtained. The configuration parameters may include information of each updated scheduling parameter in the configuration control and target area information in the configuration page.
Optionally, there may be a plurality of configuration files corresponding to the target area. When the system acquires a plurality of configuration files corresponding to the target area, the system can display a configuration file list corresponding to the target area in a configuration page. And then, the user can click the editing control corresponding to any configuration file in the trigger configuration file list, and when the system monitors that the editing control corresponding to the configuration file is triggered, the configuration control is popped up. And then, the user modifies each parameter in the configuration file in the configuration control, or deletes and adds the parameter of the configuration file in the configuration control. And then, the user triggers the first control by clicking, and when the system monitors that the first control is triggered, configuration parameters corresponding to the configuration control are obtained.
For example, as shown in fig. 2a, the user may select a target region of the configuration file to be updated through a "region selection" control. Thereafter, a list of configuration files is displayed in a configuration page. When it is monitored that the "edit" control corresponding to any one of the configuration files in the configuration file list is triggered, the configuration control may be displayed in the interface, as shown in fig. 2 b. The user can modify each parameter in the configuration file in the configuration control, or delete or add the parameter of the configuration file in the configuration control. When the system monitors that the first control is triggered, for example, when the system monitors that the "save" control at the bottom of fig. 2b is triggered, the configuration parameters corresponding to the configuration control are obtained.
In addition, the "new configuration" control in fig. 2a is used to add the configuration file of the target area. The "modify" control in fig. 2b is used to modify the name of the configuration file. The "+ add" control in fig. 2b is used to add scheduling parameters. The "clear" control in fig. 2b is used to clear the scheduling parameter information in the configuration control. The "save" control below the "clear" control in fig. 2b is used to save the scheduling parameter information in the configuration control.
And step 102, determining a target area identifier and a target parameter value to be updated according to the configuration parameters.
In the disclosure, when it is monitored that a tag corresponding to any one region is selected in a region selection control of a user in a configuration page, a system may determine, through query, a region identifier corresponding to the tag, where the region identifier is a target region identifier to be updated corresponding to the configuration control. In addition, the scheduling parameter to be updated and the target parameter value corresponding to the scheduling parameter can be determined by analyzing the configuration parameter.
Step 103, updating the first configuration file associated with the target area identifier in the first storage area based on the target parameter value to obtain an updated first configuration file.
In the present disclosure, in order to avoid an error of the updated configuration file, the configuration file is issued to the scheduling terminal, which results in a scheduling failure. The configuration file can be managed hierarchically. A first configuration file that is modifiable by a user may be stored in a first storage area. A second configuration file on the line is stored in a second storage area. Therefore, the second configuration file on the line and the first configuration file directly modified by the user are isolated, and the security of the second configuration file on the line is ensured.
In this disclosure, the target parameter value may be used to update a corresponding parameter value in the first configuration file associated with the target area identifier in the first storage area, so as to update the first configuration file in the first storage area.
Optionally, the user may update the first configuration file multiple times by triggering the first control multiple times. Therefore, the system may perform steps 101-103 for multiple times until it is detected that the second control in the configuration page is triggered.
And 104, under the condition that it is monitored that the second control in the configuration page is triggered, updating second configuration files respectively associated with the target area identifier in the second storage area and the cache area by using the updated first configuration file.
And the second control is used for triggering the update of the second configuration file.
In the disclosure, after the user completes modification of the first configuration file of the target area, the second control in the configuration page may be triggered by clicking. When the system monitors that the second control in the configuration page is triggered, the updated first configuration file can be used for updating the second configuration file associated with the target area identifier and the second storage area. And realizing the publishing and online of the updated configuration file.
As shown in fig. 2a, the user may trigger the operation of the target area to update the second configuration file with the first configuration file by clicking on the "publish" control.
Optionally, after the system completes updating the first configuration file, a preset window may be automatically popped up to inquire whether to log in the updated first configuration file. When the user completes modification of the first configuration file of the target area, a second control in the preset window can be triggered by clicking. When the system monitors that the second control in the preset window is triggered, the updated first configuration file can be used for updating the second configuration file of the second storage area associated with the target area identifier. Therefore, the scheduling terminal can acquire the updated configuration file in time.
In addition, to further improve the efficiency of updating the configuration file, a second configuration file may be stored in the cache area. Therefore, when the system monitors that the second control in the configuration page is triggered, the updated first configuration file can be used for updating the second configuration file associated with the target area identifier in the cache area.
Alternatively, the first configuration file in the first storage area and the second configuration file in the second storage area may be two different files stored in the database. To achieve isolation of on-line profiles and user-directly modified profiles.
According to the method and the device for updating the configuration file, under the condition that a first control in a configuration page is triggered, the configuration parameter corresponding to the configuration control in the configuration page is obtained, a target area identifier and a target parameter value to be updated are determined according to the configuration parameter, then a first configuration file associated with the target area identifier in a first storage area can be updated based on the target parameter value to obtain the updated first configuration file, and under the condition that a second control in the configuration page is monitored to be triggered, a second configuration file respectively associated with the target area identifier in a second storage area and a cache area is updated by using the updated first configuration file. Therefore, the configuration file of the target area is modified in a layered mode in the updating device, and the updated configuration file is automatically issued to the scheduling terminal. Therefore, the efficiency of updating the configuration file of the target area is improved while the security of the configuration file is ensured.
Fig. 3 is a schematic flowchart of a method for updating a configuration file according to an embodiment of the present disclosure.
As shown in fig. 3, the method includes:
step 301, acquiring a configuration parameter corresponding to a configuration control in a configuration page under the condition that a first control in the configuration page is triggered.
Step 302, according to the configuration parameters, determining the target area identifier and the target parameter value to be updated.
Step 303, updating the first configuration file associated with the target area identifier in the first storage area based on the target parameter value to obtain an updated first configuration file.
And 304, under the condition that it is monitored that the second control in the configuration page is triggered, updating second configuration files respectively associated with the target area identifier in the second storage area and the cache area by using the updated first configuration file.
In the present disclosure, the detailed implementation process of steps 301 to 304 may refer to the detailed description of any embodiment of the present disclosure, and is not repeated herein.
Step 305, under the condition that the update of the second configuration file in the cache region fails, after a preset time interval, updating the second configuration file in the cache region by using the second configuration file in the second storage region until the second configuration file in the cache region is the same as the second configuration file in the second storage region.
In the present disclosure, when the second configuration file in the cache area is updated, there may be a phenomenon that the update fails. In order to ensure that the second configuration file in the cache region and the second configuration file in the second storage region are consistent, the second configuration file in the cache region may be updated by using the second configuration file in the second storage region after a preset time interval until the second configuration file in the cache region is the same as the second configuration file in the second storage region. Therefore, the accuracy of updating the configuration file is ensured.
Step 306, setting a state identifier corresponding to the second configuration file in the cache area to a preset value, where the state identifier is used to identify whether the second configuration file in the cache area is the same as the second configuration file in the second storage area.
In this disclosure, in order to facilitate determining whether the second configuration file in the cache region is successfully updated, when the configuration file in the cache region is updated, the status flag corresponding to the second configuration file may be set to a default value, which is used to indicate that the second configuration file is not successfully updated. After the second configuration file in the cache region is successfully updated, the state identifier corresponding to the second configuration file may be set to a preset value, which is used to indicate that the second configuration file is successfully updated.
In the disclosure, the configuration file of the target area is modified in a layered manner in the updating device, and the updated configuration file is automatically issued to the scheduling terminal. Therefore, the efficiency of updating the configuration file of the target area is improved while the security of the configuration file is ensured.
Fig. 4 is a flowchart illustrating a method for updating a configuration file according to an embodiment of the present disclosure.
As shown in fig. 4, the method includes:
step 401, under the condition that the first control in the configuration page is triggered, acquiring a configuration parameter corresponding to the configuration control in the configuration page.
Step 402, according to the configuration parameters, determining the target area identifier and the target parameter value to be updated.
Step 403, updating the first configuration file associated with the target area identifier in the first storage area based on the target parameter value to obtain an updated first configuration file.
Step 404, under the condition that it is monitored that the second control in the configuration page is triggered, updating a second configuration file respectively associated with the target area identifier in the second storage area and the cache area by using the updated first configuration file.
Step 405, under the condition that the update of the second configuration file in the cache region fails, after a preset time interval, updating the second configuration file in the cache region by using the second configuration file in the second storage region until the second configuration file in the cache region is the same as the second configuration file in the second storage region.
Step 406, setting a state identifier corresponding to the second configuration file in the cache area to a preset value, where the state identifier is used to identify whether the second configuration file in the cache area is the same as the second configuration file in the second storage area.
In the present disclosure, the detailed implementation process of steps 401 to 406 may refer to the detailed description of any embodiment of the present disclosure, and is not repeated herein.
Step 407, in a case of receiving a request for obtaining a configuration file sent by a scheduling terminal corresponding to the target area identifier, obtaining a second configuration file associated with the target area identifier in the cache area and a status identifier corresponding to the second configuration file.
In the disclosure, the scheduling terminal may poll to send a request for obtaining the configuration file to the updating apparatus at a preset time interval. In order to improve the efficiency of updating the configuration file, the updating apparatus may first obtain the second configuration file corresponding to the target area identifier from the cache area when receiving the configuration file obtaining request sent by the scheduling terminal corresponding to the target area identifier.
Since the second configuration file in the cache region may not be the latest configuration file, the status identifier corresponding to the second configuration file may be obtained to determine whether the configuration file is the latest configuration file. Thereby ensuring the accuracy of the configuration file update.
And step 408, sending the second configuration file in the buffer area to the scheduling terminal under the condition that the state identifier is the preset value and the second configuration file is not empty.
In this disclosure, when the state identifier of the second configuration file associated with the target area identifier in the cache area is a preset value and the second configuration file is not empty, it is indicated that the second configuration file in the cache area is the latest configuration file. Therefore, the second configuration file in the buffer area may be transmitted to the scheduling terminal.
And step 409, acquiring a second configuration file associated with the target area identifier in the second storage area under the condition that the second configuration file acquisition fails, or the state identifier is not a preset value, or the second configuration file is empty.
In this disclosure, when the status identifier of the second configuration file associated with the target area identifier in the cache area is not a preset value, it indicates that the second configuration file in the cache area is not the latest configuration file. At this time, the second profile associated with the target area identifier may be acquired from the second storage area.
And when the second configuration file associated with the target area identifier in the cache area is empty, the second configuration file in the cache area is abnormal. At this time, the second profile associated with the target area identifier may be acquired from the second storage area.
When the second configuration file associated with the target area identifier in the cache area fails to be acquired, the second configuration file associated with the target area identifier may be acquired from the second storage area.
Step 410, sending the second configuration file in the second storage area to the scheduling terminal.
In this disclosure, the configuration file in the second storage area is an online configuration file. The second configuration file in the second storage area may be sent directly to the scheduling terminal. To ensure the accuracy of the profile update.
In the disclosure, the configuration file of the target area is modified in a layered manner in the updating device, and then the updated configuration file is obtained from the cache area and is issued to the scheduling terminal. Therefore, the efficiency of updating the configuration file of the target area is improved while the security of the configuration file is ensured.
Fig. 5 is a flowchart illustrating a method for updating a configuration file according to an embodiment of the present disclosure.
As shown in fig. 5, the method includes:
step 501, obtaining a user identifier of a current user.
The user identifier may be any information for uniquely determining the user, such as a user account. The present disclosure is not so limited.
In the present disclosure, the change of one vehicle dispatching parameter can have a great influence on the dispatching of the vehicles in the whole area. In order to ensure the security of the updated configuration file, user permission can be set for a user who updates the configuration file, when the user updates the configuration file, the permission of the user is verified, and after the verification is passed, the operation of updating the configuration file is performed.
In this disclosure, a user needs to log in to the system using a user account before updating a configuration file. Therefore, the system can acquire the user identification of the current user.
Step 502, querying a preset mapping relation table to obtain an authority identifier corresponding to the user identifier.
In the present disclosure, the mapping relationship table includes the authority identifier associated with each user identifier. Therefore, the authority identification corresponding to the user identification can be obtained by inquiring the preset mapping relation table. Wherein, the authority identifier is used for indicating whether the configuration file is allowed to be updated or not.
And 503, displaying a first control in the configuration page under the condition that the authority identifier is allowed to operate.
In the present disclosure, in the case where the authority is identified as allowing the operation, it is explained that the current user is allowed to update the profile. At this point, the system may configure the first control to be displayed in the page. Therefore, the user can trigger the first control to update the configuration file.
And in the case that the authority identification is that the operation is not allowed, the current user is not allowed to update the configuration file. At this point, the system may configure the first control to be hidden in the page. Therefore, the user cannot trigger the first control to update the configuration file.
Step 504, under the condition that the first control in the configuration page is triggered, obtaining the configuration parameters corresponding to the configuration control in the configuration page.
And 505, determining the target area identifier and the target parameter value to be updated according to the configuration parameters.
Step 506, updating the first configuration file associated with the target area identifier in the first storage area based on the target parameter value to obtain an updated first configuration file.
And 507, updating second configuration files respectively associated with the target area identifier in the second storage area and the cache area by using the updated first configuration file under the condition that it is monitored that the second control in the configuration page is triggered.
In the present disclosure, the detailed implementation process of step 504 to step 507 may refer to the detailed description of any embodiment of the present disclosure, and is not repeated herein.
In the method, the updating authority of the current user is verified, after the verification is passed, the configuration files of the target area are modified in a layered mode in the updating device, and the updated configuration files are issued to the scheduling terminal. Therefore, the efficiency of updating the configuration file of the target area is improved while the security of the configuration file is ensured.
Fig. 6 is a schematic flowchart of a method for updating a configuration file according to an embodiment of the present disclosure.
As shown in fig. 6, the method includes:
step 601, acquiring a configuration parameter corresponding to a configuration control in a configuration page under the condition that a first control in the configuration page is triggered.
Step 602, determining a target area identifier and a target parameter value to be updated according to the configuration parameters.
Step 603, updating the first configuration file associated with the target area identifier in the first storage area based on the target parameter value to obtain the updated first configuration file.
In the present disclosure, specific implementation processes of step 601 to step 603 may refer to detailed descriptions of any embodiment of the present disclosure, and are not described herein again.
Step 604, generating a publishing request of the first configuration file under the condition that it is monitored that the second control in the configuration page is triggered, wherein the publishing request includes the target area identifier.
In order to ensure the security of updating the configuration file, in the case that the second control is triggered in the configuration page is detected, a release request of the first configuration file may be generated to initiate an approval process. After approval is passed, the second configuration file is updated with the first configuration file.
Step 605, sending the issue request to the configuration terminal associated with the target area identifier.
In the disclosure, the release request may be sent to the configuration terminal associated with the target area identifier, so that the related auditors may examine and approve the release request in the configuration terminal.
Step 606, receiving feedback information of the publishing request sent by the configuration terminal, where the feedback information is used to indicate whether to publish the first configuration file.
In the disclosure, the relevant auditors may perform the determined issuing operation or the issuing rejection operation through the configuration terminal, and then the configuration terminal may generate the feedback information of the issuing request according to the operation of the auditors, so as to indicate whether to issue the first configuration file.
And step 607, in the case that the feedback information indicates that the first configuration file is not issued, ending the update operation of the configuration file.
In the present disclosure, in the case that the feedback information indicates that the first configuration file is not to be issued, the update operation of the configuration file may be ended. Further, in the case where the feedback information indicates that the first profile is issued, the next operation of updating the profile may be continued.
Step 608, updating the second configuration files respectively associated with the target area identifier in the second storage area and the cache area by using the updated first configuration file.
In the present disclosure, the specific implementation process of step 608 may refer to the detailed description of any embodiment of the present disclosure, and is not described herein again.
According to the method and the device, in the process of modifying the configuration file of the target area in a layered mode in the updating device, the step of examining and approving the updated configuration file is added, the configuration file is modified under the condition that the examination and approval are passed, and then the updated configuration file is issued to the scheduling terminal. Therefore, the efficiency of updating the configuration file of the target area is improved while the security of the configuration file is ensured.
Fig. 7 is a flowchart illustrating a method for updating a configuration file according to an embodiment of the present disclosure.
As shown in fig. 7, the method includes:
step 701, acquiring a configuration parameter corresponding to a configuration control in a configuration page under the condition that a first control in the configuration page is triggered.
Step 702, determining the target area identifier and the target parameter value to be updated according to the configuration parameters.
Step 703, updating the first configuration file associated with the target area identifier in the first storage area based on the target parameter value to obtain an updated first configuration file.
Step 704, under the condition that it is monitored that the second control in the configuration page is triggered, updating a second configuration file respectively associated with the target area identifier in the second storage area and the cache area by using the updated first configuration file.
In the present disclosure, the detailed implementation process of steps 701 to 704 may refer to the detailed description of any embodiment of the present disclosure, and is not described herein again.
Step 705, updating the historical version list in the configuration page according to the updated second configuration file and the update time of the second configuration file.
In order to prevent the incapability of tracing and rolling back in case of malicious operation or configuration error, the historical version list associated with the target area identifier in the configuration page may be updated according to the updated second configuration file and the update time of the second configuration file, so as to store all second configuration files on the release line of the target area.
Optionally, a historical version list associated with the target area identifier may be stored in the database.
Optionally, when it is monitored that the fourth control corresponding to any historical version associated with the target area identifier is triggered in the configuration page, the first configuration file associated with the target area identifier in the first storage area may be updated by using the second configuration file corresponding to any historical version.
According to the method, under the condition that a first control in a configuration page is triggered, configuration parameters corresponding to the configuration control in the configuration page are obtained, a target area identifier and a target parameter value to be updated are determined according to the configuration parameters, then a first configuration file in a first storage area and associated with the target area identifier can be updated based on the target parameter value to obtain an updated first configuration file, under the condition that it is monitored that a second control in the configuration page is triggered, a second configuration file in a second storage area and a cache area and associated with the target area identifier respectively is updated by the aid of the updated first configuration file, and then a historical version list in the configuration page can be updated according to the updated second configuration file and the update time of the second configuration file. Therefore, the configuration file of the target area is modified in a layered mode in the updating device, and the updated configuration file is automatically issued to the scheduling terminal. Therefore, the efficiency of updating the configuration file of the target area is improved while the security of the configuration file is ensured.
In order to implement the foregoing embodiment, an updating apparatus for a configuration file is further provided in the embodiments of the present disclosure.
Fig. 8 is a schematic structural diagram of an apparatus for updating a configuration file according to an embodiment of the present disclosure.
As shown in fig. 8, the apparatus 800 for updating a configuration file includes: an obtaining module 810, a determining module 820, and an updating module 830.
An obtaining module 810, configured to obtain a configuration parameter corresponding to a configuration control in a configuration page when a first control in the configuration page is triggered;
a determining module 820, configured to determine, according to the configuration parameters, a target area identifier and a target parameter value to be updated;
an updating module 830, configured to update, based on the target parameter value, the first configuration file associated with the target area identifier in the first storage area to obtain an updated first configuration file;
the updating module 830 is configured to update, by using the updated first configuration file, second configuration files in the second storage area and the cache area, where the second configuration files are respectively associated with the target area identifier, when it is monitored that the second control in the configuration page is triggered.
In a possible implementation manner of the embodiment of the present disclosure, the update module is further configured to:
under the condition that the second configuration file in the cache region fails to be updated, after a preset time interval, updating the second configuration file in the cache region by using the second configuration file in the second storage region until the second configuration file in the cache region is the same as the second configuration file in the second storage region;
and setting a state identifier corresponding to the second configuration file in the cache area as a preset value, wherein the state identifier is used for identifying whether the second configuration file in the cache area is the same as the second configuration file in the second storage area.
In a possible implementation manner of the embodiment of the present disclosure, the obtaining module is further configured to:
under the condition of receiving a configuration file acquisition request sent by a scheduling terminal corresponding to a target area identifier, acquiring a second configuration file associated with the target area identifier in a cache area and a state identifier corresponding to the second configuration file;
and the sending module is used for sending the second configuration file in the cache region to the scheduling terminal under the condition that the state identifier is a preset value and the second configuration file is not empty.
In a possible implementation manner of the embodiment of the present disclosure, the sending module is further configured to:
acquiring a second configuration file associated with the target area identifier in the second storage area under the condition that the second configuration file acquisition fails, or the state identifier is not a preset value, or the second configuration file is empty;
and sending the second configuration file in the second storage area to the scheduling terminal.
In a possible implementation manner of the embodiment of the present disclosure, the apparatus further includes a verification module, configured to:
acquiring a user identifier of a current user;
inquiring a preset mapping relation table to obtain an authority identification corresponding to the user identification;
and displaying a first control in the configuration page under the condition that the permission identification is allowed to operate.
In a possible implementation manner of the embodiment of the present disclosure, the verification module is further configured to:
generating a publishing request of a first configuration file, wherein the publishing request comprises a target area identifier;
sending the issuing request to a configuration terminal associated with the target area identifier;
receiving feedback information of a publishing request sent by a configuration terminal, wherein the feedback information is used for indicating whether to publish a first configuration file;
and in the case that the feedback information indicates that the first configuration file is not issued, ending the updating operation of the configuration file.
In a possible implementation manner of the embodiment of the present disclosure, the update module is further configured to:
and updating the historical version list in the configuration page according to the updated second configuration file and the updating time of the second configuration file.
It should be noted that the explanation of the embodiment of the method for updating a configuration file is also applicable to the apparatus of the embodiment, and therefore is not described herein again.
According to the method and the device for updating the configuration file, under the condition that a first control in a configuration page is triggered, the configuration parameter corresponding to the configuration control in the configuration page is obtained, a target area identifier and a target parameter value to be updated are determined according to the configuration parameter, then a first configuration file associated with the target area identifier in a first storage area can be updated based on the target parameter value to obtain the updated first configuration file, and under the condition that a second control in the configuration page is monitored to be triggered, a second configuration file respectively associated with the target area identifier in a second storage area and a cache area is updated by using the updated first configuration file. Therefore, the configuration file of the target area is modified in a layered mode in the updating device, and the updated configuration file is automatically issued to the scheduling terminal. Therefore, the efficiency of updating the configuration file of the target area is improved while the security of the configuration file is ensured.
According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.
FIG. 9 illustrates a schematic block diagram of an example electronic device 900 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 9, the apparatus 900 includes a computing unit 901 that can perform various appropriate actions and processes in accordance with a computer program stored in a ROM (Read-Only Memory) 902 or a computer program loaded from a storage unit 908 into a RAM (Random Access Memory) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The calculation unit 901, ROM 902, and RAM 903 are connected to each other via a bus 904. An I/O (Input/Output) interface 905 is also connected to the bus 904.
A number of components in the device 900 are connected to the I/O interface 905, including: an input unit 906 such as a keyboard, a mouse, and the like; an output unit 907 such as various types of displays, speakers, and the like; a storage unit 908 such as a magnetic disk, optical disk, or the like; and a communication unit 909 such as a network card, a modem, a wireless communication transceiver, and the like. The communication unit 909 allows the device 900 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
The computing unit 901 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of the computing Unit 901 include, but are not limited to, a CPU (Central Processing Unit), a GPU (graphics Processing Unit), various dedicated AI (Artificial Intelligence) computing chips, various computing Units running machine learning model algorithms, a DSP (Digital Signal Processor), and any suitable Processor, controller, microcontroller, and the like. The calculation unit 901 performs the respective methods and processes described above, such as the update method of the configuration file. For example, in some embodiments, the update method to the configuration file may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 900 via ROM 902 and/or communications unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the above described method of updating a configuration file may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform the update method of the configuration file by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be realized in digital electronic circuitry, integrated circuitry, FPGAs (Field Programmable Gate arrays), ASICs (Application-Specific Integrated circuits), ASSPs (Application Specific Standard products), SOCs (System On Chip, system On a Chip), CPLDs (Complex Programmable Logic devices), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a RAM, a ROM, an EPROM (Electrically Programmable Read-Only-Memory) or flash Memory, an optical fiber, a CD-ROM (Compact Disc Read-Only-Memory), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a Display device (e.g., a CRT (Cathode Ray Tube) or LCD (Liquid Crystal Display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), internet, and blockchain Network.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The Server may be a cloud Server, which is also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service expansibility in a conventional physical host and a VPS (Virtual Private Server). The server may also be a server of a distributed system, or a server incorporating a blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel or sequentially or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (16)

1. A method of updating a configuration file, the method comprising:
under the condition that a first control in a configuration page is triggered, acquiring configuration parameters corresponding to the configuration control in the configuration page;
determining a target area identifier to be updated and a target parameter value according to the configuration parameters;
updating a first configuration file associated with the target area identifier in the first storage area based on the target parameter value to obtain an updated first configuration file;
and under the condition that it is monitored that a second control in the configuration page is triggered, updating second configuration files respectively associated with the target area identifier in a second storage area and a cache area by using the updated first configuration file.
2. The method of claim 1, wherein after the updating the second configuration file respectively associated with the target area identifier in the second storage area and the cache area, the method further comprises:
under the condition that the updating of the second configuration file in the cache region fails, after a preset time interval, updating the second configuration file in the cache region by using the second configuration file in the second storage region until the second configuration file in the cache region is the same as the second configuration file in the second storage region;
and setting a state identifier corresponding to the second configuration file in the cache area to a preset value, wherein the state identifier is used for identifying whether the second configuration file in the cache area is the same as the second configuration file in the second storage area.
3. The method of claim 2, further comprising:
under the condition of receiving a configuration file acquisition request sent by a scheduling terminal corresponding to the target area identifier, acquiring a second configuration file associated with the target area identifier in the cache area and a state identifier corresponding to the second configuration file;
and sending the second configuration file in the cache region to the scheduling terminal under the condition that the state identifier is a preset value and the second configuration file is not empty.
4. The method of claim 3, further comprising:
acquiring a second configuration file associated with the target area identifier in the second storage area under the condition that the acquisition of the second configuration file fails, or the state identifier is not a preset value, or the second configuration file is empty;
and sending the second configuration file in the second storage area to the scheduling terminal.
5. The method of claim 1, wherein before the obtaining the configuration parameters corresponding to the configuration controls in the configuration page, the method further comprises:
acquiring a user identifier of a current user;
inquiring a preset mapping relation table to obtain an authority identification corresponding to the user identification;
and displaying the first control in the configuration page under the condition that the permission identification is allowed to operate.
6. The method according to any one of claims 1 to 5, wherein before updating the second configuration file respectively associated with the target area identifier in the second storage area and the cache area by using the updated first configuration file, the method further comprises:
generating a publishing request of the first configuration file, wherein the publishing request comprises the target area identifier;
sending the release request to a configuration terminal associated with the target area identifier;
receiving feedback information of the release request sent by the configuration terminal, wherein the feedback information is used for indicating whether to release the first configuration file;
and under the condition that the feedback information indicates that the first configuration file is not issued, ending the updating operation of the configuration file.
7. The method of claim 1, further comprising:
and updating the historical version list in the configuration page according to the updated second configuration file and the updating time of the second configuration file.
8. An apparatus for updating a configuration file, the apparatus comprising:
the device comprises an acquisition module, a configuration module and a control module, wherein the acquisition module is used for acquiring configuration parameters corresponding to a configuration control in a configuration page under the condition that a first control in the configuration page is triggered;
the determining module is used for determining a target area identifier to be updated and a target parameter value according to the configuration parameters;
the updating module is used for updating a first configuration file associated with the target area identifier in the first storage area based on the target parameter value so as to obtain an updated first configuration file;
and the updating module is used for updating second configuration files respectively associated with the target area identifications in a second storage area and a cache area by using the updated first configuration file under the condition that it is monitored that a second control in the configuration page is triggered.
9. The apparatus of claim 8, wherein the update module is further configured to:
under the condition that the updating of the second configuration file in the cache region fails, after a preset time interval, updating the second configuration file in the cache region by using the second configuration file in the second storage region until the second configuration file in the cache region is the same as the second configuration file in the second storage region;
and setting a state identifier corresponding to the second configuration file in the cache area to a preset value, wherein the state identifier is used for identifying whether the second configuration file in the cache area is the same as the second configuration file in the second storage area.
10. The apparatus of claim 9, wherein the obtaining module is further configured to:
under the condition of receiving a configuration file acquisition request sent by a scheduling terminal corresponding to the target area identifier, acquiring a second configuration file associated with the target area identifier in the cache area and a state identifier corresponding to the second configuration file;
and the sending module is used for sending the second configuration file in the cache region to the scheduling terminal under the condition that the state identifier is a preset value and the second configuration file is not empty.
11. The apparatus of claim 10, wherein the means for transmitting is further configured to:
acquiring a second configuration file associated with the target area identifier in the second storage area under the condition that the acquisition of the second configuration file fails, or the state identifier is not a preset value, or the second configuration file is empty;
and sending the second configuration file in the second storage area to the scheduling terminal.
12. The apparatus of claim 8, further comprising a verification module configured to:
acquiring a user identifier of a current user;
inquiring a preset mapping relation table to obtain an authority identification corresponding to the user identification;
and displaying the first control in the configuration page under the condition that the permission identification is allowed to operate.
13. The apparatus of any of claims 8-12, wherein the verification module is further configured to:
generating a publishing request of the first configuration file, wherein the publishing request comprises the target area identifier;
sending the release request to a configuration terminal associated with the target area identifier;
receiving feedback information of the release request sent by the configuration terminal, wherein the feedback information is used for indicating whether to release the first configuration file;
and under the condition that the feedback information indicates that the first configuration file is not issued, ending the updating operation of the configuration file.
14. The apparatus of claim 8, wherein the update module is further configured to:
and updating the historical version list in the configuration page according to the updated second configuration file and the updating time of the second configuration file.
15. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
16. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-7.
CN202211355997.3A 2022-11-01 2022-11-01 Configuration file updating method and device and electronic equipment Pending CN115756532A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211355997.3A CN115756532A (en) 2022-11-01 2022-11-01 Configuration file updating method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211355997.3A CN115756532A (en) 2022-11-01 2022-11-01 Configuration file updating method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN115756532A true CN115756532A (en) 2023-03-07

Family

ID=85355197

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211355997.3A Pending CN115756532A (en) 2022-11-01 2022-11-01 Configuration file updating method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN115756532A (en)

Similar Documents

Publication Publication Date Title
CN112911013B (en) Cloud application processing method and device, computer equipment and storage medium
CN111026572A (en) Fault processing method and device of distributed system and electronic equipment
CN109960212B (en) Task sending method and device
CN114448802A (en) Gateway configuration method and device, electronic equipment and storage medium
CN113076186B (en) Task processing method, device, electronic equipment and storage medium
CN114036533A (en) Log transmission method and device, electronic equipment and storage medium
CN113704058A (en) Business model monitoring method and device and electronic equipment
CN116451210A (en) Rights recovery method, device, equipment and storage medium
CN115756532A (en) Configuration file updating method and device and electronic equipment
CN113360689B (en) Image retrieval system, method, related device and computer program product
CN114389969A (en) Client test method and device, electronic equipment and storage medium
CN114070889A (en) Configuration method, traffic forwarding method, device, storage medium, and program product
CN112799642B (en) Method, apparatus, device and storage medium for processing data
CN114218313A (en) Data management method, device, electronic equipment, storage medium and product
CN113986135A (en) Method, device, equipment and storage medium for processing request
CN114401121A (en) Application program login method and device, electronic equipment and readable storage medium
CN112925623A (en) Task processing method and device, electronic equipment and medium
CN112968876A (en) Content sharing method and device, electronic equipment and storage medium
CN113595870B (en) Push message processing method and device, electronic equipment and storage medium
CN116432169B (en) Automatic task permission control method, system and equipment based on sharing strategy
CN110262756B (en) Method and device for caching data
CN115951921A (en) Service processing method, device and storage medium
CN114756398A (en) Data processing method, device, equipment and medium
CN113609145A (en) Database processing method and device, electronic equipment, storage medium and product
CN115080111A (en) Method, device and equipment for flow management of target application and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination