Configuration updating method and device, electronic device, and computer-readable storage medium
By automatically comparing and updating test environment configuration files, the problem of inefficiency and errors in multi-version test environment configuration synchronization in Internet product iterations is solved, and efficient and accurate configuration file updates are achieved.
Patent Information
- Application Number
- CN202211173084.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-26
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2042-09-26
AI Technical Summary
In the iteration process of Internet products, due to functional differences in multiple versions of the test environment, the content of the configuration files is inconsistent, requiring manual synchronization, which is time-consuming, labor-intensive, error-prone, and affects product delivery.
Provide a configuration update method and device, which automatically updates the second configuration file by obtaining the first configuration file and the second configuration file for update, compares the configuration items in the key-value pair format, and achieves high efficiency without manual participation. Accurately updated.
It reduces the time and labor costs of manually checking configuration items, improves the efficiency and accuracy of configuration file updates, and reduces the risk of configuration file update errors caused by manual comparison errors.
Smart Images

Figure CN116155730B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a configuration update method and device, an electronic device, and a computer-readable storage medium. Background Art
[0002] In order to quickly respond to user needs, Internet products are often updated and iterated at a very fast speed, which means that a software project may have multiple versions tested in parallel. In different versions of the test environment, due to functional differences, the contents of the configuration files used to configure the test environment are often not exactly the same. This means that after each iteration of the Internet product is launched, the configurations in different test environments need to be manually synchronized, which is not only time-consuming, labor-intensive and inefficient, but may also cause problems in the test environment due to manual configuration errors, and even affect product delivery. Summary of the invention
[0003] The present disclosure provides a configuration update method and device, an electronic device, and a computer-readable storage medium.
[0004] In a first aspect, the present disclosure provides a configuration update method, the configuration update method comprising:
[0005] Obtaining a first configuration file for updating a test environment configuration of a software system;
[0006] Obtain a second configuration file to be updated, wherein the second configuration file is used to configure a test environment configuration of a test environment corresponding to the software system, and each of the first configuration file and the second configuration file includes at least one configuration item in a key-value pair format, wherein the key-value pair uses a configuration parameter as a key and a parameter value of the configuration parameter as a value;
[0007] The configuration parameters in the configuration items of the first configuration file are compared with the configuration parameters in the configuration items of the second configuration file, and the second configuration file is updated according to the comparison result.
[0008] In a second aspect, the present disclosure provides a configuration updating device, the configuration updating device comprising:
[0009] A first acquisition unit, used to acquire a first configuration file for updating a test environment configuration of a software system;
[0010] a second acquisition unit, configured to acquire a second configuration file to be updated, wherein the second configuration file is used to configure a test environment configuration of a test environment corresponding to the software system, and the first configuration file and the second configuration file each include at least one configuration item in a key-value pair format, wherein the key-value pair uses a configuration parameter as a key and uses a parameter value of the configuration parameter as a value;
[0011] An updating unit is used to compare the configuration parameters in the configuration items of the first configuration file with the configuration parameters in the configuration items of the second configuration file, and update the second configuration file according to the comparison result.
[0012] In a third aspect, the present disclosure provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores one or more computer programs executable by the at least one processor, and one or more of the computer programs are executed by the at least one processor so that the at least one processor can execute the above-mentioned configuration update method.
[0013] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the above-mentioned configuration update method when executed by a processor.
[0014] In the embodiments provided by the present disclosure, after the electronic device obtains a first configuration file for updating the test environment configuration of the software system and obtains a second configuration file to be updated, the second configuration file is updated based on the first configuration file by using a preset file comparison rule. The electronic device can automatically update the second configuration file without user participation to update the test environment configuration corresponding to the second configuration file.
[0015] The configuration update method provided by the embodiment of the present disclosure sets configuration items in a key-value pair (KEY-VALUE) format in a first configuration file and a second configuration file corresponding to the software system, and after the electronic device obtains the first configuration file and the second configuration file, compares the configuration parameters in the configuration items of the first configuration file with the configuration parameters in the configuration items of the second configuration file, thereby efficiently and accurately updating the content of the second configuration file based on the comparison result, and then updating the test environment configuration corresponding to the second configuration file.
[0016] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. The above and other features and advantages will become more apparent to those skilled in the art by describing detailed example embodiments with reference to the accompanying drawings, in which:
[0018] Figure 1A schematic diagram of an implementation environment of a configuration update method provided in an embodiment of the present disclosure;
[0019] Figure 2 A flowchart of a configuration update method provided by an embodiment of the present disclosure;
[0020] Figure 3 A flowchart of a first update process provided by an embodiment of the present disclosure;
[0021] Figure 4 A flowchart of obtaining a first configuration file provided in an embodiment of the present disclosure;
[0022] Figure 5 A schematic diagram of a configuration interface provided in an embodiment of the present disclosure;
[0023] Figure 6 A flowchart of obtaining a second configuration file provided in an embodiment of the present disclosure;
[0024] Figure 7 A flowchart of a second update process provided by an embodiment of the present disclosure;
[0025] Figure 8 A block diagram of a configuration update device provided in an embodiment of the present disclosure;
[0026] Fig. 9 A block diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0028] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.
[0029] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0030] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a" and "the" are also intended to include plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "including" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded. "Connected" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect.
[0031] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined as such herein.
[0032] In the related art, in order to update the configurations in the test environments corresponding to different versions of the software system, the version manager of the designated software system generally manually synchronizes all the configurations of the current version to different test environments. Specifically, first, manually compare each test environment to see whether the same configuration parameters under the version exist; second, if so, determine whether the parameter value of the configuration parameter is correct; finally, if not, manually add the configuration parameter and its parameter value to the configuration file of the test environment.
[0033] The above configuration update method in the related art is not only time-consuming and laborious but also prone to errors. In addition, since system problems caused by configuration problems are usually hidden and difficult to be troubleshooted, this configuration update method may also affect the delivery of the final software product.
[0034] Please see Figure 1 , which is a schematic diagram of the implementation environment of the configuration update method provided by the embodiment of the present disclosure. Figure 1 As shown, the implementation environment may include a first server 101 , a terminal device 102 , a second server 103 and a network 104 .
[0035] The first server 101 can be, for example, a physical server, such as a blade server, a rack server, etc. The first server 101 can also be a virtual server, such as a server cluster deployed in the cloud, which is not limited here. In the embodiments of the present disclosure, the first server 101 can be used to implement the configuration update method of any embodiment of the present disclosure to update the test environment configuration of the software system deployed in the second server 103.
[0036] The terminal device 102 may be a smart phone, a portable computer, a desktop computer, a tablet computer, etc. In the embodiment of the present disclosure, the terminal device 102 may be used to display a configuration interface, which may allow a user to configure a first configuration file for updating a test environment configuration of a software system, and allow the user to configure a software system to be executed and configure a second configuration file to be updated.
[0037] The second server 103 may be, for example, a physical server, such as a blade server, a rack server, etc. The first server 101 may also be a virtual server, such as a server cluster deployed in the cloud, which is not limited here. In the embodiment of the present disclosure, at least one test environment corresponding to the software system is deployed in the second server 103, and the at least one test environment includes at least one test environment whose test environment configuration is to be updated.
[0038] The network 104 may be a wireless network or a wired network, a local area network or a wide area network. The first server 101 , the terminal device 102 and the second server 103 may communicate with each other through the network 104 .
[0039] In the embodiment of the present disclosure, the first server 101 can be used to participate in implementing the configuration update method according to any embodiment of the present disclosure. For example, it can be used to: obtain a first configuration file configured by a user based on a terminal device 102 for updating the test environment configuration of a software system; obtain a second configuration file of a test environment configured by a user based on the terminal device 102 and deployed in the second server 103, where the test environment configuration is to be updated, wherein both the first configuration file and the second configuration file include at least one configuration item in a key-value pair format, the key-value pair uses a configuration parameter as a key and a parameter value of the configuration parameter as a value; and compare the configuration parameters in the configuration items of the first configuration file with the configuration parameters in the configuration items of the second configuration file, and update the second configuration file according to the comparison result; and after updating the second configuration file, send the second configuration file to the second server 103, so that the second server 103 implements the update of the corresponding test environment configuration based on the second configuration file.
[0040] Understandably, Figure 1The implementation environment shown is illustrative only and is in no way intended to limit the present disclosure, its application, or uses. Figure 1 Only one first server 101 , one terminal device 102 and one second server 103 are shown, but this does not mean to limit the respective numbers. The implementation environment may include multiple first servers 101 , multiple terminal devices 102 , and multiple second servers 103 .
[0041] In order to efficiently and accurately update the test environment configuration of different test environments of the software system, the present disclosure provides a configuration update method. Figure 2 , which is a flow chart of a configuration update method provided by an embodiment of the present disclosure. The method can be applied to an electronic device, the electronic device can be a server, the server can be a physical server, or can also be a virtual server, for example, Figure 1 The first server 101 is shown; of course, with the continuous advancement of technology, the electronic device may also be a terminal device, and the terminal device may be, for example, a mobile phone, a tablet computer, or other device, which is not specifically limited here.
[0042] like Figure 2 As shown, the configuration update method provided by the embodiment of the present disclosure may include the following steps S201-S203, which are described in detail below.
[0043] Step S201, obtaining a first configuration file for updating the test environment configuration of the software system; and, step S202, obtaining a second configuration file to be updated, wherein the second configuration file is used to configure the test environment configuration of the test environment corresponding to the software system, and the first configuration file and the second configuration file each include at least one configuration item in a key-value pair format, and the key-value pair has a configuration parameter as a key and a parameter value of the configuration parameter as a value.
[0044] In the embodiments of the present disclosure, a configuration file refers to a test environment configuration file used to configure a test environment corresponding to a software system. The configuration file may include at least one configuration item, and a configuration parameter in each configuration item corresponds to a configuration in the test environment configuration. The configuration item may be in a key-value pair format, and a preset symbol may be used to separate the configuration parameter value and the corresponding parameter value. The preset symbol may be, for example, "=".
[0045] For example, for the connection configuration of the business database in the test environment, it can be configured through the configuration item in the key-value pair format "dbconnect=url@user:password", where in this configuration item, the configuration parameter "dbconnect" indicates the configuration for connecting to the business database, and the parameter value "url@user:password" represents the connection address and connection password of the business database.
[0046] The first configuration file may be a configuration file acquired by the electronic device and used to update the test environment configuration of the software system, that is, a configuration file used to update the test environment configuration of all or part of the multiple test environments corresponding to the software system.
[0047] The second configuration file may be a configuration file of a test environment acquired by the electronic device and whose test environment configuration is to be updated.
[0048] In the disclosed embodiment, the first configuration file can be uploaded to the electronic device by the user, and the second configuration file can trigger the electronic device to obtain the second configuration file from the corresponding test environment by the user specifying the test environment; or, the user can pre-configure a storage area for temporarily storing files, and when the configuration of the test environment needs to be updated, the user places the file information of the first configuration file and the second configuration file to be updated in the storage area, and the electronic device can regularly detect whether the content in the storage area has changed according to a preset time interval, and if it has changed, the first configuration file is obtained from the storage area and the second configuration file is automatically obtained according to the file information. Of course, in actual implementation, the first configuration file and the second configuration file can also be obtained by other means, which are not specifically limited here.
[0049] Step S203: compare the configuration parameters in the configuration items of the first configuration file with the configuration parameters in the configuration items of the second configuration file, and update the second configuration file according to the comparison result.
[0050] That is, after the electronic device obtains the first configuration file and the second configuration file, since the configuration items in the first configuration file and the second configuration file are both in the key-value pair format, the electronic device can compare the configuration parameters in the configuration items of the two configuration files and update the second configuration file according to the comparison result. That is, using the configuration parameters in the configuration items of the first configuration file as the key (KEY), query whether there is a consistent key in the configuration parameters in the configuration items of the second configuration file, and if there is, update the corresponding parameter value; through this method, the electronic device can efficiently and accurately update the second configuration file without manual intervention, and then complete the update of the test environment configuration corresponding to the second configuration file.
[0051] Please see Figure 3 , which is a flowchart of the first update process provided by the embodiment of the present disclosure. Figure 3 As shown, in some embodiments, the above-mentioned step S203 of comparing the configuration parameters in the configuration items of the first configuration file with the configuration parameters in the configuration items of the second configuration file, and updating the second configuration file according to the comparison result, includes: step S301, comparing the configuration parameters of each configuration item in the first configuration file with the configuration parameters of the configuration items in the second configuration file; if the parameter values of the configuration parameters in the configuration items of the first configuration file are inconsistent with the configuration parameters in the corresponding configuration items of the second configuration file, executing step S302, updating the parameter values of the corresponding configuration items in the second configuration file according to the parameter values of the configuration parameters in the first configuration file.
[0052] For example, if the first configuration file includes configuration item 11 "B=2", and the second configuration file includes configuration item 21 "B=1", configuration item 22 "C=3" and configuration item 23 "D=4" respectively; the configuration parameter "B" in configuration item 11 can be used as a key and compared with the configuration parameters in the configuration items of the second configuration file one by one, then the configuration parameters in configuration item 21 can be matched, and the parameter values of the two are different. At this time, the parameter value "2" in configuration item 11 can be updated to configuration item 21, and the content of the updated second configuration file can be configuration item 21 "B=2", configuration item 22 "C=3" and configuration item 23 "D=4".
[0053] Please continue to see Figure 3 In some embodiments, the above step S203 of comparing the configuration parameters in the configuration items of the first configuration file with the configuration parameters in the configuration items of the second configuration file, and updating the second configuration file according to the comparison result, also includes: if the configuration parameters in the configuration items of the first configuration file do not exist in the second configuration file, executing step S303 to add the configuration item to the preset position of the second configuration file.
[0054] That is, if a configuration parameter of a configuration item of the first configuration file does not exist in the second configuration file, it means that the configuration item is a newly added configuration item. In this case, the configuration item can be directly added to the second configuration file.
[0055] In the embodiment of the present disclosure, the preset position may be the end of the second configuration file, that is, to facilitate the tester to confirm the newly added configuration, the newly added configuration item may be directly added to the end of the second configuration file; of course, the preset position may also be other positions, for example, it may also be the first position of the second configuration file, and no special limitation is made here.
[0056] For example, the first configuration file may also include configuration item 12 "A=1". After the configuration parameter "B" in the second configuration file is updated through the above update, "A" can be used as a key to compare the configuration parameters in the configuration items of the second configuration file one by one. If no comparison is found, the entire configuration item 12 can be added to the end of the second configuration file. The updated second configuration file can then be configuration item 21 "B=2", configuration item 22 "C=3", configuration item 23 "D=4" and configuration item 24 "A=1".
[0057] According to the above description, in the configuration update method provided in the embodiment of the present disclosure, when the electronic device obtains the first configuration file and the second configuration file, it can efficiently and accurately update the second configuration file based on the comparison result by comparing the configuration parameters in the configuration items of the first configuration file with the configuration parameters in the configuration items of the second configuration file, and then update the test environment configuration corresponding to the second configuration file.
[0058] It should be noted that, in some embodiments, the configuration items in the first configuration file, that is, the configuration file for updating the test environment configuration of the software system, may all be incremental configuration items, and the incremental configuration items include newly added configuration items and / or configuration items with changed parameter values; that is, considering that there are many configuration items in the existing second configuration file to be updated in the test environment and not every configuration item may change, therefore, in order to improve the configuration update speed, the configuration items in the first configuration file may not include historical configuration items that have not changed, but only include incremental configuration items such as newly added configuration items and / or configuration items with changed parameter values; in this implementation manner, if Figure 4 As shown, the method of obtaining the first configuration file for updating the test environment configuration of the software system described in the above step S201 includes: step S401, displaying a configuration interface for configuring at least the first configuration file; and step S402, receiving the first configuration file configured in the configuration interface, wherein the configuration items in the first configuration file are all incremental configuration items, and the incremental configuration items include newly added configuration items and / or configuration items with changed parameter values.
[0059] Please see Figure 5 , which is a schematic diagram of the configuration interface provided by the embodiment of the present disclosure. Figure 5 As shown, in the configuration interface, the user can open the file upload dialog box by pressing the "Select File" button, and upload the first configuration file provided by the developer to the electronic device.
[0060] In addition, if Figure 5 As shown, the configuration interface can also be used to configure the test environment to be updated. In this embodiment, Figure 6As shown, the acquisition of the second configuration file to be updated described in the above step S202 may include the following steps: step S601, receiving the environment identifier of the configured test environment; step S602, obtaining the second configuration file from the test environment through the corresponding configuration file acquisition interface according to the environment identifier.
[0061] The environment identifier may be a data identifier used to uniquely identify a test environment corresponding to the software system.
[0062] The configuration file acquisition interface may be an application program interface that is pre-configured by a user in the electronic device and is used to acquire a configuration file in a corresponding test environment.
[0063] For example, for a test environment whose service address is url1, the configuration file acquisition interface may be "url1 / getenvconf()"; of course, this is only an example, and the configuration file acquisition interface may also be in other forms, which is not specifically limited here.
[0064] like Figure 5 As shown, in this embodiment, after the user configures the first configuration file in the configuration interface, the user can receive the software system that needs to be updated based on the selection component corresponding to the "execution system" label in the configuration interface configuration, and then configure the test environment under the software system based on the selection component after the "execution environment" label. After that, the electronic device can obtain the environment identifier of the test environment to be updated based on the configuration result of the user on the configuration interface, and then use the corresponding configuration file acquisition interface to obtain the second configuration file according to the environment identifier.
[0065] It should be noted that in the embodiments of the present disclosure, the configuration interface can be constructed by a progressive JavaScript framework for building interfaces, such as Vue.js, and the components in the configuration interface, such as the "select file" button, the components for selecting the execution system and the execution environment, can be the multi-select drop-down components in the Element component library; of course, with the continuous advancement of technology, in actual implementation, the configuration interface can also be constructed based on other frameworks and component libraries, and no special limitation is made here.
[0066] The above describes how to obtain the first configuration file and the second configuration file in the embodiment of the present disclosure. It should be noted that, considering that the same software system may have multiple test environments, in this case, if the user is required to select the test environment to be updated one by one in the user interface, the user experience may be poor.
[0067] To solve this problem, in some embodiments, the first configuration file may include a coding version identifier of the test environment corresponding to the first configuration file, and the coding version identifier is used to identify the coding version of the software system in the test environment; after the electronic device obtains the first configuration file, the obtaining of the second configuration file to be updated described in the above step S202 may include: according to the coding version identifier in the first configuration file, displaying at least one candidate test environment in the configuration interface, the candidate test environment is the corresponding test environment under the software system corresponding to the coding version identifier; receiving a target environment identifier of a target test environment configured based on at least one candidate test environment; and according to the target environment identifier, obtaining the second configuration file from the target test environment through the corresponding configuration file acquisition interface.
[0068] That is, after obtaining the first configuration file, the electronic device selects a software system corresponding to the coding version identifier and at least one test environment under the software system from all test environments as candidate test environments based on the coding version identifier contained therein. Afterwards, in the configuration interface, the candidate test environment can be selected by default for user reference to increase the speed at which users configure the test environment and improve user experience.
[0069] In the embodiment of the present disclosure, the number of the second configuration files can be multiple, that is, the user can Figure 5 The user interface shown selects multiple test environments to be updated at the same time, thereby obtaining multiple second configuration files; in this embodiment, the configuration parameters in the configuration items of the first configuration file are compared with the configuration parameters in the configuration items of the second configuration file in the above step S203, and the second configuration file is updated according to the comparison result, including: according to the first configuration file, multiple second configuration files are updated in a preset order.
[0070] That is, when there are multiple second configuration files, the electronic device can iteratively update the multiple second configuration files. During the iteration process, a second configuration file can be randomly or sequentially obtained for processing; however, considering that there are many second configuration files to be updated and some test environments may need to update the configuration immediately for testing, the user can also set a priority for the test environment of the same software system in advance. When the priority is set, the electronic device can sort each second configuration file according to its priority and update the corresponding second configuration file in sequence according to the urgency of the priority.
[0071] After the update process of the second configuration file is completed through any one or more of the above embodiments, since the second configuration file is acquired by the electronic device locally for update processing, after the update is completed, the second configuration file needs to be sent to its corresponding test environment according to the update result, that is, Figure 7As shown, in some embodiments, after the second configuration file is updated, the method further includes: step S701, obtaining the update result of the second configuration file; when the update result indicates that the update is successful, executing step S702, sending the second configuration file to the corresponding test environment; and, when the update result indicates that the update fails, executing step S703, obtaining the corresponding update log, and generating an update failure report based on the update log.
[0072] The update log is an execution log generated by the electronic device during the file comparison process.
[0073] That is, in the embodiment of the present disclosure, if the electronic device successfully completes the update of the second configuration file, it can return an update result indicating whether the update is successful or failed. In addition, in order to facilitate the user to view the update result, it can also be displayed in Figure 4 The update result is displayed on the configuration interface shown; if the update fails, in order to facilitate user troubleshooting, the electronic device can generate an update failure report based on the update log. The update failure report may include abnormal logs that caused the update failure, such as comparison failure, service abnormality, configuration file content error and other log information.
[0074] In summary, according to the configuration update method provided by the embodiments of the present disclosure, after the electronic device obtains the first configuration file and the second configuration file, it is possible to compare the configuration parameters in the configuration items of the first configuration file with the configuration parameters in the configuration items of the second configuration file without the need for manual participation. Instead, the second configuration file can be automatically updated based on the first configuration file according to the comparison result, thereby reducing the time cost and manpower cost of manually checking the configuration items and improving the updating efficiency of the configuration file; at the same time, since the electronic device automatically compares and updates the second configuration file, it can also improve the updating accuracy and reduce the time cost caused by configuration file update errors due to manual comparison errors, thereby reducing the time cost that may be caused by the need to spend a long time for subsequent investigation.
[0075] It can be understood that the above-mentioned various method embodiments mentioned in the present disclosure can be combined with each other to form a combined embodiment without violating the principle logic. Due to space limitations, the present disclosure will not repeat them. It can be understood by those skilled in the art that in the above-mentioned method of the specific implementation method, the specific execution order of each step should be determined according to its function and possible internal logic.
[0076] In addition, the present disclosure also provides a configuration update device, an electronic device, and a computer-readable storage medium, all of which can be used to implement any configuration update method provided by the present disclosure. The corresponding technical solutions and descriptions are referred to in the corresponding records of the method part and will not be repeated here.
[0077] Figure 8A block diagram of a configuration updating device provided in an embodiment of the present disclosure.
[0078] Reference Figure 8 The present disclosure provides a configuration update device which can be applied to an electronic device, for example, Figure 1 In the first server 101 shown, the configuration updating device 800 includes: a first obtaining unit 801 , a second obtaining unit 802 and an updating unit 803 .
[0079] The first acquisition unit 801 is used to acquire a first configuration file for updating the test environment configuration of the software system.
[0080] The second acquisition unit 802 is used to obtain a second configuration file to be updated, wherein the second configuration file is used to configure the test environment configuration of the test environment corresponding to the software system, and both the first configuration file and the second configuration file include at least one configuration item in a key-value pair format, and the key-value pair uses a configuration parameter as a key and a parameter value of the configuration parameter as a value.
[0081] The updating unit 803 is used to compare the configuration parameters in the configuration items of the first configuration file with the configuration parameters in the configuration items of the second configuration file, and update the second configuration file according to the comparison result.
[0082] In some embodiments, when the update unit 803 compares the configuration parameters in the configuration items of the first configuration file with the configuration parameters in the configuration items of the second configuration file and updates the second configuration file according to the comparison results, it can be used to: compare the configuration parameters of each configuration item in the first configuration file with the configuration parameters of the configuration items in the second configuration file; if the parameter values of the configuration parameters in the configuration items of the first configuration file are inconsistent with the parameter values of the configuration parameters in the corresponding configuration items of the second configuration file, update the parameter values of the corresponding configuration items in the second configuration file according to the parameter values of the configuration parameters in the first configuration file.
[0083] In some embodiments, when the update unit 803 compares the configuration parameters in the configuration items of the first configuration file with the configuration parameters in the configuration items of the second configuration file and updates the second configuration file according to the comparison result, it can also be used to: if the configuration parameters in the configuration items of the first configuration file do not exist in the second configuration file, add the configuration items to the preset position of the second configuration file.
[0084] In some embodiments, when acquiring a first configuration file for updating the test environment configuration of a software system, the first acquisition unit 801 can be used to: display a configuration interface for configuring at least the first configuration file; receive the first configuration file configured by the configuration interface, wherein the configuration items in the first configuration file are all incremental configuration items, and the incremental configuration items include newly added configuration items and / or configuration items whose parameter values have changed.
[0085] In some embodiments, the configuration interface is also used to configure the test environment of the test environment configuration to be updated; when acquiring the second configuration file to be updated, the second acquisition unit 802 can be used to: receive the environment identifier of the configured test environment; and obtain the second configuration file from the test environment through the corresponding configuration file acquisition interface according to the environment identifier.
[0086] In some embodiments, there are multiple second configuration files; when the update unit 803 compares the configuration parameters in the configuration items of the first configuration file with the configuration parameters in the configuration items of the second configuration file and updates the second configuration file according to the comparison result, it can be used to: update multiple second configuration files according to a preset order based on the first configuration file; wherein the preset order includes: the priority arrangement order of the multiple second configuration files; the priority of each second configuration file is pre-configured by the user.
[0087] In some embodiments, the device 800 also includes an update result processing unit, which is used to: obtain the update result of the second configuration file; when the update result indicates that the update is successful, send the second configuration file to the corresponding test environment; and, when the update result indicates that the update fails, obtain the corresponding update log and generate an update failure report based on the update log.
[0088] Fig. 9 A block diagram of an electronic device provided in an embodiment of the present disclosure.
[0089] Reference Fig. 9 An embodiment of the present disclosure provides an electronic device, which includes: at least one processor 901; at least one memory 902, and one or more I / O interfaces 903, connected between the processor 901 and the memory 902; wherein the memory 902 stores one or more computer programs that can be executed by the at least one processor 901, and the one or more computer programs are executed by the at least one processor 901 so that the at least one processor 901 can execute the above-mentioned configuration update method.
[0090] The present disclosure also provides a computer-readable storage medium on which a computer program is stored, wherein the computer program implements the above configuration update method when executed by a processor. The computer-readable storage medium may be a volatile or non-volatile computer-readable storage medium.
[0091] The embodiment of the present disclosure also provides a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above-mentioned configuration update method.
[0092] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable storage medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium).
[0093] As is known to those of ordinary skill in the art, the term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable program instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technology, portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. In addition, it is known to those of ordinary skill in the art that communication media typically contain computer-readable program instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium.
[0094] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0095] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0096] The computer program product described herein may be implemented in hardware, software, or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK), etc.
[0097] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0098] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0099] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0100] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0101] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly noted, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.
Claims
1. A configuration update method, characterized in that: include: Acquire a first configuration file for updating a test environment configuration of a software system, wherein the first configuration file includes a coding version identifier, and the coding version identifier is used to identify a coding version of the software system in the test environment; Acquire multiple second configuration files to be updated, wherein the second configuration files are used to configure the test environment configuration of the test environment corresponding to the software system, the multiple second configuration files are obtained by selecting multiple test environments to be updated in a configuration interface, and the first configuration file and the second configuration file each include at least one configuration item in a key-value pair format, wherein the key-value pair uses a configuration parameter as a key and a parameter value of the configuration parameter as a value; Comparing the configuration parameters in the configuration items of the first configuration file with the configuration parameters in the configuration items of the plurality of second configuration files in a preset order, and updating the plurality of second configuration files according to the comparison results; Among them, the obtaining of multiple second configuration files to be updated includes: according to the coding version identifier, displaying multiple candidate test environments under the software system corresponding to the coding version identifier in the configuration interface; receiving the target environment identifier of the target test environment configured based on the multiple candidate test environments; according to the target environment identifier, obtaining the second configuration file from the target test environment through the corresponding configuration file acquisition interface.
2. The method according to claim 1, characterized in that The comparing the configuration parameters in the configuration items of the first configuration file with the configuration parameters in the configuration items of the second configuration file, and updating the second configuration file according to the comparison result, includes: Comparing the configuration parameters of each configuration item in the first configuration file with the configuration parameters of the configuration items in the second configuration file; If the parameter values of the configuration parameters in the configuration items of the first configuration file are inconsistent with the parameter values of the configuration parameters in the corresponding configuration items of the second configuration file, the parameter values of the corresponding configuration items in the second configuration file are updated according to the parameter values of the configuration parameters in the first configuration file.
3. The method according to claim 2, characterized in that The comparing the configuration parameters in the configuration items of the first configuration file with the configuration parameters in the configuration items of the second configuration file, and updating the second configuration file according to the comparison result, further includes: If the configuration parameter in the configuration item of the first configuration file does not exist in the second configuration file, the configuration item is added to a preset position of the second configuration file.
4. The method according to claim 1, characterized in that: The obtaining of a first configuration file for updating the test environment configuration of the software system includes: Displaying a configuration interface at least for configuring the first configuration file; Receive the first configuration file configured in the configuration interface; Among them, the configuration items in the first configuration file are all incremental configuration items, and the incremental configuration items include newly added configuration items and / or configuration items with changed parameter values.
5. The method according to claim 4, characterized in that The configuration interface is also used to configure the test environment whose test environment configuration is to be updated.
6. The method according to claim 1, characterized in that The preset order includes: the priority arrangement order of the plurality of second configuration files; the priority of each second configuration file is obtained by pre-configuration by the user.
7. The method according to any one of claims 1 to 6, characterized in that: After updating the second configuration file, the method further includes: Obtaining an update result of the second configuration file; When the update result indicates that the update is successful, sending the second configuration file to the corresponding test environment; When the update result indicates that the update fails, a corresponding update log is obtained, and an update failure report is generated according to the update log.
8. A configuration updating device, characterized in that: include: A first acquisition unit, configured to acquire a first configuration file for updating a test environment configuration of a software system, wherein the first configuration file includes a coding version identifier, and the coding version identifier is used to identify a coding version of the software system in the test environment; a second acquisition unit, configured to acquire a plurality of second configuration files to be updated, wherein the second configuration files are used to configure a test environment configuration of a test environment corresponding to the software system, the plurality of second configuration files are obtained by selecting a plurality of test environments to be updated in a configuration interface, and the first configuration file and the second configuration file each include at least one configuration item in a key-value pair format, wherein the key-value pair uses a configuration parameter as a key and uses a parameter value of the configuration parameter as a value; An updating unit, configured to compare, in a preset order, configuration parameters in the configuration items of the first configuration file with configuration parameters in the configuration items of the plurality of second configuration files, and update the plurality of second configuration files according to the comparison result; Among them, the obtaining of multiple second configuration files to be updated includes: according to the coding version identifier, displaying multiple candidate test environments under the software system corresponding to the coding version identifier in the configuration interface; receiving the target environment identifier of the target test environment configured based on the multiple candidate test environments; according to the target environment identifier, obtaining the second configuration file from the target test environment through the corresponding configuration file acquisition interface.
9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores one or more computer programs executable by the at least one processor, and the one or more computer programs are executed by the at least one processor to enable the at least one processor to perform the configuration updating method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the configuration updating method according to any one of claims 1 to 7.
