Apollo configuration modification method and device, electronic equipment and computer readable medium

CN116302208BActive Publication Date: 2026-10-20BEIJING XIANLAI HUYU NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310370870.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-07
Publication Date
2026-10-20
Estimated Expiration
2043-04-07

AI Technical Summary

Technical Problem

[0004]有鉴于此,本公开实施例提供了一种阿波罗配置修改方法、装置、电子设备和计算机可读介质,以解决现有技术中如何避免错误、提高开发效率、且方便溯源的问题

Benefits of technology

[0010]首先,基于阿波罗配置中心的相关配置数据,确定下载脚本;其次,控制上述下载脚本保存和转换上述相关配置数据,得到文件夹和元数据文件;然后,基于用户操作更新上述文件夹,得到目标文件夹;之后,控制上传脚本基于上述目标文件夹和上述元数据文件生成补丁文件;最后,基于上述补丁文件,更新上述元数据文件,得到目标元数据文件。本公开的实施例提供的方法可以减少出错率,提升便捷性,同时将阿波罗配置中心与Git版本控制系统相结合,使得用户可以利用Git追溯谁在什么时间对哪个配置文件做了什么修改,十分有益于和配置有关的问题排查。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116302208B_ABST
    Figure CN116302208B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of Apollo configuration management, and provides an Apollo configuration modification method and device, electronic equipment and a computer readable medium. The method comprises: determining a download script based on related configuration data of an Apollo configuration center; controlling the download script to save and convert the related configuration data to obtain a folder and a metadata file; updating the folder based on a user operation to obtain a target folder; controlling an upload script to generate a patch file based on the target folder and the metadata file; and updating the metadata file based on the patch file to obtain a target metadata file. The method can reduce the error rate and improve convenience, and combines the Apollo configuration center with the Git version control system, so that the user can use Git to trace who made what modification to which configuration file at what time, which is very helpful for troubleshooting configuration-related problems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of Apollo configuration management technology, and more particularly to Apollo configuration modification methods, apparatus, electronic devices, and computer-readable media. Background Technology

[0002] Apollo Configuration Center is a distributed configuration center developed by Ctrip's framework department. It can centrally manage the configurations of different application environments and clusters. After the configuration is modified, it can be pushed to the application in real time. It also has standardized permissions, process governance and other features, making it suitable for microservice configuration management scenarios.

[0003] The backend management interface provided by the Apollo Configuration Center is currently very inconvenient to use. It lacks or is inconvenient or incomplete in terms of functions such as syntax highlighting, syntax checking, text search, and version control. When developers, testers, product personnel, and operations personnel modify Apollo configurations, they often encounter problems such as cumbersome operations, syntax errors, and configuration errors, which seriously affect development efficiency and make it difficult to trace back. Summary of the Invention

[0004] In view of this, embodiments of the present disclosure provide an Apollo configuration modification method, apparatus, electronic device, and computer-readable medium to solve the problems in the prior art of how to avoid errors, improve development efficiency, and facilitate traceability.

[0005] A first aspect of this disclosure provides an Apollo configuration modification method, comprising: determining a download script based on relevant configuration data from the Apollo Configuration Center; controlling the download script to save and convert the relevant configuration data to obtain a folder and a metadata file; updating the folder based on user operations to obtain a target folder; controlling an upload script to generate a patch file based on the target folder and the metadata file; and updating the metadata file based on the patch file to obtain a target metadata file.

[0006] A second aspect of this disclosure provides an Apollo configuration modification apparatus, comprising: a download script generation unit configured to determine a download script based on relevant configuration data from the Apollo Configuration Center; a saving unit configured to control the download script to save and convert the relevant configuration data to obtain a folder and a metadata file; a folder updating unit configured to update the folder based on user operations to obtain a target folder; a patch file generation unit configured to control an upload script to generate a patch file based on the target folder and the metadata file; and a metadata file updating unit configured to update the metadata file based on the patch file to obtain a target metadata file.

