Mirror image label updating method and device, equipment and storage medium
By building candidate indexes and automatically detecting image version updates in the target distributed warehouse, the problems of inefficiency and error-prone traditional image tag updates are solved, and efficient and accurate image tag updates are achieved.
Patent Information
- Application Number
- CN202411684858.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-14
AI Technical Summary
Traditional mirror tag update methods are inefficient and error-prone, especially when dealing with large deployments or frequent updates.
Automatically update the target image tag by building candidate indexes in the target distributed repository, automatically detecting image version updates, and intelligently matching configuration files that need to be updated.
Improves the efficiency and accuracy of mirror tag updates, reduces the opportunity for manual intervention, and ensures smooth iteration of services.
Smart Images

Figure CN119621733A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of automobile engineering technology, in particular to the field of vehicle transmission system technology, and specifically to a mirror tag updating method, device, equipment and storage medium. Background Art
[0002] With the popularity of containerization technology, container orchestration platforms have become the mainstream platform for container orchestration and microservice architecture. In the container orchestration platform environment, the container instance group is the basic unit for running containers, and the deployment object is a high-level application programming interface object that manages the life cycle and replicas of the container instance group. It contains the labels of the container image, which are used to specify the container image version used for deployment. With the iteration of software development, container images need to be updated frequently to include the latest features or fixes. In the workflow of continuous integration and continuous deployment, quickly and accurately updating the image label in the deployment object configuration file is the key to ensuring smooth iteration of services.
[0003] However, traditional update methods usually require manual modification of configuration files or rely on external continuous integration and continuous deployment systems to automate the process. These methods are often inefficient and error-prone when dealing with large-scale deployments or frequent updates. Summary of the invention
[0004] The present application provides a mirror tag update method, apparatus, device and storage medium to improve the efficiency and accuracy of mirror tag update.
[0005] According to one aspect of the present application, a method for updating an image tag is provided, the method comprising:
[0006] Determine, according to current configuration data and a current image tag of a configuration file in a target distributed repository, a candidate index between the current configuration data and the current image tag;
[0007] When an image version update is identified in the image repository associated with the target distributed repository, obtaining a candidate image tag of the updated image version, and determining a target index corresponding to the updated image version from the candidate index;
[0008] If the candidate image tag and the target index satisfy an image tag update condition, the target image tag in the target index is updated.
[0009] According to another aspect of the present application, a mirror tag updating device is provided, the device comprising:
[0010] An index building module, configured to determine a candidate index between the current configuration data and the current image tag according to the current configuration data and the current image tag of the configuration file in the target distributed warehouse;
[0011] An index determination module, configured to, when an image version update is identified in the image repository associated with the target distributed repository, obtain a candidate image tag for the updated image version, and determine a target index corresponding to the updated image version from the candidate index;
[0012] The tag updating module is configured to update the target image tag in the target index if the candidate image tag and the target index meet the image tag updating condition.
[0013] According to another aspect of the present application, an electronic device is provided, the electronic device comprising:
[0014] one or more processors;
[0015] A memory for storing one or more programs;
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement any one of the image tag updating methods provided in the embodiments of the present application.
[0017] According to another aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, any image tag updating method provided in the embodiments of the present application is implemented.
[0018] This application determines the candidate index between the current configuration data and the current image tag according to the current configuration data and the current image tag of the configuration file in the target distributed warehouse; when an image version update is identified in the image warehouse associated with the target distributed warehouse, the candidate image tag of the updated image version is obtained, and the target index corresponding to the updated image version is determined from the candidate index; if the candidate image tag and the target index meet the image tag update conditions, the target image tag in the target index is updated. The above technical solution improves the efficiency and accuracy of image tag updates through automatic index and image version detection and intelligent matching of configuration files that need to be updated. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 This is a flowchart of a method for updating an image tag according to Embodiment 1 of the present application;
[0020] Figure 2 This is a flowchart of a method for updating an image tag according to Embodiment 2 of the present application;
[0021] Figure 3 It is a structural diagram of a mirror label updating device provided according to the third embodiment of the present application;
[0022] Figure 4 It is a structural schematic diagram of an electronic device that implements the mirror tag updating method of an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] In addition, it should be noted that in the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of relevant data such as current configuration data and current image tags involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0026] Embodiment 1
[0027] Figure 1 This is a flowchart of an image tag update method provided according to the first embodiment of the present application. This embodiment can be applied to the case of quickly updating the image tag of the container orchestration platform deployment configuration file in the distributed warehouse based on the file content index. It can be executed by an image tag update device. The image tag update device can be implemented in the form of hardware and / or software. The image tag update device can be configured in a computer device, such as a server. Figure 1 As shown, the method includes:
[0028] S110: Determine a candidate index between the current configuration data and the current image tag according to the current configuration data and the current image tag of the configuration file in the target distributed warehouse.
[0029] Among them, the target distributed warehouse refers to a place where a distributed version control system is used to manage project code and files; it not only stores the code files of the project, but also records all the change history, version control information, branches, tags and other contents; exemplary, the target distributed warehouse can include two types of local warehouses and remote warehouses. Configuration files refer to files used to describe how to deploy applications in a production environment, and define the container image, resource restrictions, environment variables, services and other contents of the application. Current configuration data refers to the content of the current configuration file stored in the target distributed warehouse, which is usually a file used to define information such as application deployment, image version, resource configuration, and environment settings. Current image tag refers to the version tag of the image associated with the current configuration file; for example, the image tag may be v1.0, latest, etc., which is used to identify a specific version of the image; in the process of automated deployment, the image tag is used together with a specific deployment configuration file to ensure that the correct version of the application is deployed. Candidate index refers to a set of possible index entries automatically generated by comparing the current configuration data with the current image tag during the monitoring and management process; these entries may correspond to different image versions, configuration file paths or other related information; as a data structure, the candidate index helps to quickly match and find indexes related to configuration files and image tags.
[0030] Exemplarily, the configuration files of the container orchestration platform in the target distributed warehouse are scanned periodically, and the current image tag of each configuration file and the index of related configuration information are recorded or updated.
[0031] In an optional implementation, when it is identified that the current configuration file is changed, a changed image tag is determined according to the changed configuration file; and a candidate index between the changed image tag and the changed configuration data is determined according to the changed image tag and the changed configuration data of the changed configuration file.
[0032] Among them, changing the configuration file refers to the configuration file whose content has changed; possible changes include modifying environment variables, updating the port number of the service, adding or removing resource restrictions, changing the image version, etc.; these changes may affect the behavior of the application or how to deploy, manage and run the container. Changing the image tag refers to the version tag of the image that needs to be updated when the configuration file changes; for example, if the image version specified in the configuration file (such as myapp:v1.0) changes, the new image version tag may be myapp:v1.1 or other specific version numbers; the image tag is usually an identifier of the image version, which helps the system accurately obtain the required image version. Changing configuration data refers to changes in configuration data caused by changes in the configuration file; for example, the configuration file may modify the application's environment variables, dependent services, resource configuration, etc.; changing configuration data refers to these new or updated configuration information, which need to match the image tag in order to correctly deploy the application.
[0033] Exemplarily, the changes of the target distributed warehouse are monitored, and when the configuration file is added, modified and pushed to the target distributed warehouse, an index of the image tag and configuration file related information is automatically generated according to the content of the configuration file.
[0034] S120: When an image version update is identified in the image repository associated with the target distributed repository, a candidate image tag of the updated image version is obtained, and a target index corresponding to the updated image version is determined from the candidate indexes.
[0035] Among them, the image repository refers to a system or service used to store and manage container images; the container image is a file that contains the application and its dependencies, system libraries, configuration files, etc. required to run the container. Image version update means that the image version in the image repository has changed; the new version of the image may include new features, fixes, improvements or other changes; when the image version update is monitored, the system will automatically process it to ensure that the updated image version is consistent with the definition in the configuration file. Updated image version refers to the updated version of the container image.
[0036] In an optional implementation, by setting an event push mechanism or using a scheduled task to monitor the image repository related to the container orchestration platform, when a new image version is released, this change is automatically detected and the candidate image tag of the updated image version is recorded.
[0037] Among them, the event push mechanism refers to a mechanism that pushes event data to a specified uniform resource locator through a hypertext transfer protocol request. When a specific event occurs, the source system will actively send a hypertext transfer protocol request to the target system to notify it that a certain operation or change has occurred. A scheduled task refers to a task that is automatically executed at a specific time interval or according to a predetermined schedule; for example, the system automatically performs a certain operation every certain period of time (such as every hour or every day).
[0038] In another optional implementation, the user actively triggers the image version notification through the continuous integration and continuous deployment workflow; when the image version notification is identified, the candidate image tag of the updated image version is recorded.
[0039] Among them, continuous integration refers to a development practice that requires developers to frequently integrate code into the main branch; each time the code is submitted, the build and test process will be automatically triggered. Continuous deployment is a further extension of continuous delivery, which means automatically deploying each code version that passes all automated tests directly to the production environment.
[0040] S130: If the candidate image tag and the target index meet the image tag update condition, the target image tag in the target index is updated.
[0041] The image tag update condition is a condition that specifies whether the image tag in the target index should be updated, which may include that the image version is inconsistent with the configuration file version, some settings in the configuration file have changed and these changes require an update of the image version, and the new image version meets the requirements in the configuration file. The target image tag refers to the image tag recorded in the target index, which is the final tag corresponding to the configuration file and the image version; when updating the target index, the system will update the target image tag according to the current image version.
[0042] Exemplarily, by comparing the old and new image tags with the index information in the configuration file, the configuration file that needs to be updated is intelligently matched. Once the match is successful, the image tag in the configuration file is automatically indexed and updated, and the updated configuration file is pushed to the target distributed warehouse.
[0043] It can be understood that the intelligent matching mechanism ensures that only the configuration files that really need to be updated are updated, avoiding unnecessary waste of resources and potential risks.
[0044] In an optional implementation, after the target image tag in the target index is updated, the target configuration file after the image tag is updated is detected in real time; when an abnormal problem is identified in the target configuration file, the target configuration file is rolled back to restore the target image tag of the target configuration file to the version before the image tag was updated.
[0045] It is understandable that the setting of the rollback mechanism can provide security for the update of the image tag and help ensure the stability of the service.
[0046] The embodiment of the present application determines the candidate index between the current configuration data and the current image tag according to the current configuration data and the current image tag of the configuration file in the target distributed warehouse; when an image version update is identified in the image warehouse associated with the target distributed warehouse, the candidate image tag of the updated image version is obtained, and the target index corresponding to the updated image version is determined from the candidate index; if the candidate image tag and the target index meet the image tag update condition, the target image tag in the target index is updated. The above technical solution improves the efficiency and accuracy of image tag updates through automatic index and image version detection and intelligent matching of configuration files that need to be updated.
[0047] Embodiment 2
[0048] Figure 2 It is a flowchart of a method for updating an image tag according to the second embodiment of the present application. Based on the technical solutions of the above embodiments, this embodiment refines "if the candidate image tag and the target index meet the image tag update conditions, the target image tag in the target index is updated" into "intelligently matching the candidate image tag with the current image tag in the target index; wherein the intelligent matching includes version matching, timestamp matching, tag matching, hash value matching and rule-defined matching; if the intelligent matching passes, the target image tag in the target index is updated". It should be noted that for the parts not described in detail in the embodiments of the present application, please refer to the relevant descriptions of other embodiments. Figure 2 As shown, the method includes:
[0049] S210: Determine a candidate index between the current configuration data and the current image tag according to the current configuration data and the current image tag of the configuration file in the target distributed warehouse.
[0050] S220: When an image version update is identified in the image repository associated with the target distributed repository, a candidate image tag of the updated image version is obtained, and a target index corresponding to the updated image version is determined from the candidate indexes.
[0051] S230. Intelligently match the candidate image tag with the current image tag in the target index; wherein the intelligent matching includes version matching, timestamp matching, tag matching, hash value matching, and rule-defined matching.
[0052] Among them, version matching refers to matching based on the version number of the image. Usually, the version number is defined according to specific semantic version control rules, such as v1.0.0, v1.1.0, v2.0.0, etc.; smart matching compares the version number of the candidate image with the version number of the current image tag to select the image that best meets the requirements. Timestamp matching refers to selecting the image version based on the timestamp of image creation or upload. Each image usually has a timestamp associated with it, indicating the time when the image was created or uploaded; smart matching determines which image version is more suitable based on the order of timestamps. Tag matching refers to matching based on the name or format of the image tag; in image management, tags are usually used to identify different versions or different environments of the image, such as latest, stable, dev, etc.; smart matching selects the most suitable image based on the name similarity or consistency between the target tag and the candidate tag. Hash value matching refers to matching image versions by calculating the hash value of the image content; each image has a unique hash value, which is the encrypted hash value of the image content (such as operating system, application, library, etc.); smart matching can determine whether the image content is consistent by comparing hash values, or select images with less content changes. Rule-defined matching refers to matching images according to specific rules defined by users. Users can customize a set of matching rules, which may include version number ranges, operating system types of images, specific functional tags, etc.; rule-defined matching can flexibly adjust matching strategies based on specific business needs.
[0053] Exemplarily, taking version matching as an example, assuming that the current image tag is v1.0, and the candidate image tags include v1.1 and v2.0, version matching will give priority to v1.1 because it is a newer version of the current version.
[0054] For example, taking timestamp matching as an example, if the timestamps of candidate images v1.0 and v1.1 are 2023-10-01 and 2023-11-01 respectively, the system will tend to select v1.1 because its timestamp is newer.
[0055] Exemplarily, taking tag matching as an example, if the candidate image tags include latest, stable, and v1.0, the system may select the stable or latest tag based on the requirements of the target image tag (for example, the latest stable version is required).
[0056] For example, taking hash value matching as an example, if the hash value of the candidate image is exactly the same as the hash value of the target image tag, then the image will be considered the same image and will not be updated. On the contrary, if the hash values are different, it may be updated to a new image version.
[0057] It is understandable that smart matching helps automate and optimize the selection of image versions in image management, ensuring that users can quickly and accurately select the most suitable image version. Each matching method (version, timestamp, tag, hash value, and custom rule) has its specific application scenario and can be flexibly combined according to actual needs to achieve the best image update effect.
[0058] S240: If the smart matching passes, the target image tag in the target index is updated.
[0059] Optionally, updating the target image tag in the target index may include determining an update method for the target image tag; the update method includes a replacement update and an incremental update; and updating the target image tag in the target index according to the update method and the candidate image tag.
[0060] The update method describes how to apply the new image version to the target image tag in the target index. Replacement update is a method of directly updating the target image tag, completely replacing the image content pointed to by the original image tag with the new image version. Incremental update means gradually updating or adding new content based on the original image tag, usually a minor modification or patch update, rather than a complete replacement.
[0061] Furthermore, if the update mode is replacement update, the target image tag is replaced with the candidate image tag; if the update mode is incremental update, the target image tag and the candidate image tag are stored in the target index in order of timestamp to form a target image tag set.
[0062] The embodiment of the present application determines the candidate index between the current configuration data and the current image tag according to the current configuration data and the current image tag of the configuration file in the target distributed warehouse; when an image version update is identified in the image warehouse associated with the target distributed warehouse, the candidate image tag of the updated image version is obtained, and the target index corresponding to the updated image version is determined from the candidate index; the candidate image tag is intelligently matched with the current image tag in the target index; wherein the intelligent matching includes version matching, timestamp matching, label matching, hash value matching and rule-defined matching; if the intelligent matching passes, the target image tag in the target index is updated. The above technical solution improves the efficiency and accuracy of image tag updates through automated index and image version detection and intelligent matching of configuration files that need to be updated.
[0063] Embodiment 3
[0064] Figure 3This is a structural diagram of an image tag updating device provided according to the third embodiment of the present application, which can be applied to the situation where the image tag of the container orchestration platform deployment configuration file in the distributed warehouse is quickly updated based on the file content index. The image tag updating device can be implemented in the form of hardware and / or software. The image tag updating device can be configured in a computer device, such as a server. Figure 3 As shown, the device comprises:
[0065] An index building module 310, configured to determine a candidate index between the current configuration data and the current image tag according to the current configuration data and the current image tag of the configuration file in the target distributed warehouse;
[0066] The index determination module 320 is used to obtain a candidate image tag of the updated image version when an image version update is identified in the image repository associated with the target distributed repository, and determine a target index corresponding to the updated image version from the candidate index;
[0067] The tag updating module 330 is configured to update the target image tag in the target index if the candidate image tag and the target index meet the image tag updating condition.
[0068] The embodiment of the present application determines the candidate index between the current configuration data and the current image tag according to the current configuration data and the current image tag of the configuration file in the target distributed warehouse; when an image version update is identified in the image warehouse associated with the target distributed warehouse, the candidate image tag of the updated image version is obtained, and the target index corresponding to the updated image version is determined from the candidate index; if the candidate image tag and the target index meet the image tag update condition, the target image tag in the target index is updated. The above technical solution improves the efficiency and accuracy of image tag updates through automatic index and image version detection and intelligent matching of configuration files that need to be updated.
[0069] Optionally, the label updating module 330 includes:
[0070] An intelligent matching unit, used to intelligently match the candidate image tag with the current image tag in the target index; wherein the intelligent matching includes version matching, timestamp matching, tag matching, hash value matching and rule-defined matching;
[0071] The label update unit is used to update the target image label in the target index when the intelligent matching passes.
[0072] Optionally, the label updating unit includes:
[0073] A mode determination subunit is used to determine the update mode of the target image tag; the update mode includes replacement update and incremental update;
[0074] The tag updating subunit is used to update the target image tag in the target index according to the update mode and the candidate image tag.
[0075] Optional, label update subunit, specifically used to:
[0076] If the update method is replacement update, the target image tag is replaced with the candidate image tag;
[0077] If the update mode is incremental update, the target image tag and the candidate image tag are stored in the target index in order of timestamp to form a target image tag set.
[0078] Optionally, the index building module 310 is specifically configured to:
[0079] When it is identified that the current configuration file is changed, the image tag is changed according to the changed configuration file;
[0080] According to the changed image tag and the changed configuration data of the changed configuration file, a candidate index between the changed image tag and the changed configuration data is determined.
[0081] Optionally, the device further includes a label rollback module; the label rollback module is used to:
[0082] Real-time detection of target configuration files after image tags are updated;
[0083] When an abnormal problem is identified in the target configuration file, the target configuration file is rolled back to restore the target image tag of the target configuration file to the version before the image tag is updated.
[0084] The image tag updating device provided in the embodiment of the present application can execute the image tag updating method provided in any embodiment of the present application, and has the corresponding functional modules and beneficial effects of executing each image tag updating method.
[0085] Embodiment 4
[0086] Figure 44 is a schematic diagram of the structure of an electronic device 410 that implements the mirror tag update method of an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0087] like Figure 4 As shown, the electronic device 410 includes at least one processor 411, and a memory connected to the at least one processor 411 in communication, such as a read-only memory (ROM) 412, a random access memory (RAM) 413, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 411 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 412 or the computer program loaded from the storage unit 418 to the random access memory (RAM) 413. In RAM413, various programs and data required for the operation of the electronic device 410 can also be stored. The processor 411, ROM412 and RAM413 are connected to each other via a bus 414. An input / output (I / O) interface 415 is also connected to the bus 414.
[0088] Multiple components in the electronic device 410 are connected to the I / O interface 415, including: an input unit 416, such as a keyboard, a mouse, etc.; an output unit 417, such as various types of displays, speakers, etc.; a storage unit 418, such as a disk, an optical disk, etc.; and a communication unit 419, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 419 allows the electronic device 410 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0089] The processor 411 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 411 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 411 executes the various methods and processes described above, such as the image tag update method.
[0090] In some embodiments, the image tag update method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 418. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 410 via the ROM 412 and / or the communication unit 419. When the computer program is loaded into the RAM 413 and executed by the processor 411, one or more steps of the image tag update method described above may be performed. Alternatively, in other embodiments, the processor 411 may be configured as the image tag update method in any other appropriate manner (e.g., by means of firmware).
[0091] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0092] The computer programs for implementing the methods of the present application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable image tag update device, so that when the computer programs are executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer programs may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0093] In the context of the present application, a computer readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device or equipment. A computer readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer readable storage medium may be a machine readable signal medium. A more specific example of a machine readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0094] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0095] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0096] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0097] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution of this application can be achieved, and this document is not limited here.
[0098] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. A method for updating an image tag, characterized in that: include: Determine, according to current configuration data and a current image tag of a configuration file in a target distributed repository, a candidate index between the current configuration data and the current image tag; When an image version update is identified in the image repository associated with the target distributed repository, obtaining a candidate image tag of the updated image version, and determining a target index corresponding to the updated image version from the candidate indexes; If the candidate image tag and the target index satisfy an image tag update condition, the target image tag in the target index is updated.
2. The method according to claim 1, characterized in that If the candidate image tag and the target index meet the image tag update condition, then updating the target image tag in the target index includes: Intelligently matching the candidate image tag with the current image tag in the target index; wherein the intelligent matching includes version matching, timestamp matching, tag matching, hash value matching and rule-defined matching; When the smart matching passes, the target image tag in the target index is updated.
3. The method according to claim 2, characterized in that The target image tag in the target index is updated, including: Determine an update method for the target image tag; the update method includes replacement update and incremental update; According to the update mode and the candidate image tag, the target image tag in the target index is updated.
4. The method according to claim 3, characterized in that: The updating of the target image tag in the target index according to the update mode and the candidate image tag includes: If the update mode is replacement update, the target image tag is replaced with the candidate image tag; If the update mode is incremental update, the target image tag and the candidate image tag are stored in the target index in order of timestamps to form a target image tag set.
5. The method according to claim 1, characterized in that The step of determining, according to the current configuration data and the current image tag of the configuration file in the target distributed repository, a candidate index between the current configuration data and the current image tag comprises: When it is identified that the current configuration file is changed, the image tag is changed according to the changed configuration file; According to the changed image tag and the changed configuration data of the changed configuration file, a candidate index between the changed image tag and the changed configuration data is determined.
6. The method according to claim 1, characterized in that After updating the target image tag in the target index, the method further includes: Real-time detection of target configuration files after image tags are updated; When it is identified that an abnormal problem occurs in the target configuration file, the target configuration file is rolled back to restore the target image tag of the target configuration file to a version before the image tag is updated.
7. A mirror label updating device, characterized in that: include: An index building module, configured to determine a candidate index between the current configuration data and the current image tag according to the current configuration data and the current image tag of the configuration file in the target distributed warehouse; An index determination module, configured to, when an image version update is identified in the image repository associated with the target distributed repository, obtain a candidate image tag for the updated image version, and determine a target index corresponding to the updated image version from the candidate index; The tag updating module is configured to update the target image tag in the target index if the candidate image tag and the target index meet the image tag updating condition.
8. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the image tag updating method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the image tag updating method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the image tag updating method according to any one of claims 1 to 6 is implemented.