CN114489739A - Software package updating method and device and computing equipment - Google Patents

Software package updating method and device and computing equipment Download PDF

Info

Publication number
CN114489739A
CN114489739A CN202210340284.3A CN202210340284A CN114489739A CN 114489739 A CN114489739 A CN 114489739A CN 202210340284 A CN202210340284 A CN 202210340284A CN 114489739 A CN114489739 A CN 114489739A
Authority
CN
China
Prior art keywords
software package
path
target
original
warehouse
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210340284.3A
Other languages
Chinese (zh)
Other versions
CN114489739B (en
Inventor
吴荣杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Uniontech Software Technology Co Ltd
Original Assignee
Uniontech Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Uniontech Software Technology Co Ltd filed Critical Uniontech Software Technology Co Ltd
Priority to CN202210731169.9A priority Critical patent/CN115167888A/en
Priority to CN202210340284.3A priority patent/CN114489739B/en
Publication of CN114489739A publication Critical patent/CN114489739A/en
Application granted granted Critical
Publication of CN114489739B publication Critical patent/CN114489739B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a software package updating method and device and computing equipment. The software package updating method is suitable for a server side, and comprises the following steps: in response to detecting that the software package is completely updated in the original warehouse, generating a target warehouse index file, wherein the content of the target warehouse index file is the same as the content of the original warehouse index file in the original warehouse; copying the software package from an original path in an original warehouse to a target path in a target warehouse; and modifying the original path of the software package in the target warehouse index file into a target path to obtain an updated target warehouse index file, and completing the updating of the software package.

Description

Software package updating method and device and computing equipment
Technical Field
The invention relates to the technical field of software warehouse updating, in particular to a software package updating method, a device and computing equipment.
Background
With the further improvement of the ecology of the Linux desktop, the requirements and demands of users on software are gradually increased, so that the updating frequency of the software is increased, and the requirements and the demands are also an examination on a software warehouse for storing and retrieving the software.
The Debian warehouse is a common software warehouse applicable to the Linux system and is managed by using a repiprro tool. In the server-side binary warehouse, each version of each software comprises three parts, namely warehouse information release, warehouse index files packages and a software package deb. The release records the storage addresses of packages suitable for different processor architectures, and the packages record the storage addresses of each deb. Taking a version of software in the debian repository shown in fig. 1 as an example, release records the storage address of packages of the amd64 schema and the storage address of packages of the i386 schema, packages of the amd64 schema records the storage address of deb of the amd64 schema, and packages of the i386 schema records the storage address of deb of the i386 schema.
As shown in fig. 2, the service end imports deb (i.e., deb _ v 1) of a certain software v1 version, then records the storage address of packages in release, and records the storage address of deb in packages. When the client downloads and installs the software, firstly, the client downloads release to the server and caches the release to the local, then, the client inquires the storage address of the packages from the release, downloads the packages from the server according to the address and caches the packages to the local, and when the software is installed, the client inquires the storage address of the deb from the locally cached packages, and then, the client downloads the deb from the server according to the address and installs the deb. When the v2 version of the software appears, the software warehouse needs to be updated, and the updating process is as follows: the deb _ v2 is firstly imported into a software warehouse of a server, and since the reprepro tool only allows one copy of deb with the same package name, the repro tool deletes deb _ v1 while deb _ v2 is imported, and then releases and packages are updated, and the updated packages record the storage address of deb _ v 2. After the software warehouse is updated, if the packages cached locally by the client are downloaded before the software warehouse is updated, that is, the packages record the storage address of deb _ v1, the client cannot download the packages to the deb file when running the packages because deb _ v1 is deleted.
In order to solve the problem that the deb download address is invalid, the format specification of the deban warehouse indicates that an Acquire-By-Hash option is added in a release file, and a client can be guided to Acquire packages according to a Hash value preferentially, and if the acquisition fails, the packages are acquired from a default path. When the warehouse management tool supports this approach, packages are also placed in the hash path. For example, the default path for a packages file is: disks/eagle/main/bind-amd 64/Packages, and after using the Acquire-By-Hash option, the Packages file is also copied into the Hash path: dists/eagle/main/binary-amd64/by-hash/MD5Sum/4d4bd928d09a48c193ac6ec54ad4 ccbe. The process of obtaining the packages file is shown in fig. 3, after obtaining the release file, the client determines whether the Acquire-By-Hash is enabled, if the Acquire-By-Hash is not enabled, the packages file is downloaded and cached from a default path, if the Acquire-By-Hash is enabled, the packages file is downloaded from a Hash value path recorded By the release file and cached, and if the download of the packages file from the Hash value path fails, the packages file is downloaded from the default path and cached. After the Acquire-By-Hash parameter is used, the packages can be stored in the directory of the Hash value of the packages, when the warehouse is updated, the files of the packages cannot be covered, and the situation that downloaded release is not matched with the packages can be avoided. However, this method only works for packages files, old version of deb is still deleted, the client still cannot download deb when packages are out of date, and usually release files and packages files are downloaded at the same time at the client, so this method is not practical.
In summary, none of the above existing software warehouse updating techniques can solve the problem that the software package cannot be downloaded due to the fact that the client-side warehouse index file is not updated.
Disclosure of Invention
To this end, the present invention provides a software package update method, apparatus and computing device in an attempt to solve or at least alleviate at least one of the problems identified above.
According to one aspect of the present invention, there is provided a software package updating method, adapted to a server, the method including the steps of: in response to detecting that the software package is completely updated in the original warehouse, generating a target warehouse index file, wherein the content of the target warehouse index file is the same as the content of the original warehouse index file in the original warehouse; copying the software package from an original path in the original repository to a target path in a target repository; and modifying the original path of the software package in the target warehouse index file into the target path to obtain an updated target warehouse index file, and completing the update of the software package.
Optionally, in the software package updating method according to the present invention, the step of copying the software package from the original path in the original repository to the target path in the target repository includes: acquiring a target path of each software package in the target warehouse index file; and in the case that the target path does not store files, copying the software package corresponding to the target path from the original path in the original warehouse to the target path in the target warehouse.
Optionally, in the software package updating method according to the present invention, the step of copying the software package from the original path in the original repository to the target path in the target repository includes: positioning the software package to obtain an original path of the software package; and copying the software package from an original path in the original repository to a target path in the target repository.
Optionally, in the software package updating method according to the present invention, the target path is obtained from an original path of the software package corresponding thereto.
Optionally, in the software package updating method according to the present invention, the target path is obtained by splicing an original path of the software package corresponding to the target path and the hash value.
Optionally, in the software package updating method according to the present invention, the software package is copied from the original path in the original repository to the target path in the target repository in a hard link manner.
According to another aspect of the present invention, there is also provided a software package updating apparatus, adapted to a server, the apparatus including: the initialization unit is used for responding to the fact that the software package is detected to be updated in the original warehouse completely, and generating a target warehouse index file, wherein the content of the target warehouse index file is the same as the content of the original warehouse index file in the original warehouse; a file copying unit adapted to copy the software package from an original path in the original repository to a target path in a target repository; and the path modification unit is suitable for modifying the original path of the software package in the target warehouse index file into the target path to obtain an updated target warehouse index file and finish the update of the software package.
Optionally, in the software package updating apparatus according to the present invention, the file copying unit includes: the path acquisition subunit is suitable for acquiring a target path of each software package in the target warehouse index file; and a first replication sub-unit adapted to replicate, in a case where the target path does not store a file, a software package corresponding to the target path from an original path in the original warehouse to the target path in the target warehouse.
According to another aspect of the present invention, there is also provided a computing device comprising: at least one processor and a memory storing program instructions; the program instructions, when read and executed by a processor, cause the computing device to perform the software package update method as above.
According to still another aspect of the present invention, there is also provided a readable storage medium storing program instructions which, when read and executed by a computing device, cause the computing device to execute the software package update method as above.
The software package updating method of the invention copies the software package imported into the original warehouse to a new address (namely, a target path), and modifies the address of the software package in the warehouse index file to point to the new address.
According to the software package updating method, the software package updating device and the computing equipment, at least one of the following beneficial effects can be realized: because the software package in the new address is not controlled by the warehouse management software, after the original warehouse is changed, the software package of each version still exists in the target warehouse, even if the client stores the warehouse index file of the old version, the warehouse index file is effective, and the software package of the corresponding version can be normally downloaded.
Drawings
To the accomplishment of the foregoing and related ends, certain illustrative aspects are described herein in connection with the following description and the annexed drawings, which are indicative of various ways in which the principles disclosed herein may be practiced, and all aspects and equivalents thereof are intended to be within the scope of the claimed subject matter. The above and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description read in conjunction with the accompanying drawings. Throughout this disclosure, like reference numerals generally refer to like parts or elements.
Fig. 1 shows a basic structure of a server-side debian warehouse according to the background of the invention;
fig. 2 illustrates a flow of importing deb and updating deb by a server and downloading deb by a client according to the background art of the present invention; (ii) a
FIG. 3 is a flowchart for acquiring packages files according to the background art of the present invention;
FIG. 4 illustrates a usage environment diagram of a software package update method 600 according to one embodiment of the invention;
FIG. 5 illustrates a schematic structural diagram of a computing device 500, according to one embodiment of the invention;
FIG. 6 illustrates a flow diagram of a software package update method 600 according to one embodiment of the invention;
FIG. 7 shows a flow diagram of a software package update method 700 according to one embodiment of the invention;
fig. 8 is a schematic structural diagram of a software package updating apparatus 800 according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The invention provides a software package updating method, which aims to solve the problem that the existing software warehouse updating technology cannot download deb files when client side packages files expire.
FIG. 4 illustrates a usage environment diagram of a software package update method 600 according to one embodiment of the invention. As shown in fig. 4, an existing warehouse management tool is used to manage an original warehouse of a server, where the original warehouse in the embodiment of the present application refers to a software warehouse in the prior art. In the software package importing process, the software package updating method 600 realizes the functions in the form of scripts, so that the deb file imported into the original warehouse exists in two addresses at the same time, and the problem that the deb file cannot be downloaded when the client packages file expires due to the fact that the old version of the deb file in the original warehouse is deleted can be effectively solved.
FIG. 5 shows a schematic diagram of a computing device 500, according to one embodiment of the invention. It should be noted that the computing device 500 shown in fig. 5 is only an example, and in practice, the computing device for implementing the software package updating method of the present invention may be any type of device, and the hardware configuration thereof may be the same as the computing device 500 shown in fig. 5 or different from the computing device 500 shown in fig. 5. In practice, the computing device implementing the software package updating method of the present invention may add or delete hardware components of the computing device 500 shown in fig. 5, and the present invention does not limit the specific hardware configuration of the computing device. The software package update method of the present invention dynamically loads the hardware components of the computing device 500 shown in fig. 5 during runtime.
As shown in FIG. 5, in a basic configuration 502, computing device 500 typically includes a system memory 506 and one or more processors 504. A memory bus 508 may be used for communicating between the processor 504 and the system memory 506.
Depending on the desired configuration, the processor 504 may be any type of processing, including but not limited to: a microprocessor (μ P), a microcontroller (μ C), a digital information processor (DSP), or any combination thereof. Processor 504 may include one or more levels of cache, such as a level one cache 510 and a level two cache 512, a processor core 514, and registers 516. Example processor cores 514 may include an Arithmetic Logic Unit (ALU), a Floating Point Unit (FPU), a digital signal processing core (DSP core), or any combination thereof. The example memory controller 518 may be used with the processor 504, or in some implementations the memory controller 518 may be an internal part of the processor 504.
Depending on the desired configuration, system memory 506 may be any type of memory, including but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. System memory 506 may include an operating system 520, one or more applications 522, and program data 524. In some implementations, the application 522 can be arranged to execute instructions on the operating system with the program data 524 by the one or more processors 504.
Computing device 500 may also include an interface bus 540 that facilitates communication from various interface devices (e.g., output devices 542, peripheral interfaces 544, and communication devices 546) to the basic configuration 502 via the bus/interface controller 530. The example output device 542 includes a graphics processing unit 548 and an audio processing unit 550. They may be configured to facilitate communications with various external devices, such as a display or speakers, via the one or more a/V ports 552. Example peripheral interfaces 544 can include a serial interface controller 554 and a parallel interface controller 556, which can be configured to facilitate communication with external devices such as input devices (e.g., keyboard, mouse, pen, voice input device, touch input device) or other peripherals (e.g., printer, scanner, etc.) via one or more I/O ports 558. An example communication device 546 may include a network controller 560, which may be arranged to facilitate communications with one or more other computing devices 262 over a network communication link via one or more communication ports 564.
A network communication link may be one example of a communication medium. Communication media may typically be embodied by computer readable instructions, data structures, program modules, and may include any information delivery media, such as carrier waves or other transport mechanisms, in a modulated data signal. A "modulated data signal" may be a signal that has one or more of its data set or its changes made in such a manner as to encode information in the signal. By way of non-limiting example, communication media may include wired media such as a wired network or private-wired network, and various wireless media such as acoustic, Radio Frequency (RF), microwave, Infrared (IR), or other wireless media. The term computer readable media as used herein may include both storage media and communication media.
Computing device 500 may be implemented as a server, such as a file server, database server, application server, WEB server, and the like, or as a personal computer including both desktop and notebook computer configurations. Of course, computing device 500 may also be implemented as part of a small-sized portable (or mobile) electronic device. In an embodiment in accordance with the invention, the computing device 500 is configured to perform a software package update method 600 in accordance with the invention. The application 522 of the computing device 500 includes a plurality of program instructions for executing the software package updating method 600 according to the present invention, and the program data 524 may further store warehouse information release, warehouse index packages, software packages deb, and various cache data.
A software package updating method 600 according to an embodiment of the present invention is applicable to a server, and the method 600 includes the steps of: in response to detecting that the software package is completely updated in the original warehouse, generating a target warehouse index file, wherein the content of the target warehouse index file is the same as the content of the original warehouse index file in the original warehouse; copying the software package from an original path in an original warehouse to a target path in a target warehouse; and modifying the original path of the software package in the target warehouse index file into a target path to obtain an updated target warehouse index file, and completing the updating of the software package.
The method 600 may be packaged as a script that the warehouse management software manages the original warehouse in the existing manner, and the script starts to run whenever a software package is imported into the original warehouse.
FIG. 6 shows a flow diagram of a software package update method 600 according to one embodiment of the invention. Method 600 is performed in a computing device, such as computing device 500 described previously. As shown in fig. 6, the method 600 begins at step S610.
In step S610, in response to detecting that the software package is updated in the original warehouse completely, a target warehouse index file is generated, and the content of the record of the target warehouse index file is the same as the content of the record of the original warehouse index file in the original warehouse.
It should be noted that the original repository index file is a repository index file in an original repository in the prior art, and is used for recording a path along which a software package is imported, where the path along which the software package is imported is also referred to as an original path, and the repository management software generates the original path for the software package to be imported, and then imports the software package under the original path. The target repository index file can be obtained by copying the original repository index file, and the contents of the target repository index file and the original repository index file are the same, but the file names of the target repository index file and the original repository index file are different. The original repository index file may be copied to memory, facilitating modification thereof in subsequent steps. The method 600 of the embodiment of the present application is applicable to a server, and a client still uses a conventional manner when downloading or updating software, so that, in order to enable the client to preferentially download a software package from a target path, a file name of a target warehouse index file should be the same as a file name of a warehouse index file in a software warehouse in the prior art, and accordingly, the file name of an original warehouse index file mentioned in the method 600 should be modified so that the file name of the original warehouse index file is different from the file name of the target warehouse index file.
Next, in step S620, the software package is copied from the original path in the original repository to the target path in the target repository.
The software package is actually the software package just imported into the original warehouse under the original path, but the software package has not completed the copying process before step S620. The target path may be generated in various ways as long as it is different from the existing package storage path. The software package copied to the target path is not in the record of the warehouse management software, so that the copied software package is out of the control of the warehouse management software, and when a new version software package is imported, the software package stored in the original path is deleted, but the software package stored in the target path is not deleted.
In order to avoid repeated storage consumption and hard disk read-write consumption in the copying process, the software package can be copied from the original path to the target path by using the hard link characteristic of the file system. For example, the imported deb is placed by the warehouse management software prepropro in the following path:
pool/main/c/curl/curl_7.64.0-4+deb10u1_amd64.deb
copy the deb to another path using a hard link:
pool/main/c/curl/curl_7.64.0-4+deb10u1_amd64_MD5sum-8b99d02cc2d9aefac2dc552fd32d345d.deb
the hard link generated by the copy process shares the same underlying data blocks as the software package stored by the original path.
Next, in step S630, the original path of the currently imported software package in the target repository index file is modified into the target path, so as to obtain an updated target repository index file, and update of the software package is completed.
In order to enable the client to download the software package from the target path according to the target warehouse index file, the storage path of the software package in the target warehouse index file needs to be modified into the target path, and the path can be modified by using a script hook mechanism of the warehouse management software repeprro.
After the software package in the original warehouse is updated by using the method 600, the old version software package stored under the target path is not deleted, when the client downloads the software package, according to the existing mode, the target warehouse index file is firstly searched, and the software package is downloaded according to the storage path of the software package recorded by the target warehouse index file, so that even if the information recorded by the target warehouse index file stored by the client is the storage path of the old version software package, the software package can be smoothly downloaded.
According to one implementation of the present invention, the step of copying the software package from the original path in the original repository to the target path in the target repository comprises: acquiring a target path of each software package in a target warehouse index file; and in the case that the target path does not store the file, copying the software package corresponding to the target path from the original path in the original warehouse to the target path in the target warehouse. In this way, the target paths of all software packages in the target warehouse index file need to be traversed, whether the target paths are empty or not is judged, when a certain target path is empty, the original path of the software package corresponding to the target path is searched, and the software package is copied to the target path in the original path. The copying mode is simple in logic and relatively easy to implement, only whether files are stored in each target path is judged, the data processing process is not complex, and only time not more than 1 second is needed for completing all judgment by taking 1000 software packages as an example.
According to another implementation of the present invention, the step of copying the software package from the original path in the original repository to the target path in the target repository comprises: positioning the software package to obtain an original path of the software package; and copying the software package from the original path in the original repository to the target path in the target repository. The method only needs to process data of one software package, and avoids the process of traversal.
According to one implementation of the present invention, the target path is obtained from the original path of the software package corresponding thereto. In this way, the structure of the target path needs to be set in advance, for example, the structure of the target path is set to add a certain parameter on the basis of the original path, the parameter may be recorded in the original warehouse index file, and then the target warehouse index file may also record the parameter, and when the target warehouse index file is read, the corresponding parameter is added to the read original path of the software package, so that the target path of the software package may be obtained. The target path obtaining process can also be performed when the target warehouse index file is generated, all contents of the original warehouse index file are copied into the memory, corresponding parameters are added to the original path of each software package, and the obtained target path is also recorded in the memory, so that the target path can be directly read when the target warehouse index file is read. To avoid a conflict with the package filename under the original path, the parameter may also be added to the copied package filename.
According to one implementation of the present invention, the parameter may be a hash value of the software package, where the hash value of the software package is data commonly used in the original repository, and in the prior art, the hash value of the software package is recorded in the original repository index file.
The software package updating method 600 is suitable for both a newly created software warehouse and a software warehouse in which a software package is already stored, where "update" may be a software package that uploads a new version of software already in the original warehouse or a completely new software package.
In addition, the software package generated by copying in the method 600 is a static warehouse file, does not need the support of a special server, and can be quickly and widely applied to aspects such as warehouse synchronization, warehouse caching and the like; and the method can be combined with a CDN and an open source warehouse source for use, thereby greatly improving the reliability of the warehouse.
A preferred implementation of the method 600 is given below, as shown in fig. 7, the method 600 is packaged as a hook script, and the warehouse management software employs repiprro. When the service end imports the deb file, the hook script is started to be executed. Reading a Packages file, obtaining a file path and a hash value of deb, then adding the hash value to a file name in the file path to obtain a new file path, namely a target path, judging whether a file exists under the target path, if the file does not exist, copying the deb file under the target path, modifying the path of the deb file in the Packages to point to the target path, if the file exists under the target path, modifying the path of the deb file in the Packages to point to the target path, then reading the path and the hash value of the next deb file in the Packages until the Packages file is read, saving the Packages file, and finishing updating the deb.
The software package update process shown in fig. 7 may be implemented using the following code:
#!/bin/python2
# -*- coding:utf8 -*-
import os
import sys
def getValue(line):
return line[line.index(" "):].strip()
def handle(lines):
m = {}
# record software package path and Hash correspondence Table
for line in lines:
if line.startswith("Filename: "):
deb = getValue(line)
elif line.startswith("MD5sum: "):
if len(deb) != 0:
m[deb] = getValue(line)
Concatenating hashes in software package path
for index, line in enumerate(lines):
if line.startswith("Filename: "):
deb = getValue(line)
(filepath, ext) = os.path.splitext(deb)
byhash = filepath+"_MD5sum-"+m[deb]+ext
if os.path.exists(deb) and not os.path.exists(byhash):
os.link(deb, byhash)
lines[index] = "Filename: "+byhash+"\n"
return lines
rootDir = sys.argv[1]
newFile = sys.argv[2]
oldFile = sys.argv[3]
status = sys.argv[4]
outFile = os.path.join(os.path.dirname(newFile), "Packages.new")
if status == "old":
raw = os.path.join(rootDir, oldFile)
else:
raw = os.path.join(rootDir, newFile)
# read PackagesRaw
with open(raw) as f:
lines = f.readlines()
Package for # storage
with open(os.path.join(rootDir, outFile), "w") as f:
f.writelines(handle(lines))
New to repeprro for the production of Release
os.write(3, outFile)
The following is an example of a specific process for updating a software package to an original warehouse by using the flow shown in fig. 7.
For example, the original repository has A, B, C three software packages stored therein, each of which exists in only one path, i.e., the original path. The original warehouse index file records original path A1 of A, hash value HA of A, original path B1 of B, hash value HB of B, original path C1 of C, and hash value HC of C.
When the A is upgraded to be A ', the software package upgrading management is carried out by adopting the existing warehouse management software, the original path of the A ' is A ' 1, the Hash value of the A ' is HA ', the A ' is led into the path A ' 1, and then the content recorded by the original warehouse index file is updated to be: original path A '1 of A', hash value HA 'of A', original path B1 of B, hash value HB of B, original path C1 of C, and hash value HC of C. When the software package A' is detected to be introduced, copying the content of the original warehouse index file into a memory to form a target warehouse index file. And sequentially reading the original path and the hash value of each software package in the target warehouse index file. Firstly, reading hash values HA 'of an original path A' 1 and A 'of A', splicing the hash values HA 'and A', and obtaining that a target path of A 'is A' 2, wherein A '2 = A' 1+ HA ', detecting whether a file is stored under the path A' 2, wherein the detection result is that no file is stored, at the moment, copying A 'from the original path A' 1 to the target path A '2, and then modifying the path A' 1 of A 'in the target warehouse index file into A' 2; reading hash values HB of an original path B1 and B of B, splicing the hash values HB and B to obtain a target path B2, wherein B2= B1+ HB, detecting whether files are stored in the path B2, copying B from the original path B1 to the target path B2 when a detection result shows that no file is stored, and modifying the path B1 of B in the target warehouse index file into B2; reading hash values HC of an original path C1 and C of the C, splicing the hash values HC and the original path C1 to obtain a target path C2 of the C, wherein the target path C2= C1+ HC, detecting whether files are stored in a path C2, and copying the C from the original path C1 to the target path C2 if the detection result shows that no files are stored, and then modifying the path C1 of the C in the target warehouse index file into C2; and finally, storing the target warehouse index file to finish the import of the software package A'.
The method 600 continues to be used to update the software package B. In the same way, an original path B '1 and a hash value HB' of the upgraded version B 'of B' are obtained, B 'is imported into the original path B' 1, and at this time, the content of the original warehouse index file is updated as follows: original path a '1 of a', hash value HA 'of a', original path B '1 of B', hash value HB 'of B', original path C1 of C, and hash value HC of C. When the upgrade version B 'of the B is detected to be led into the path B' 1, copying the content of the original warehouse index file into a memory to form a target warehouse index file.
And sequentially reading the original path and the hash value of each software package in the target warehouse index file. Firstly, reading hash values HA ' of an original path A ' 1 and an original path A ' of A ', splicing the hash values HA ' and the original path A ' 1 to obtain a target path A ' 2, wherein A ' 2= A ' 1+ HA ', detecting whether a file is stored under the path A ' 2, and detecting that a software package A ' exists under the path, and at the moment, skipping a software package copying process and modifying the path A ' 1 of the A ' in a target warehouse index file into A ' 2; next, reading hash values HB ' of original paths B ' 1 and B ' of B ', and splicing the hash values HB ' and B ', to obtain a target path B ' 2, where B ' 2= B ' 1+ H B ', detecting whether a file is stored under the path B ' 2, where the detection result is that no file is stored, at this time, copying B ' from the original path B ' 1 to the target path B ' 2, and then modifying the path B ' 1 of B ' in the target warehouse index file to B ' 2; next, reading hash values HC of original paths C1 and C of the C, and splicing the hash values HC to obtain a target path C2, wherein C2= C1+ HC, detecting whether a file is stored in the path C2, and determining that a software package C exists in the path, at this time, skipping a software package copying process, and modifying a path C1 of the C in the target warehouse index file into C2; and finally, storing the target warehouse index file to finish the import of the software package B'.
Embodiments of the present invention also provide a software package updating apparatus 800 capable of performing the processes of the steps of the software package updating method 600 as described above. The above-described software package update apparatus 800 is described below with reference to fig. 8.
As shown in fig. 8, the software package updating apparatus 800 includes an initialization unit 810, a file copying unit 820, and a path modifying unit 830.
The initialization unit 810 is adapted to generate a target repository index file in response to detecting that the software package is updated in the original repository, where the content of the target repository index file record is the same as the content of the original repository index file record in the original repository.
The file copy unit 820 is adapted to copy the software package from an original path in the original repository to a target path in the target repository.
The path modification unit 830 is adapted to modify the original path of the software package in the target warehouse index file into the target path, so as to obtain an updated target warehouse index file, and complete the update of the software package.
According to one implementation of the invention, the file replication unit 820 includes a path acquisition sub-unit and a first replication sub-unit. The path obtaining subunit is adapted to obtain a target path of each software package in the target repository index file. The first replication sub-unit is adapted to replicate a software package corresponding to the target path from the original path in the original repository to the target path in the target repository, in case the target path does not store a file.
According to another implementation of the invention, the file replication unit 820 comprises a positioning sub-unit and a second replication sub-unit. The positioning subunit is suitable for positioning the currently imported software package to acquire an original path of the currently imported software package. The second replication subunit is adapted to replicate the software package from the original path in the original repository to the target path in the target repository.
According to one implementation of the present invention, the target path is obtained from the original path of the software package corresponding thereto.
According to one implementation mode of the invention, the target path is obtained by splicing the original path of the software package corresponding to the target path and the hash value.
According to one implementation of the invention, the software package is copied from the original path in the original warehouse to the target path in the target warehouse in a hard link mode.
The various techniques described herein may be implemented in connection with hardware or software or, alternatively, with a combination of both. Thus, the methods and apparatus of the present invention, or certain aspects or portions thereof, may take the form of program code (i.e., instructions) embodied in tangible media, such as removable hard drives, U.S. disks, floppy disks, CD-ROMs, or any other machine-readable storage medium, wherein, when the program is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the invention.
In the case of program code execution on programmable computers, the computing device will generally include a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device. Wherein the memory is configured to store program code; the processor is configured to perform the software package update method of the present invention according to instructions in the program code stored in the memory.
By way of example, and not limitation, readable media may comprise readable storage media and communication media. Readable storage media store information such as computer readable instructions, data structures, program modules or other data. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. Combinations of any of the above are also included within the scope of readable media.
In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with examples of this invention. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose preferred embodiments of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in a device as described in this embodiment or alternatively may be located in one or more devices different from the devices in this example. The modules in the foregoing examples may be combined into one module or may be further divided into multiple sub-modules.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. Furthermore, some of the described embodiments are described herein as a method or combination of method elements that can be performed by a processor of a computer system or by other means of performing the described functions. A processor having the necessary instructions for carrying out the method or method elements thus forms a means for carrying out the method or method elements. Further, the elements of the apparatus embodiments described herein are examples of the following apparatus: the apparatus is used to implement the functions performed by the elements for the purpose of carrying out the invention.
As used herein, unless otherwise specified the use of the ordinal adjectives "first", "second", "third", etc., to describe a common object, merely indicate that different instances of like objects are being referred to, and are not intended to imply that the objects so described must be in a given sequence, either temporally, spatially, in ranking, or in any other manner.
While the invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of this description, will appreciate that other embodiments can be devised which do not depart from the scope of the invention as described herein. Furthermore, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter.

Claims (10)

1. A software package updating method is suitable for a server side, and comprises the following steps:
in response to detecting that the software package is completely updated in the original warehouse, generating a target warehouse index file, wherein the content of the target warehouse index file is the same as the content of the original warehouse index file in the original warehouse;
copying the software package from an original path in the original repository to a target path in a target repository; and
and modifying the original path of the software package in the target warehouse index file into the target path to obtain an updated target warehouse index file, and completing the update of the software package.
2. A software package updating method as defined in claim 1, wherein said step of copying said software package from an original path in said original repository to a target path in a target repository comprises:
acquiring a target path of each software package in the target warehouse index file; and
in the event that the target path does not store a file, copying a software package corresponding to the target path from an original path in the original repository to a target path in the target repository.
3. A software package updating method according to claim 1 or 2, wherein said step of copying the software package from an original path in the original repository to a target path in a target repository comprises:
positioning the software package to obtain an original path of the software package; and
copying the software package from an original path in the original repository to a target path in the target repository.
4. A software package updating method according to claim 1 or 2, wherein the target path is obtained from the original path of the software package corresponding thereto.
5. The software package updating method according to claim 4, wherein the target path is obtained by concatenating the hash value and the original path of the software package corresponding thereto.
6. The software package updating method of claim 2, wherein the software package is copied from the original path in the original warehouse to the target path in the target warehouse by means of hard link.
7. A software package update apparatus, adapted to a server, the apparatus comprising:
the initialization unit is used for responding to the fact that the software package is detected to be updated in the original warehouse completely, and generating a target warehouse index file, wherein the content of the target warehouse index file is the same as the content of the original warehouse index file in the original warehouse;
a file copying unit adapted to copy the software package from an original path in the original repository to a target path in a target repository; and
and the path modification unit is suitable for modifying the original path of the software package in the target warehouse index file into the target path to obtain an updated target warehouse index file and finish the update of the software package.
8. The software package updating apparatus according to claim 7, wherein the file copying unit includes:
the path acquisition subunit is suitable for acquiring a target path of each software package in the target warehouse index file; and
a first replication sub-unit adapted to, in a case where the target path does not store a file, replicate a software package corresponding to the target path from an original path in the original warehouse to the target path in the target warehouse.
9. A computing device, comprising:
at least one processor and a memory storing program instructions;
the program instructions, when read and executed by the processor, cause the computing device to perform the software package update method of any one of claims 1-6.
10. A readable storage medium storing program instructions which, when read and executed by a computing device, cause the computing device to perform the software package update method of any one of claims 1-6.
CN202210340284.3A 2022-04-02 2022-04-02 Software package updating method and device and computing equipment Active CN114489739B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210731169.9A CN115167888A (en) 2022-04-02 2022-04-02 Software package updating method and device and computing equipment
CN202210340284.3A CN114489739B (en) 2022-04-02 2022-04-02 Software package updating method and device and computing equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210340284.3A CN114489739B (en) 2022-04-02 2022-04-02 Software package updating method and device and computing equipment

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202210731169.9A Division CN115167888A (en) 2022-04-02 2022-04-02 Software package updating method and device and computing equipment

Publications (2)

Publication Number Publication Date
CN114489739A true CN114489739A (en) 2022-05-13
CN114489739B CN114489739B (en) 2022-08-12

Family

ID=81488393

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202210340284.3A Active CN114489739B (en) 2022-04-02 2022-04-02 Software package updating method and device and computing equipment
CN202210731169.9A Pending CN115167888A (en) 2022-04-02 2022-04-02 Software package updating method and device and computing equipment

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN202210731169.9A Pending CN115167888A (en) 2022-04-02 2022-04-02 Software package updating method and device and computing equipment

Country Status (1)

Country Link
CN (2) CN114489739B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8001083B1 (en) * 2007-05-09 2011-08-16 Vmware, Inc. Repository including version management
CN108595186A (en) * 2018-03-27 2018-09-28 天津麒麟信息技术有限公司 Multiversion software management method based on total function on a kind of platform of soaring
CN109783076A (en) * 2018-12-14 2019-05-21 深圳壹账通智能科技有限公司 Code administration method, apparatus, equipment and storage medium based on git
CN112015448A (en) * 2020-08-21 2020-12-01 新奥数能科技有限公司 System upgrading method and device based on over-the-air technology
CN112347097A (en) * 2020-09-23 2021-02-09 中国科学院信息工程研究所 Data loading and query method supporting multi-version Hive table partition and electronic device
CN113094084A (en) * 2021-04-07 2021-07-09 中国工商银行股份有限公司 Version construction method, version construction device, electronic equipment and readable storage medium
CN114090013A (en) * 2021-11-24 2022-02-25 中国银行股份有限公司 Method and device for determining change set of executable code file
CN114185592A (en) * 2021-12-20 2022-03-15 深圳依时货拉拉科技有限公司 Multi-version coexisting target item access method, device, equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8001083B1 (en) * 2007-05-09 2011-08-16 Vmware, Inc. Repository including version management
CN108595186A (en) * 2018-03-27 2018-09-28 天津麒麟信息技术有限公司 Multiversion software management method based on total function on a kind of platform of soaring
CN109783076A (en) * 2018-12-14 2019-05-21 深圳壹账通智能科技有限公司 Code administration method, apparatus, equipment and storage medium based on git
CN112015448A (en) * 2020-08-21 2020-12-01 新奥数能科技有限公司 System upgrading method and device based on over-the-air technology
CN112347097A (en) * 2020-09-23 2021-02-09 中国科学院信息工程研究所 Data loading and query method supporting multi-version Hive table partition and electronic device
CN113094084A (en) * 2021-04-07 2021-07-09 中国工商银行股份有限公司 Version construction method, version construction device, electronic equipment and readable storage medium
CN114090013A (en) * 2021-11-24 2022-02-25 中国银行股份有限公司 Method and device for determining change set of executable code file
CN114185592A (en) * 2021-12-20 2022-03-15 深圳依时货拉拉科技有限公司 Multi-version coexisting target item access method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN115167888A (en) 2022-10-11
CN114489739B (en) 2022-08-12

Similar Documents

Publication Publication Date Title
US11366654B2 (en) Application management within deployable object hierarchy
US9880889B2 (en) Virtual application extension points
JP5911504B2 (en) Software image upgrade based on streaming technology
US8972967B2 (en) Application packages using block maps
US9432457B2 (en) Redirecting local storage to cloud storage
KR100965706B1 (en) Computer apparatus capable of code rewriting and method for code rewriting
KR101246982B1 (en) Using external memory devices to improve system performance
JP4855714B2 (en) System and method for accessing computer files across computer operating systems
US20050004925A1 (en) Copy-on-write mapping file system
US9928010B2 (en) Methods and apparatus to re-direct detected access requests in a modularized virtualization topology using virtual hard disks
US11182346B2 (en) File sharing among virtual containers with fast recovery and self-consistency
US11418555B1 (en) Systems and methods for streaming an application via object storage
CN112947976B (en) Operating system upgrading method, computing device and storage medium
US9804789B2 (en) Methods and apparatus to apply a modularized virtualization topology using virtual hard disks
CN113553010A (en) Optical disc file checking method, optical disc recording method and computing device
CN113076170A (en) Remote assistance method, system, device, computing equipment and storage medium
US20140019954A1 (en) Controlling access to software component state
WO2021040843A1 (en) Hydration of applications
JP5536593B2 (en) Optimization device, optimization method, and compiler program
CN114489739B (en) Software package updating method and device and computing equipment
US8819657B1 (en) Method and apparatus for maintaining data consistency in a virtualized application during software update installation
CN113254888B (en) Method for acquiring hardware information, authorization control system and computing equipment
US10126983B2 (en) Methods and apparatus to enforce life cycle rules in a modularized virtualization topology using virtual hard disks
CN112231761A (en) Device mounting method, computing device and readable storage medium
US10599617B2 (en) Methods and apparatus to modify a binary file for scalable dependency loading on distributed computing systems

Legal Events

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