[0007] A third aspect of this disclosure provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method described above.

[0008] A fourth aspect of this disclosure provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method.

[0009] The beneficial effects of the embodiments disclosed herein compared to the prior art are as follows:

[0010] First, based on the relevant configuration data from the Apollo Configuration Center, a download script is determined. Second, the download script is controlled to save and convert the relevant configuration data, resulting in a folder and a metadata file. Then, based on user operations, the folder is updated to obtain the target folder. Next, the upload script is controlled to generate a patch file based on the target folder and the metadata file. Finally, based on the patch file, the metadata file is updated to obtain the target metadata file. The method provided by this disclosure reduces the error rate and improves convenience. Furthermore, by combining the Apollo Configuration Center with the Git version control system, users can use Git to trace who made which modifications to which configuration file at what time, which is highly beneficial for troubleshooting configuration-related issues. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the embodiments of this disclosure, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 This is a schematic diagram illustrating an application scenario of the Apollo configuration modification method according to some embodiments of this disclosure;

[0013] Figure 2 This is a flowchart of some embodiments of the Apollo configuration modification method according to this disclosure;

[0014] Figure 3 These are flowcharts of other embodiments of the Apollo configuration modification method according to this disclosure;

[0015] Figure 4 This is a schematic diagram of the structure of some embodiments of the Apollo configuration modification device according to the present disclosure;

[0016] Figure 5This is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. Detailed Implementation

[0017] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0018] It should also be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings. Unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other.

[0019] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.

[0020] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0021] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0022] This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.

[0023] Figure 1 This is a schematic diagram illustrating an application scenario of the Apollo configuration modification method according to some embodiments of this disclosure.

[0024] exist Figure 1 In the application scenario, firstly, computing device 101 can determine download script 102 based on relevant configuration data from the Apollo configuration center. Secondly, computing device 101 can control the download script 102 to save and convert the relevant configuration data, obtaining folder 103 and metadata file 104. Then, computing device 101 can update folder 104 based on user operations, obtaining target folder 105. Afterwards, control the upload script to generate patch file 106 based on target folder 105 and metadata file 104. Finally, based on patch file 106, update metadata file 104, obtaining target metadata file 107.

[0025] It should be noted that the aforementioned computing device 101 can be either hardware or software. When the computing device 101 is hardware, it can be implemented as a distributed cluster consisting of multiple servers or terminal devices, or as a single server or a single terminal device. When the computing device 101 is software, it can be installed in the hardware devices listed above. It can be implemented as, for example, multiple software programs or software modules used to provide distributed services, or as a single software program or software module. No specific limitations are made here.

[0026] It should be understood that Figure 1 The number of computing devices shown is merely illustrative. Any number of computing devices can be used depending on implementation needs.

[0027] Figure 2 This is a flowchart of some embodiments of the Apollo configuration modification method according to this disclosure. Figure 2 The method for modifying the Apollo configuration can be found by Figure 1 The computing device 101 performs the operation. For example... Figure 2 As shown, the method for modifying the Apollo configuration includes:

[0028] Step S201: Based on the relevant configuration data from the Apollo Configuration Center, determine the download script.

[0029] In some embodiments, the download script is typically implemented using Python. Based on relevant configuration data from the Apollo Configuration Center, the download script is determined. Specifically, the relevant configuration data can be the data contained in all configuration files of a project within a specific environment and cluster, corresponding to all configuration files of that project in all namespaces within that environment and cluster. The download script is an executable program that runs on the command line. When called, parameters need to be specified, and the Apollo configuration for which project, environment, and cluster to download is determined based on these parameters. Here, the download script is determined based on the configuration file the user wants to modify. For example, if a user wants to modify a configuration file of project A in environment B and cluster C, the download script needs to download all the data contained in all configuration files of project A in environment B and cluster C (i.e., the relevant configuration data). Then, the user can use VSCode to find the configuration file they want to modify through directory tree browsing, keyword search, etc.

