Mirror Upgrade Method and Device
By automatically detecting whether the shared image has been upgraded and copying the upgraded image file to the storage location of the associated image, the problem of cumbersome upgrade operation of the associated image is solved, and automatic upgrade is achieved, saving user operation time.
Patent Information
- Application Number
- CN202110062436.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-18
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2041-01-18
AI Technical Summary
In the system, when the shared image is upgraded, the upgrade operation of the associated image is cumbersome, and the user needs to set it manually, wasting user time.
Provide a mirror upgrade method and device, by automatically determining whether the shared image has been upgraded, and checking whether there is an associated image. If it exists, copy the upgraded image file to the storage location of the associated image to achieve automatic upgrade.
It simplifies user operations, saves user operation time, and realizes automatic upgrade of associated mirrors.
Smart Images

Figure CN113760349B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular, to a method and apparatus for mirror image upgrade. Background Art
[0002] A mirror image is to make a specific series of files into a single file according to a certain format, which can facilitate users to download and use. Mirror images are widely used in many systems, such as (Platform as a Service). In various systems, the same shared mirror image often corresponds to multiple associated mirror images. If the shared mirror image is upgraded, multiple associated mirror images of the shared mirror image often need to be manually set one by one by the user to complete the corresponding upgrade. The upgrade operation of the associated mirror image is cumbersome and wastes the user's time. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a method and apparatus for mirror image upgrade, which can automatically complete the upgrade operation of the associated mirror image.
[0004] In a first aspect, an embodiment of the present invention provides a method for mirror image upgrade, including:
[0005] Determine whether the shared mirror image has been upgraded;
[0006] If so, determine whether there is an associated mirror image associated with the shared mirror image;
[0007] If there is, determine the mirror image storage location and the target mirror image location, where the mirror image storage location stores the upgraded mirror image file of the shared mirror image, and the target mirror image location is the storage location of the associated mirror image;
[0008] Copy the upgraded mirror image file from the mirror image storage location to the target mirror image location to upgrade the associated mirror image.
[0009] Optionally, before determining whether the shared mirror image has been upgraded, it further includes:
[0010] Receive a mirror image sharing instruction, where the mirror image sharing instruction instructs to share the shared mirror image to the target mirror image location;
[0011] According to the mirror image sharing instruction, determine the source mirror image location and the target mirror image location of the shared mirror image;
[0012] Copy the mirror image file of the shared mirror image from the source mirror image location to the target mirror image location to generate the associated mirror image.
[0013] Optionally, before receiving the mirror image sharing instruction, it further includes:
[0014] Receive a mirror image search instruction;
[0015] In response to the mirror search instruction, display a mirror list, where the mirror list includes the shared mirror;
[0016] The receiving the mirror sharing instruction includes:
[0017] Receive a mirror sharing instruction issued for the mirror list.
[0018] Optionally, the receiving the mirror search instruction includes:
[0019] Receive a mirror search instruction, where the mirror search instruction includes at least one search keyword;
[0020] The responding to the mirror search instruction and displaying a mirror list includes:
[0021] Determine relevant mirrors corresponding to the mirror search instruction according to the search keyword;
[0022] Display the mirror list of the relevant mirrors.
[0023] Optionally, the determining relevant mirrors corresponding to the mirror search instruction according to the search keyword includes:
[0024] Obtain the keywords and / or descriptions of each alternative mirror;
[0025] Respectively determine the matching degrees between the keywords and / or descriptions of each alternative mirror and the search keyword;
[0026] Determine relevant mirrors corresponding to the mirror search instruction according to the matching degree.
[0027] Optionally, before determining the mirror storage location and the target mirror location, it further includes:
[0028] Obtain the upgrade attribute of the associated mirror;
[0029] Determine whether the associated mirror allows automatic update according to the upgrade attribute;
[0030] If so, execute the step of determining the mirror storage location and the target mirror location.
[0031] Optionally, the determining the mirror storage location includes:
[0032] Determine whether there are other associated mirrors that have completed the upgrade, and the other associated mirrors are associated with the shared mirror;
[0033] If there are, determine the mirror location of the other associated mirrors and the source mirror location of the shared mirror;
[0034] Determine the mirror storage location from the mirror locations of the other associated mirrors and the source mirror location.
[0035] Optionally, after determining whether there are other associated mirrors that have completed the upgrade and the other associated mirrors are associated with the shared mirror, it further includes:
[0036] If not, determine the source mirror location of the shared mirror;
[0037] Determine the source mirror location as the mirror storage location.
[0038] In a second aspect, an embodiment of the present invention provides a mirror upgrade device, including:
[0039] An upgrade determination module, configured to determine whether a shared mirror has been upgraded;
[0040] A mirror determination module, configured to, if so, determine whether there is an associated mirror associated with the shared mirror;
[0041] A location determination module, configured to, if there is, determine a mirror storage location and a target mirror location, where the mirror storage location stores the upgraded mirror file of the shared mirror, and the target mirror location is the storage location of the associated mirror;
[0042] A file copying module, configured to copy the upgraded mirror file from the mirror storage location to the target mirror location to upgrade the associated mirror.
[0043] In a third aspect, an embodiment of the present invention provides an electronic device, including:
[0044] One or more processors;
[0045] A storage device, configured to store one or more programs,
[0046] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any of the above embodiments.
[0047] In a fourth aspect, an embodiment of the present invention provides a computer-readable medium, on which a computer program is stored, and when the program is executed by a processor, it implements the method described in any of the above embodiments.
[0048] An embodiment of the above invention has the following advantages or beneficial effects: When the shared mirror has been upgraded, determine the associated mirror of the shared mirror and automatically upgrade the associated mirror. Compared with the method of manually upgrading the associated mirror by the user, it can simplify the user operation and save the user's operation time.
[0049] The further effects of the above-mentioned non-conventional optional methods will be described below in conjunction with specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The drawings are used to better understand the present invention and do not constitute an improper limitation to the present invention. Among them:
[0051] Figure 1 is an exemplary system architecture diagram to which the embodiments of the present invention can be applied;
[0052] Figure 2 is a schematic diagram of the process of a mirror sharing method provided by an embodiment of the present invention;
[0053] Figure 3 is a schematic diagram of the process of another mirror sharing method provided by an embodiment of the present invention;
[0054] Figure 4 is a schematic diagram of the process of a mirror upgrade method provided by an embodiment of the present invention;
[0055] Figure 5 is a schematic diagram of the process of another mirror upgrade method provided by an embodiment of the present invention;
[0056] Figure 6 is a schematic diagram of the process of a business mirror construction method provided by an embodiment of the present invention;
[0057] Figure 7 is a schematic diagram of the structure of a mirror upgrade device provided by an embodiment of the present invention;
[0058] Figure 8 is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing the embodiments of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0059] The following describes exemplary embodiments of the present invention in conjunction with the drawings. Various details of the embodiments of the present invention are included to facilitate understanding, and they should be considered 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 invention. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted below.
[0060] As Figure 1As shown in the figure, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for the terminal devices 101, 102, 103 to store communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0061] The terminal devices 101, 102, 103 may be mobile phones, laptops, tablets, laptop portable computers, servers, etc. The terminal devices 101, 102, 103 interact with the server 105 through the network 104 to receive or send messages, etc. The terminal devices 101, 102, 103 send the stored videos to the server 105 through the network 104.
[0062] A mirror repository is set up in the server 105, which stores various shared mirrors. Users can share the base mirror to the terminal devices 101, 102, 103 through a sharing instruction, and generate multiple associated mirrors associated with the shared mirror in the terminal devices 101, 102, 103. After the shared mirror in the server 105 is upgraded, the system can automatically perform corresponding upgrade processing on the associated mirrors in the terminal devices 101, 102, 103.
[0063] It should be noted that the mirror sharing method and mirror upgrade method provided by the embodiments of the present invention are generally executed by the server 105. Correspondingly, the mirror sharing device and mirror upgrade device are generally set in the server 105.
[0064] It should be understood that Figure 1 the numbers of terminal devices, networks, and servers in
[0065] are merely illustrative. According to the implementation requirements, there can be any number of terminal devices, networks, and servers.
[0066] When a user needs to share and use a base mirror made by others, they need to reconstruct the base mirror using the same mirror file. Then use a command to push the target mirror to the specified system in the specified mirror repository. This method of sharing mirrors has a high time cost and requires obtaining corresponding operation permissions, with a high security risk. Figure 2 is a schematic diagram of the process of a mirror sharing method provided by an embodiment of the present invention. As Figure 2 shown, the method includes:
[0067] Step 201: Receive a mirror sharing instruction, where the mirror sharing instruction indicates sharing the shared mirror to the target mirror location.
[0068] Before step 201, a search page may also be displayed, which includes options such as name, creation date, keyword, usage, etc. Users can fill in relevant information about the image on the search page to search for relevant shared images.
[0069] In an embodiment of the present invention, before receiving an image sharing instruction, it further includes: receiving an image search instruction; in response to the image search instruction, displaying an image list, which includes images that can be shared.
[0070] Users can issue an image search instruction based on the search page. The image search instruction includes at least one search keyword. The search keyword can be a description of the name, creation date, attributes, usage, etc. of the shared image. The system receives the image search instruction and determines relevant images corresponding to the image search instruction according to the search keyword; and displays an image list of the relevant images.
[0071] Specifically, there are multiple alternative images stored in the system, and these alternative images can all be used as shared images to be shared by other users. Keywords and / or descriptions of each alternative image are pre-stored in the system. The keywords and descriptions can be set by the image creator or administrator according to the name, usage, etc. of the image.
[0072] After receiving the image search instruction issued by the user, obtain the keywords and / or descriptions of each alternative image; respectively determine the matching degree between the keywords and / or descriptions of each alternative image and the search keyword; according to the matching degree, determine the relevant images corresponding to the image search instruction. The matching degree can be determined by algorithms such as string matching or natural language processing.
[0073] The above image sharing instruction can be an image sharing instruction issued by the user for the image list. When the user finds an image to be shared in the image list, the user can select the image in the image list and issue a sharing instruction. The sharing instruction can be issued in the form of clicking a corresponding button, pressing a specified key, or a voice instruction, etc.
[0074] Step 202: According to the image sharing instruction, determine the source image location and the target image location of the shared image.
[0075] The source image location is the location where the image file of the shared image is stored. The source image location can be determined by a combination of the image repository name, system name, application name, etc., and the source image location can also be directly represented by a disk directory or a distributed file system directory, etc.
[0076] The target image location is the location where the image file of the associated image is stored. The associated image location can be determined by a combination of the image repository name, system name, application name, etc., and the target image location can also be directly represented by a disk directory or a distributed file system directory, etc.
[0077] Specifically, the target image location can be determined by the system or application logged in by the user who issues the image sharing instruction. The target image location can also be included in the image sharing instruction. By parsing the image sharing instruction, the target image location can be obtained. The embodiments of the present invention do not limit how to determine the target image location and the manner of the target image location.
[0078] Step 203: Copy the image file of the shared image from the source image location to the target image location to generate an associated image.
[0079] The image file is a file related to the shared image. The image file can be a file for creating an image, such as a Dockerfile. The Dockerfile is a text file used to build an image, and the text content contains instructions and descriptions for building the image one by one. The image file can also be a file specifically storing the image, such as a file in iso format or img format. The image file can also be an attribute file or configuration file related to the image, etc.
[0080] In the embodiments of the present invention, according to the user's image sharing instruction, the system can automatically share the image to the target image location. The user does not need to manually rebuild the image or call system commands. Therefore, the method of the embodiments of the present invention can save the user's operation time and has high security.
[0081] Figure 3 It is a schematic diagram of the process of another image sharing method provided by an embodiment of the present invention. The embodiments of the present invention provide an image sharing method, as Figure 3 shown, including:
[0082] Step 1: Make a custom base image, share the base image into the image system, and the image system can be set as a system market for image sharing.
[0083] User A logs in to the PaaS platform and uses the Dockerfile method to build the base image of Application A; on the basis of the base image provided by the PaaS platform using the Dockerfile method, make a custom base image that can be used as a base image.
[0084] The administrator of the application can, in the list of custom base images, share the base image successfully built by User A into the image market, facilitating other applications to use this image as a base image. Compared with users repeatedly using Dockerfile to build images, it can save the time spent on newly building the base image of their own applications.
[0085] You can share the base image to the image market by filling in the following information: the name of the image to be shared (the shared image name, which can be displayed as the associated image name later); the shared tag can be left unspecified, and the current tag of the image to be shared is used by default; the keywords included in the shared image, which are convenient for being searched in the image market according to the keywords; the image description, which can include the functions provided by the shared image, the installed software version, etc., so that other applications can briefly understand the information of the shared base image and whether it meets their own application scenarios.
[0086] After successful sharing, in the list of base images of my own application, the "Shared" identifier will be displayed on the base image. Other users enter the image market and can see the base images in the shared state by searching according to the keywords.
[0087] At this point, the custom base image has been shared to the image market for other applications to use.
[0088] Step 2: "Associate" the image from the image market.
[0089] The user selects Application B and enters the image market. The user can be User A or other users. The user searches according to the keywords to find out the list of base images; selects the shared image that meets their own needs. If the shared image has been associated with their own application, "Already Associated" will be displayed; for unassociated images, "Associate" will be displayed. Click the "Associate" button, and the system will call the API service of Harbor. This service will call the distributed file system to store the image to copy the source image to the target image. At the same time, when associating the image, the system will record the corresponding relationship between the shared image identifier and the associated image identifier.
[0090] The method of the embodiment of the present invention can safely and conveniently achieve the purpose of sharing custom base images between different applications, improve the utilization rate of the base images, and avoid users from reconstructing the shared images repeatedly.
[0091] Figure 4 It is a schematic diagram of the process of an image upgrade method provided by an embodiment of the present invention. The embodiment of the present invention provides an image upgrade method, as Figure 4 shown, including:
[0092] Step 401: Determine whether the shared image has been upgraded.
[0093] If so, execute the following Step 402.
[0094] Step 402: Determine whether there is an associated image associated with the shared image.
[0095] The associated image is the image generated by copying or sharing the shared image in step 401. The associated image in step 402 is the image file that has not completed the upgrade operation corresponding to step 401. Before the shared image is upgraded, the associated image can have the same image file as the shared image.
[0096] If it exists, perform the following step 403.
[0097] Step 403: Determine the image storage location and the target image location. The image storage location stores the image file after the shared image is upgraded, and the target image location is the storage location of the associated image.
[0098] The image storage location stores the image file after the shared image is upgraded. The image storage location can be the source image location where the shared image is located, or the location where other associated images that have completed the upgrade are located. The image storage location can be determined by a combination of the image repository name, system name, application name, etc., or can also be directly represented by a disk directory or a distributed file system directory, etc.
[0099] The target image location is the location where the image file of the associated image is stored. The target image location can be determined by the system or application where the associated image is located. The associated image location can be determined by a combination of the image repository name, system name, application name, etc., or the target image location can also be directly represented by a disk directory or a distributed file system directory, etc.
[0100] Step 404: Copy the upgraded image file from the image storage location to the target image location to upgrade the associated image.
[0101] The image file is a file related to the shared image. The image file can be a file for creating an image, such as a Dockerfile. A Dockerfile is a text file used to build an image, and the text content contains instructions and descriptions for building the image one by one. The image file can also be a file specifically storing the image, such as a file in iso format or img format. The image file can also be an attribute file or configuration file related to the image, etc.
[0102] In the embodiment of the present invention, the shared image has been upgraded, and the associated image associated with it does not need to be re-associated. If the base image that has been shared under this application is selected, a shared image record is added. The base image can be determined by the image name and tag. And set the upgrade field in the shared image record to the identifier of the selected base image that has been shared. The upgrade field can also be set to empty or null, indicating that the image is not an upgraded image.
[0103] The timing service will scan for incremental shared mirror data, which is a list of shared mirrors where the upgrade field is not empty or null.
[0104] Process the above list of shared mirrors. For example, if there are duplicate mirror names, select the latest version, screen out the latest records of each mirror and store them in a set, and traverse the set. Among them, each shared mirror corresponds to information such as the shared mirror name and shared mirror tag. Since the identifier of the shared mirror associated from which mirror will be recorded when associating mirrors, according to the upgrade field in the associated mirror data table, find the information associated with this shared mirror, and the shared mirror information includes the associated mirror name. Call an interface, such as the Harbor registry interface, to copy the source mirror to the target mirror, and this process will overwrite the previously associated mirror.
[0105] In the embodiment of the present invention, after upgrading the shared mirror, the associated mirror associated with this shared mirror will also be automatically upgraded, which simplifies the user's operation and facilitates the user's use of the corresponding mirror.
[0106] In an embodiment of the present invention, before determining the mirror storage location and the target mirror location, it further includes:
[0107] Obtain the upgrade attribute of the associated mirror;
[0108] According to the upgrade attribute, determine whether the associated mirror is allowed to be automatically updated;
[0109] If so, execute the step of determining the mirror storage location and the target mirror location.
[0110] The user can set the upgrade attribute of the associated mirror according to the specific situation. This upgrade attribute is used to indicate whether the associated mirror is allowed to be automatically updated. For example, when the user has modified the associated mirror according to their own needs, or is worried about the instability of the upgraded mirror, etc., the upgrade attribute can be set to not allow the associated mirror to be automatically updated.
[0111] Figure 5 It is a schematic diagram of the process of another mirror upgrade method provided by an embodiment of the present invention. The embodiment of the present invention provides a mirror upgrade method, as Figure 5 shown, including:
[0112] Step 501: Determine whether the shared mirror has been upgraded.
[0113] If so, execute the following step 502.
[0114] Step 502: Determine whether there is an associated mirror associated with the shared mirror.
[0115] The associated mirror in step 502 is a mirror that has not been upgraded. If it exists, execute step 503.
[0116] Step 503: Determine whether there are other associated images that have completed the upgrade.
[0117] Other associated images are images generated by copying or sharing the shared image in Step 501. The other associated images have completed the upgrade corresponding to Step 501. The mirror file of the upgraded shared image is stored in the mirror location of the other associated images. There can be one or more other associated images.
[0118] If there are any, execute Step 504; if not, execute Step 506.
[0119] Step 504: Determine the mirror location of the other associated images and the source mirror location of the shared image.
[0120] If there are multiple other associated images, the mirror locations of multiple other associated images can be determined.
[0121] Step 505: Determine the mirror storage location from the mirror locations of the other associated images and the source mirror location.
[0122] Based on aspects such as network and resources, a mirror storage location can be selected from the mirror locations of the other associated images that have completed the upgrade and the source mirror location for upgrading the target associated image.
[0123] Specifically, the resource consumption situations of the nodes where the other associated images that have completed the upgrade and the shared image are located can be obtained respectively, such as CPU usage rate, memory usage rate, system response time, network latency, data stream transmission rate, etc. Considering the resource consumption situations comprehensively, a target mirror is selected from the other associated images and the shared image, and the mirror location where the target mirror is located is determined as the mirror storage location.
[0124] Step 506: Determine the source mirror location of the shared image.
[0125] Step 507: Determine the source mirror location as the mirror storage location.
[0126] In the case where there are no other associated images, directly determine the source mirror location as the mirror storage location.
[0127] Step 508: Determine the target mirror location, and the target mirror location is the storage location of the associated image.
[0128] Step 509: Copy the upgraded mirror file from the mirror storage location to the target mirror location to upgrade the associated image.
[0129] After the shared image is upgraded, multiple images associated with the shared image may need to be upgraded. If the shared files are all copied from the source image location where the shared image is located, it may cause network congestion on the node where the shared image is located, and the upgrade speed will be slow.
[0130] In an embodiment of the present invention, according to aspects such as network and resources, an image storage location can be selected from the storage locations of other associated images and the shared image that have been upgraded to upgrade the target associated image. On the one hand, it reduces the risk of network congestion on the node where the shared image is located, and on the other hand, it can also reduce the time required for multiple associated images to complete the upgrade operation simultaneously.
[0131] Figure 6 It is a schematic diagram of the process of a service image construction method provided by an embodiment of the present invention. An embodiment of the present invention provides a service image construction method, as Figure 6 shown, including:
[0132] Select the base image associated with the current application when constructing the image. For example, when constructing an image on PaaS, it is finally stored in the distributed file system by calling the Harbor registry service. The Harbor registry service is a cluster service.
[0133] Create a service image based on the associated base image. For example, deploy the service image through PaaS to create a container. When starting the container, pull the image from the Harbor service, that is, Harbor reads the image from the distributed file system.
[0134] Figure 7 It is a schematic structural diagram of an image upgrade device provided by an embodiment of the present invention, including:
[0135] An upgrade determination module 701, configured to determine whether the shared image has been upgraded;
[0136] An image determination module 702, configured to, if so, determine whether there is an associated image associated with the shared image;
[0137] A location determination module 703, configured to, if there is, determine the image storage location and the target image location. The image storage location stores the upgraded image file of the shared image, and the target image location is the storage location of the associated image;
[0138] A file copying module 704, configured to copy the upgraded image file from the image storage location to the target image location to upgrade the associated image.
[0139] Optionally, the device further includes:
[0140] The mirror sharing module 705 is used to receive a mirror sharing instruction, which indicates sharing a shared mirror to a target mirror location;
[0141] According to the mirror sharing instruction, determine the source mirror location and the target mirror location of the shared mirror;
[0142] Copy the mirror file of the shared mirror from the source mirror location to the target mirror location to generate an associated mirror.
[0143] Optionally, the mirror sharing module 705 is specifically used for:
[0144] Receive a mirror search instruction;
[0145] In response to the mirror search instruction, display a mirror list, where the mirror list includes the shared mirror;
[0146] Receive a mirror sharing instruction issued for the mirror list.
[0147] Optionally, the mirror sharing module 705 is specifically used for:
[0148] Receive a mirror search instruction, where the mirror search instruction includes at least one search keyword;
[0149] According to the search keyword, determine the relevant mirror corresponding to the mirror search instruction;
[0150] Display the mirror list of the relevant mirror.
[0151] Optionally, the mirror sharing module 705 is specifically used for:
[0152] Obtain the keywords and / or descriptions of each alternative mirror;
[0153] Respectively determine the matching degree between the keywords and / or descriptions of each alternative mirror and the search keyword;
[0154] According to the matching degree, determine the relevant mirror corresponding to the mirror search instruction.
[0155] Optionally, the device further includes:
[0156] The attribute determination unit 706 is used to obtain the upgrade attribute of the associated mirror;
[0157] According to the upgrade attribute, determine whether the associated mirror allows automatic update.
[0158] Optionally, the location determination module 703 is specifically used for:
[0159] Determine whether there are other associated mirrors that have completed the upgrade, and the other associated mirrors are associated with the shared mirror;
[0160] If it exists, determine the mirror positions of other associated mirrors and the source mirror position of the shared mirror;
[0161] Determine the mirror storage position from the mirror positions of other associated mirrors and the source mirror position.
[0162] Optionally, the position determination module 703 is specifically configured to:
[0163] If it does not exist, determine the source mirror position of the shared mirror;
[0164] Determine the source mirror position as the mirror storage position.
[0165] An embodiment of the present invention provides an electronic device, including:
[0166] One or more processors;
[0167] A storage device for storing one or more programs,
[0168] When the one or more programs are executed by the one or more processors, the one or more processors implement the method of any of the above embodiments.
[0169] Reference is made below Figure 8 , which shows a schematic structural diagram of a computer system 800 of a terminal device suitable for implementing the embodiments of the present invention. Figure 8 The terminal device shown is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present invention.
[0170] As shown in 8, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 802 or the program loaded from the storage section 808 into the random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The CPU 801, ROM 802, and RAM 803 are connected to each other through a bus 804. The input / output (I / O) interface 805 is also connected to the bus 804.
[0171] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as required. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is mounted on the drive 810 as required so that a computer program read therefrom is installed into the storage section 808 as required.
[0172] Specifically, according to an embodiment disclosed by the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment disclosed by the present invention includes a computer program product which includes a computer program carried on a computer-readable medium, and the computer program includes program codes for performing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 809, and / or installed from the removable medium 811. When the computer program is executed by a central processing unit (CPU) 801, the above functions defined in the system of the present invention are executed.
[0173] It should be noted that the computer-readable medium shown in the present invention can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, 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 above. In the present invention, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also 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 conjunction with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0174] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0175] The modules involved in the embodiments of the present invention can be implemented in software or in hardware. The described modules can also be provided in a processor. For example, it can be described as: a processor includes an upgrade determination module, a mirror determination module, a location determination module, and a file copy module. Among them, the names of these modules do not constitute a limitation to the module itself in some cases. For example, the upgrade determination module can also be described as "a module for determining whether a shared mirror has been upgraded".
[0176] As another aspect, the present invention also provides a computer-readable medium. The computer-readable medium can be included in the device described in the above embodiments; or it can exist alone without being assembled into the device. The above computer-readable medium carries one or more programs. When the one or more programs are executed by the device, the device includes:
[0177] Determine whether the shared mirror has been upgraded;
[0178] If so, determine whether there is an associated mirror associated with the shared mirror;
[0179] If there is, determine the mirror storage location and the target mirror location. The mirror storage location stores the mirror file after the upgrade of the shared mirror, and the target mirror location is the storage location of the associated mirror;
[0180] Copy the upgraded mirror file from the mirror storage location to the target mirror location to upgrade the associated mirror.
[0181] According to the technical solution of the embodiments of the present invention, when the shared mirror has been upgraded, the associated mirror of the shared mirror is determined and the associated mirror is automatically upgraded. Compared with the method of manually upgrading the associated mirror by the user, it can simplify the user operation and save the user's operation time.
[0182] The above specific embodiments do not constitute a limitation to the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A mirror upgrade method, characterized in that, Including: Determine whether the shared image has been upgraded; Before determining whether the shared image has been upgraded, it further includes: receiving an image sharing instruction, where the image sharing instruction indicates sharing the shared image to a target image location; according to the image sharing instruction, determining the source image location and the target image location of the shared image; copying the image file of the shared image from the source image location to the target image location to generate an associated image; Before receiving the image sharing instruction, it further includes: receiving an image search instruction, where the image search instruction includes at least one search keyword; according to the search keyword, determining relevant images corresponding to the image search instruction; displaying an image list of the relevant images, where the image list includes the shared image; the receiving of the image sharing instruction includes: receiving an image sharing instruction issued for the image list; If so, determine whether there is an associated image associated with the shared image; where the associated image is generated by copying the image file of the shared image from the source image location to the target image location; If there is, determine the image storage location and the target image location, where the image storage location stores the upgraded image file of the shared image; Copy the upgraded image file from the image storage location to the target image location to upgrade the associated image.
2. The method according to claim 1, characterized in that, The determining of the relevant images corresponding to the image search instruction according to the search keyword includes: Obtaining the keywords and / or descriptions of each alternative image; Respectively determining the matching degrees between the keywords and / or descriptions of each alternative image and the search keyword; According to the matching degrees, determining the relevant images corresponding to the image search instruction.
3. The method according to claim 1, characterized in that, Before determining the image storage location and the target image location, it further includes: Obtaining the upgrade attribute of the associated image; According to the upgrade attribute, determining whether the associated image allows automatic update; If so, execute the step of determining the image storage location and the target image location.
4. The method according to claim 1, characterized in that, The determining of the image storage location includes: Determining whether there are other associated images that have been upgraded and are associated with the shared image; If there are, determining the image location of the other associated images and the source image location of the shared image; Determining the image storage location from the image location of the other associated images and the source image location.
5. The method according to claim 4, characterized in that, After determining whether there are other associated images that have been upgraded and are associated with the shared image, it further includes: If there are not, determining the source image location of the shared image; Determining the source image location as the image storage location.
6. A mirror upgrade device, characterized in that, Including: An upgrade determination module for determining whether the shared image has been upgraded; An image sharing module for receiving an image sharing instruction, where the image sharing instruction indicates sharing the shared image to a target image location; according to the image sharing instruction, determining the source image location and the target image location of the shared image; Copying the image file of the shared image from the source image location to the target image location to generate an associated image; The mirror sharing module is further configured to: receive a mirror search instruction, where the mirror search instruction includes at least one search keyword; determine relevant mirrors corresponding to the mirror search instruction according to the search keyword; display a mirror list of the relevant mirrors, where the mirror list includes the shared mirror; The receiving the mirror sharing instruction includes: receiving a mirror sharing instruction issued for the mirror list; a mirror determination module, configured to, if so, determine whether there is an associated mirror associated with the shared mirror; wherein the associated mirror is generated by copying the mirror file of the shared mirror from a source mirror location to a target mirror location; a location determination module, configured to, if there is, determine a mirror storage location and the target mirror location, where the mirror storage location stores the upgraded mirror file of the shared mirror; a file copying module, configured to copy the upgraded mirror file from the mirror storage location to the target mirror location to upgrade the associated mirror.
7. An electronic device, characterized in that, including: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enabling the one or more processors to implement the method according to any one of claims 1-5.
8. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the method according to any one of claims 1-5.
Citation Information
Patent Citations
Embedded device, upgrading method thereof and control terminal
CN110012082A
Mirror image file upgrading method and device, terminal and readable storage medium
CN112015459A