CN115167888A - 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
CN115167888A
CN115167888A CN202210731169.9A CN202210731169A CN115167888A CN 115167888 A CN115167888 A CN 115167888A CN 202210731169 A CN202210731169 A CN 202210731169A CN 115167888 A CN115167888 A CN 115167888A
Authority
CN
China
Prior art keywords
path
software package
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.)
Pending
Application number
CN202210731169.9A
Other languages
Chinese (zh)
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
Publication of CN115167888A publication Critical patent/CN115167888A/en
Pending legal-status Critical Current

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 update of the software package.

Description

Software package updating method and device and computing equipment
This application is a divisional application of patent application 2022103402843, filed on 04/02/2022.
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 increasing improvement of the ecology of the Linux desktop, the requirements of users on software are gradually increased, so that the updating frequency of the software is increased, and the requirements are also the 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 debian 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 the packages suitable for different processor architectures, and the packages record the storage addresses of the debs. 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 record the storage address of deb of the amd64 schema, and packages of the i386 schema record the storage address of deb of the i386 schema.
As shown in fig. 2, the server 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: firstly, deb _ v2 is imported into a software warehouse of a server, and since the repipro tool only allows one copy of deb with the same package name as the architecture, the repipro 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 the deb _ v1, the clients cannot download the packages to the deb file when running the packages because the 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 into 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: dis/eagle/main/binary-amd 64/by-hash/MD5Sum/4d4bd928d09a48c193ac6ec54ad4ccbe. 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 warehouse to the target path in the target warehouse 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 warehouse to the target path in the target warehouse by means of hard link.
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.
Alternatively, 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 illustrates a basic structure of a server-side debian warehouse according to the background art of the present 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 flow chart of acquiring a packages file according to the background art of the 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 shows 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 may be the same as that of the computing device 500 shown in fig. 5 or different from that of 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. An example memory controller 518 may be used with processor 504, or in some implementations memory controller 518 may be an internal part of 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 may include a serial interface controller 554 and a parallel interface controller 556, which may be configured to facilitate communications 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.
The 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, in a modulated data signal, such as a carrier wave or other transport mechanism, and may include any information delivery media. 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 a portion 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 the fact that the software package is detected to be completely updated in the original warehouse, generating a target warehouse index file, wherein the content recorded by the target warehouse index file is the same as the content recorded by 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 update 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 complete the update of the software package.
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 in the target path is not deleted, when the client downloads the software package, according to the existing mode, the target warehouse index file is first 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 in 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, it is necessary to traverse the target paths of all software packages in the target repository index file, determine whether the target paths are empty, find the original path of the software package corresponding to a certain target path when the certain target path is empty, and copy the software package 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 warehouse to the target path in the target warehouse. In the mode, only one software package needs to be subjected to data processing, so that the traversing process is avoided.
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 such that a certain parameter is added 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 parameters, and when the target warehouse index file is read, the corresponding parameter is added on the read original path of the software package, so that the target path of the software package may be obtained. The process of obtaining the target path 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, then 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:
Figure BDA0003713551570000101
Figure BDA0003713551570000111
Figure BDA0003713551570000121
the following illustrates a specific process of updating a software package for an original warehouse by using the flow shown in fig. 7.
For example, the original warehouse stores A, B, C three software packages, each of which exists in only one path, i.e., the original path. The original warehouse index file records an original path A1 of A, a hash value HA of A, an original path B1 of B, a hash value HB of B, an original path C1 of C, and a hash value HC of C.
To upgrade a to a ', software package upgrade management is performed by using existing warehouse management software, and the hash value of the original path of a' is a1,A 'is HA', a 'is imported into the path a'1, so that the content recorded in the original warehouse index file is updated as follows: the original path A '1 of A', the hash value HA 'of A', the original path B1 of B, the hash value HB of B, the original path C1 of C, and the 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' and splicing the hash values HA 'and A' to obtain a target path A '2, wherein A'2=A '1+ HA', detecting whether a file is stored in the path A '2, and 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 to A '2 if no file is stored in the path A'2; reading the hash values HB of the original path B1 and the original path B of the B, splicing the hash values HB and the original path B1 to obtain a target path B2, wherein B2= B1+ HB, detecting whether a file is stored under the path B2, and copying the B from the original path B1 to the target path B2 at the moment if no file is stored in the detection result, and then modifying the path B1 of the 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, detecting whether a file is stored under the path C2 or not if the file is stored under the path C2, copying the C from the original path C1 to the target path C2 at the moment, and modifying the path C1 of the C in the target warehouse index file into the path 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 A ' of A ' and splicing the hash values HA ' and A ' to obtain a target path A '2, detecting whether a file is stored in the path A '2, and at this time, skipping a software package copying process and modifying a path A '1 of A ' in a target warehouse index file into A '2, wherein A '2 is a target path A ', and A '1 is a target path A ' 1; 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, then B '2= B '1+ h B ', detecting whether a file is stored under the path B '2, and if the detection result is that no file is stored, copying B ' from the original path B '1 to the target path B '2, and then modifying a path B '1 of B ' in the target warehouse index file to B '2; reading the hash values HC of the original path C1 and C of the C, splicing the hash values HC and C to obtain a target path C2 of the C, detecting whether a file is stored under the path C2 or not if the C2 + HC is detected, and modifying the path C1 of the C in the target warehouse index file into C2 if the C2 + HC is detected, wherein the software package C exists under the path 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 is 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 construed to reflect the intent: 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 device 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.
Moreover, those skilled in the art will appreciate that although some embodiments described herein include some features included in other embodiments, not others, 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 (8)

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;
positioning the software package to obtain an original path of the software package;
copying the software package from an original path in the original warehouse to a target path in a target warehouse, wherein the target path is obtained by the original path of the software package corresponding to the target path; 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 claimed 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. The software package updating method according to claim 1 or 2, wherein the target path is obtained by concatenating the hash value and the original path of the software package corresponding thereto.
4. A software package updating method according to claim 1 or 2, wherein the software package is copied from the original path in the original repository to the target path in the target repository by means of a hard link.
5. 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;
the file copying unit is suitable for copying the software package from an original path in the original warehouse to a target path in a target warehouse, wherein the file copying unit comprises a positioning subunit and a second copying subunit, and the positioning subunit is suitable for positioning the software package to obtain the original path of the software package; the second replication sub-unit is adapted to replicate the software package from an original path in the original warehouse to a target path in the target warehouse, the target path being obtained from the original path of the software package corresponding thereto; 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.
6. The software package updating apparatus according to claim 5, wherein the file copying unit further comprises:
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.
7. 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-4.
8. 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-4.
CN202210731169.9A 2022-04-02 2022-04-02 Software package updating method and device and computing equipment Pending CN115167888A (en)