[0030] Step S202: Control the above download script to save and convert the above-mentioned configuration data to obtain folders and metadata files.

[0031] In some embodiments, the folder includes at least one configuration file, and the metadata file includes the content fingerprint corresponding to each of the at least one configuration file. Specifically, the folder may be a subfolder under a Git version control system, used to store all configuration files of a project in all namespaces of a cluster in a certain environment. The metadata file may be a JSON file under a Git version control system, used to store the content fingerprint of all configuration files of a project in all namespaces of a cluster in a certain environment. Further, the content fingerprint is generally generated using the MD5 algorithm, a widely used cryptographic hash function that produces a 128-bit hash value to ensure the integrity and consistency of information transmission. Here, the execution entity (e.g., computing device 101) can control the download script to synchronize the relevant configuration data of the Apollo configuration center to the local computer, and then convert it into the folder and the metadata file.

[0032] It should be noted that: the Git version control system mentioned above refers to an open-source distributed version control system that can effectively and quickly handle version management for projects ranging from very small to very large. It is also an open-source version control software developed by Linus Torvalds to help manage Linux kernel development. The Apollo Configuration Center mentioned above refers to a distributed configuration center developed by Ctrip's framework department. It can centrally manage the configurations of different application environments and clusters. After configuration changes are made, they can be pushed to the application in real time. It also has standardized permissions, process governance, and other features, making it suitable for microservice configuration management scenarios. The project mentioned above is a concept of the Apollo Configuration Center. A project can be associated with multiple environments and multiple clusters. A project can contain multiple namespaces. The properties type namespace is similar to a folder and can contain multiple configuration files. Other types of namespaces are similar to files and correspond to only a single configuration file. The environment mentioned above is a concept of the Apollo Configuration Center and is generally used to distinguish between testing and production purposes. The cluster mentioned above is a concept of the Apollo Configuration Center, and generally only the default cluster is used.

[0033] In some optional implementations of certain embodiments, after controlling the download script to save and transform the relevant configuration data to obtain the folder and metadata file, the method further includes: controlling the download script to commit the folder and metadata file to the Git version control system. Here, the commit may involve first committing the folder and metadata file on the local computer to the local Git repository, and then synchronizing it to the remote Git repository. Further, the synchronization to the remote Git repository is a function of the Git version control system itself, including pulling the commit history from the remote Git repository, merging it with the commit history of the local Git repository, and then pushing the merged commit history to the remote Git repository.

[0034] Step S203: Update the above folder based on user operation to obtain the target folder.

[0035] In some embodiments, the user can be a developer, tester, product manager, or operations manager related to the aforementioned projects. The user operation can be that the user updates the aforementioned folder on their local computer using the text editor VSCode. Specifically, updating the aforementioned folder can be updating the configuration file within the aforementioned folder to obtain the target folder.

[0036] It should be noted that the text editor VSCode mentioned above refers to a free source code editor developed by Microsoft, which supports syntax highlighting, intelligent code completion, code snippets, code refactoring, code comparison, code debugging, Git version control, and other functions for multiple programming languages.

[0037] In some optional implementations of certain embodiments, after updating the aforementioned folder based on user operations to obtain the target folder, the method further includes: controlling the upload script to synchronize the target folder to the Apollo configuration center. Here, the synchronization is performed using the login interface and CRUD (Create, Read, Update, Delete) interfaces provided by the Apollo configuration center to the Apollo backend management interface.

[0038] Step S204: The control upload script generates a patch file based on the target folder and the metadata file mentioned above.

[0039] In some embodiments, the patch file includes at least: configuration file addition records, configuration file modification records, and configuration file deletion records; the upload script is generally implemented using the Python scripting language; the user executes the upload script by clicking a button; the above button is generally configured on the VSCode status bar.

[0040] Step S205: Based on the patch file, update the metadata file to obtain the target metadata file.

[0041] In some embodiments, the metadata file is updated based on the patch file described above, and the updated metadata file is used as the target metadata file.

[0042] In some optional implementations of certain embodiments, after updating the metadata file based on the patch file to obtain the target metadata file, the method further includes: controlling the upload script to submit the target folder and the target metadata file to the Git version control system. Here, the submission refers to first submitting the target folder and the target metadata file on the local computer to the local Git repository, and then synchronizing them to the remote Git repository; the synchronization to the remote Git repository is a function of the Git version control system itself, including pulling the commit history of the remote Git repository, merging it with the commit history of the local Git repository, and then pushing the merged commit history to the remote Git repository.

[0043] The beneficial effects of the embodiments of this disclosure compared to the prior art are as follows:

[0044] First, based on the relevant configuration data in the Apollo Configuration Center, a download script is determined. Second, the download script is controlled to save and convert the relevant configuration data, resulting in a folder and a metadata file. Then, based on user operations, the folder is updated to obtain the target folder. Afterward, the upload script is controlled to generate a patch file based on the target folder and the metadata file. Finally, based on the patch file, the metadata file is updated to obtain the target metadata file. The method provided in this disclosure combines the Apollo Configuration Center with the VSCode text editor, allowing users to automatically access VSCode's syntax highlighting, syntax checking, and text search functions when modifying Apollo configurations. Compared to the backend management interface provided by the Apollo Configuration Center, these functions significantly reduce error rates and improve convenience, especially when managing a large number of configuration files. Furthermore, combining the Apollo Configuration Center with the Git version control system allows users to use Git to trace who made what modifications to which configuration file at what time, which is highly beneficial for troubleshooting configuration-related issues.

[0045] Figure 3 This is a flowchart of some other embodiments of the Apollo configuration modification method according to this disclosure. Figure 3 The method for modifying the Apollo configuration can be found by Figure 1 The computing device 101 performs the operation. For example... Figure 3 As shown, the method for modifying the Apollo configuration includes:

[0046] Step S301: Based on the relevant configuration data from the Apollo Configuration Center, determine the download script.

[0047] Step S302: Control the above download script to save and convert the above-mentioned configuration data to obtain folders and metadata files.

[0048] Step S303: Update the above folder based on user operation to obtain the target folder.

[0049] Step S304: The control upload script generates a patch file based on the target folder and the metadata file mentioned above.

[0050] In some embodiments, the specific implementation of steps S301-S304 and the resulting technical effects can be found in [reference needed]. Figure 2 Steps S201-S204 in the corresponding embodiments will not be described again here.

[0051] Step S305: Based on the above configuration file, add a new record and add the content fingerprint of the new configuration file corresponding to the new record.

[0052] In some embodiments, after determining that the patch file is a newly added record in the configuration file, the corresponding content fingerprint is added based on the newly added record in the configuration file to obtain the target metadata file.

[0053] Step S306: Based on the above configuration file modification records, update the content fingerprint of the modified configuration file corresponding to the above configuration file modification records.

[0054] In some embodiments, after determining that the patch file is a configuration file modification record, the corresponding content fingerprint is modified based on the configuration file modification record to obtain the target metadata file.

[0055] Step S307: Based on the above configuration file deletion record, delete the content fingerprint of the deleted configuration file corresponding to the above configuration file deletion record.

[0056] In some embodiments, after determining that the patch file is a configuration file deletion record, the corresponding content fingerprint is deleted based on the configuration file modification record to obtain the target metadata file.

[0057] The beneficial effects of the embodiments of this disclosure compared to the prior art are as follows:

[0058] First, based on the relevant configuration data in the Apollo Configuration Center, a download script is determined. Second, the download script is controlled to save and convert the relevant configuration data to obtain a folder and metadata file. Then, based on the newly added record in the configuration file, the content fingerprint of the newly added configuration file corresponding to the newly added record is added. Based on the newly added record in the configuration file, the content fingerprint of the newly added configuration file corresponding to the newly added record is added. Based on the deleted record in the configuration file, the content fingerprint of the deleted configuration file corresponding to the deleted record is deleted. The method provided by the embodiments of this disclosure can combine the Apollo Configuration Center with the text editor VSCode, so that when users modify the Apollo configuration, they automatically obtain VSCode's syntax highlighting, syntax checking, text search and other functions. Compared with the backend management interface provided by the Apollo Configuration Center, these functions are very helpful in reducing the error rate and improving convenience, especially when managing a large number of configuration files. Furthermore, the Apollo Configuration Center is integrated with the Git version control system, allowing users to use Git to trace who made what changes to which configuration file at what time. This is highly beneficial for troubleshooting configuration-related issues. At the same time, patch files are categorized, and metadata files are precisely updated based on the addition, modification, or deletion records of configuration files. Ultimately, the changes to the Apollo configuration are more accurate and traceable.

[0059] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.

[0060] The following are embodiments of the apparatus disclosed herein, which can be used to execute embodiments of the method disclosed herein. For details not disclosed in the apparatus embodiments of this disclosure, please refer to the embodiments of the method disclosed herein.

[0061] Figure 4 This is a schematic diagram of the structure of some embodiments of the Apollo configuration modification device according to this disclosure. As shown in Figure 4, the Apollo configuration modification device includes: a download script generation unit 401, a saving unit 402, a folder updating unit 403, a patch file generation unit 404, and a metadata file updating unit 405. The download script generation unit 401 is configured to determine a download script based on relevant configuration data from the Apollo configuration center; the saving unit 402 is configured to control the download script to save and convert the relevant configuration data to obtain a folder and a metadata file; the folder updating unit 403 is configured to update the folder based on user operations to obtain a target folder; the patch file generation unit 404 is configured to control the upload script to generate a patch file based on the target folder and the metadata file; and the metadata file updating unit 405 is configured to update the metadata file based on the patch file to obtain a target metadata file.

[0062] In some alternative implementations of certain embodiments, the Apollo modification device is further configured to control the download script to submit the folder and the metadata file to the Git version control system.

[0063] In some alternative implementations of some embodiments, the folder includes at least one configuration file, and the metadata file includes the content fingerprint corresponding to each of the at least one configuration file.

[0064] In some optional implementations of certain embodiments, the Apollo modification device is further configured to control the upload script to synchronize the target folder to the Apollo configuration center.

[0065] In some optional implementations of certain embodiments, the patch file mentioned above includes at least: configuration file addition records, configuration file modification records, and configuration file deletion records.

[0066] In some optional implementations of certain embodiments, the metadata file update unit 405 of the Apollo modification device is further configured to: add the content fingerprint of the newly added configuration file corresponding to the newly added configuration file record based on the newly added configuration file record; update the content fingerprint of the modified configuration file corresponding to the modified configuration file record based on the modified configuration file record; and delete the content fingerprint of the deleted configuration file corresponding to the deleted configuration file record based on the deleted configuration file record.

[0067] In some optional implementations of certain embodiments, the Apollo modification device is further configured to: control the upload script to submit the target folder and the target metadata file to the Git version control system.

[0068] The following is for reference. Figure 5 It illustrates electronic devices suitable for implementing some embodiments of this disclosure (e.g., Figure 1 A schematic diagram of the structure of the computing device 101)500. Figure 5 The server shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this disclosure.

[0069] like Figure 5As shown, the electronic device 500 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 408 into a random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the electronic device 500. The processing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0070] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic device 500 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 An electronic device 500 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively. Figure 5 Each box shown can represent a device or multiple devices as needed.

[0071] In particular, according to some embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, some embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 509, or installed from storage device 508, or installed from ROM 502. When the computer program is executed by processing device 501, it performs the functions defined in the methods of some embodiments of this disclosure.