Priority Applications (1)

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

Applications Claiming Priority (2)

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
CN202210731169.9A CN115167888A (en) 2022-04-02 2022-04-02 Software package updating method and device and computing equipment

Related Parent Applications (1)

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

Publications (1)

Publication Number Publication Date
CN115167888A true CN115167888A (en) 2022-10-11

Family

ID=81488393

Family Applications (2)

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
CN202210340284.3A Active CN114489739B (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
CN202210340284.3A Active CN114489739B (en) 2022-04-02 2022-04-02 Software package updating method and device and computing equipment

Country Status (1)

Country Link
CN (2) CN115167888A (en)

Family Cites Families (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
CN108595186B (en) * 2018-03-27 2021-12-10 麒麟软件有限公司 Multi-version software management method based on complete function on Feiteng platform
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
CN112347097B (en) * 2020-09-23 2022-07-29 中国科学院信息工程研究所 Data loading and query method supporting multi-version Hive table partition and electronic device
CN113094084B (en) * 2021-04-07 2024-02-27 中国工商银行股份有限公司 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
CN114489739A (en) 2022-05-13
CN114489739B (en) 2022-08-12

Similar Documents

Publication Publication Date Title
US11366654B2 (en) Application management within deployable object hierarchy
US11818224B2 (en) On demand resources
US9332083B2 (en) High performance, distributed, shared, data grid for distributed Java virtual machine runtime artifacts
US9170855B2 (en) Virtual application extension points
KR101643022B1 (en) Catalog-based software component management
US9569400B2 (en) RDMA-optimized high-performance distributed cache
US8972967B2 (en) Application packages using block maps
US9880824B2 (en) On demand resources
US10656845B2 (en) System and method for managing container image
EP3526691B1 (en) File synchronization in computing systems
US20120072911A1 (en) Trace assisted prefetching of virtual machines in a distributed system
US8949590B2 (en) Controlling access to software component state
WO2021040843A1 (en) Hydration of applications
US8863116B1 (en) Pre-storing blocks for a streamed application in a local cache on a host computer system
US10802865B2 (en) Fast instantiation of virtual machines in distributed computing systems
US10474659B2 (en) Large scale network system upgrade
JP5536593B2 (en) Optimization device, optimization method, and compiler program
CN114489739B (en) Software package updating method and device and computing equipment
Martin Working with API Resources in Go
CN115840587A (en) Static resource publishing method and device, computing equipment and storage medium
JPH10320340A (en) Message control method and device therefor in client server system, and recording medium for programming and recording and propagating the same method and communication medium
Cinar et al. Storing Data
JP2012190107A (en) Document management device, document management system, document management program and document management method
JP2009205480A (en) File management, file server, client, file management method and program

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