[0072] It should be noted that, in some embodiments of this disclosure, the computer-readable medium described above may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In some embodiments of this disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In some embodiments of this disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0073] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0074] The aforementioned computer-readable medium may be included in the aforementioned device; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: determine a download script based on relevant configuration data from the Apollo Configuration Center; control the download script to save and convert the relevant configuration data to obtain a folder and metadata files; update the folder based on user operations to obtain a target folder; and control an upload script to generate a patch file based on the target folder and the metadata files.

[0075] Computer program code for performing operations of some embodiments of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can 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 can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0076] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0077] The units described in some embodiments of this disclosure can be implemented in software or hardware. The described units can also be housed in a processor. For example, a processor may be described as including a download script generation unit, a saving unit, a folder updating unit, a patch file generation unit, and a metadata file updating unit. The names of these units do not necessarily limit the specific unit itself; for example, the download script generation unit may also be described as "a unit that determines the download script based on relevant configuration data from the Apollo configuration center."

[0078] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0079] The above description is merely a selection of preferred embodiments of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.

Claims

1. A method for modifying Apollo configuration, characterized in that, include: Based on the relevant configuration data from the Apollo Configuration Center, the download script is determined; wherein, the relevant configuration data includes all configuration files of a certain project that the user wants to modify in a certain environment and a certain cluster. The download script is controlled to save and convert the relevant configuration data to obtain a folder and a metadata file; wherein, the folder includes at least one configuration file, and the metadata file includes the content fingerprint corresponding to each configuration file in the at least one configuration file; The target folder is obtained by updating the folder based on user actions. The script that controls the upload generates a patch file based on the target folder and the metadata file; Based on the patch file, update the metadata file to obtain the target metadata file; The download script controls the saving and conversion of the relevant configuration data, resulting in folders and metadata files, including: The download script controls the synchronization of relevant configuration data to the local computer, and then converts the synchronized configuration data into folders and metadata files.

2. The method as described in claim 1, characterized in that, After the download script is controlled to save and convert the relevant configuration data to obtain folders and metadata files, the method further includes: The download script is controlled to submit the folder and the metadata file to the Git version control system.

3. The method as described in claim 1, characterized in that, After updating the folder based on user actions to obtain the target folder, the method further includes: The upload script is controlled to synchronize the target folder to the Apollo configuration center.

4. The method as described in claim 3, characterized in that, The patch file includes at least: configuration file addition records, configuration file modification records, and configuration file deletion records.

5. The method as described in claim 4, characterized in that, The process of updating the metadata file based on the patch file to obtain the target metadata file includes: Based on the newly added record in the configuration file, add the content fingerprint of the newly added configuration file corresponding to the newly added record in the configuration file; Based on the configuration file modification record, update the content fingerprint of the modified configuration file corresponding to the configuration file modification record; Based on the configuration file deletion record, delete the content fingerprint of the deleted configuration file corresponding to the configuration file deletion record.

6. The method as described in claim 1, characterized in that, After updating the metadata file based on the patch file to obtain the target metadata file, the method further includes: The control upload script submits the target folder and the target metadata file to the Git version control system.

7. An Apollo configuration modification device, characterized in that, include: The download script generation unit is configured to determine the download script based on relevant configuration data from the Apollo Configuration Center; wherein, the relevant configuration data includes all configuration files of a certain project that the user wants to modify in a certain environment and a certain cluster. The storage unit is configured to control the download script to save and convert the relevant configuration data to obtain a folder and a metadata file; wherein the folder includes at least one configuration file, and the metadata file includes the content fingerprint corresponding to each of the at least one configuration file; The folder update unit is configured to update the folder based on user operations to obtain the target folder; The patch file generation unit is configured to control the upload script to generate patch files based on the target folder and the metadata file; The metadata file update unit is configured to update the metadata file based on the patch file to obtain the target metadata file; The storage unit is also configured to: control the download script to synchronize relevant configuration data to the local computer, and then convert the synchronized relevant configuration data into folders and metadata files.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Code updating method

    CN106250548A

  • Project publishing method, device and system, storage medium and electronic equipment

    CN113296796A